chord_diagrams 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chord_diagrams.rb +4 -121
- data/lib/chord_diagrams/fingerings.rb +122 -0
- data/lib/chord_diagrams/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f917ed924b695bd82eaa9dc5f5253ce86136de34050c372166dd2e958952244e
|
4
|
+
data.tar.gz: 467fc8f53c37e965c7f137c6e4749545956b2477f467dcdb730ea3d8a7a93957
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29be58789b8c63d8ba6a19b1c84cf0c3d03b557ac48c234c2abc3f4e2f68ed2345f464037a89d4b93f4f172e3f589f82bfb4a84cbe67bc95ab49943a25fa7199
|
7
|
+
data.tar.gz: 5317272f9c36b0856e92d47cc667171b8849cd38b82fcb9cd4b20b48515eac99783756ea8ba55b71106f430d42c6e2ec7894c3a66eeac037deb10739984f3ae4
|
data/lib/chord_diagrams.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'chord_diagrams/version'
|
2
|
+
require 'chord_diagrams/fingerings'
|
2
3
|
require 'victor'
|
3
4
|
|
4
5
|
module ChordDiagrams
|
@@ -16,7 +17,9 @@ module ChordDiagrams
|
|
16
17
|
ChordDiagrams.draw_frets(svg)
|
17
18
|
ChordDiagrams.draw_strings(svg)
|
18
19
|
|
19
|
-
|
20
|
+
if fingerings.nil?
|
21
|
+
fingerings = ChordDiagrams::FINGERINGS[name.to_sym]
|
22
|
+
end
|
20
23
|
|
21
24
|
if !fingerings.nil?
|
22
25
|
ChordDiagrams.draw_chord_diagram(fingerings, svg)
|
@@ -112,124 +115,4 @@ module ChordDiagrams
|
|
112
115
|
end
|
113
116
|
end
|
114
117
|
end
|
115
|
-
|
116
|
-
CHORD_FINGERINGS = {
|
117
|
-
# Major Chords
|
118
|
-
'A': '002220',
|
119
|
-
'B': 'x24442',
|
120
|
-
'Bb': 'x13331',
|
121
|
-
'C': 'x32010',
|
122
|
-
'C#': 'x46664',
|
123
|
-
'D': 'x00232',
|
124
|
-
'D#': 'x68886',
|
125
|
-
'E': '022100',
|
126
|
-
'Eb': 'x68886',
|
127
|
-
'F': '133211',
|
128
|
-
'F#': '244322',
|
129
|
-
'G': '320003',
|
130
|
-
'G#': '466544',
|
131
|
-
|
132
|
-
# Root/Five Chords
|
133
|
-
'C5': 'x355xx',
|
134
|
-
'D5': 'x577xx',
|
135
|
-
'D#5': 'x688xx',
|
136
|
-
|
137
|
-
# Six Chords
|
138
|
-
'D6': 'xx0202',
|
139
|
-
'E6': '022120',
|
140
|
-
'G6': '320000',
|
141
|
-
|
142
|
-
# Seventh Chords
|
143
|
-
'A7': '002020',
|
144
|
-
'B7': 'x21202',
|
145
|
-
'C7': 'x32310',
|
146
|
-
'C#7': 'x46464',
|
147
|
-
'D7': 'x00212',
|
148
|
-
'E7': '020100',
|
149
|
-
'F7': '131211',
|
150
|
-
'F#7': '242322',
|
151
|
-
'G7': '320001',
|
152
|
-
'G#7': '464544',
|
153
|
-
|
154
|
-
# Major Seventh Chords
|
155
|
-
'AM7': 'x02120',
|
156
|
-
'CM7': 'x32000',
|
157
|
-
'DM7': 'xx0222',
|
158
|
-
'EM7': 'xx2444',
|
159
|
-
'FM7': '132211',
|
160
|
-
|
161
|
-
# Major Suspended 2nd Chords
|
162
|
-
'Dsus2': 'xx0230',
|
163
|
-
'Asus2': 'x02200',
|
164
|
-
|
165
|
-
# Major Suspended 4th Chords
|
166
|
-
'Asus4': 'x02230',
|
167
|
-
'Dsus4': 'xx0233',
|
168
|
-
'Esus4': '022200',
|
169
|
-
|
170
|
-
# Seventh Suspended 4th Chords
|
171
|
-
'A7sus4': '002030',
|
172
|
-
'G7sus4': '353533',
|
173
|
-
|
174
|
-
# Minor Chords
|
175
|
-
'Am': '002210',
|
176
|
-
'Bm': 'x24432',
|
177
|
-
'Cm': 'x35543',
|
178
|
-
'C#m': 'x46654',
|
179
|
-
'Dm': 'x00231',
|
180
|
-
'Em': '022000',
|
181
|
-
'Fm': '133111',
|
182
|
-
'F#m': '244222',
|
183
|
-
'Gm': '355333',
|
184
|
-
'G#m': '466444',
|
185
|
-
|
186
|
-
# Minor Seventh Chords
|
187
|
-
'Am7': '002010',
|
188
|
-
'A#m7': 'x13121',
|
189
|
-
'Bm7': 'x24232',
|
190
|
-
'Cm7': 'x35343',
|
191
|
-
'C#m7': 'x46454',
|
192
|
-
'Dm7': 'x00211',
|
193
|
-
'Em7': '020030',
|
194
|
-
'Fm7': '131111',
|
195
|
-
'F#m7': '242222',
|
196
|
-
'Gm7': '353333',
|
197
|
-
|
198
|
-
# Minor Eleventh Chords
|
199
|
-
'Bm11': 'x20220',
|
200
|
-
'F#m11': '202200',
|
201
|
-
|
202
|
-
# Major 9th Chords
|
203
|
-
'Cadd9': 'x32033',
|
204
|
-
|
205
|
-
# Major Chords with Bass Notes
|
206
|
-
'A/C#': '002220',
|
207
|
-
'A/E': '04222x',
|
208
|
-
'A/F#': '202220',
|
209
|
-
'Bb/A': 'x00331',
|
210
|
-
'C/B': 'x22010',
|
211
|
-
'C/E': '032010',
|
212
|
-
'D/A': 'x04232',
|
213
|
-
'D/F#': '200232',
|
214
|
-
'F/A': 'x03211',
|
215
|
-
'G/B': 'x20003',
|
216
|
-
|
217
|
-
# Seventh Chords with Bass Notes
|
218
|
-
'C7/G': '3323xx',
|
219
|
-
'D7/F#': '200212',
|
220
|
-
|
221
|
-
# Minor Chords with Bass Notes
|
222
|
-
'Am/D': 'xx0210',
|
223
|
-
'Am/G': '302210',
|
224
|
-
'A#m/D#': 'xx1321',
|
225
|
-
'Dm/F': '10323x',
|
226
|
-
'Gm/Bb': 'x10333',
|
227
|
-
|
228
|
-
# Diminished Chords
|
229
|
-
'G#dim': '4564xx',
|
230
|
-
|
231
|
-
# Diminished Seventh Chords
|
232
|
-
'D#dim7': 'xx1212',
|
233
|
-
'G#dim7': '456464'
|
234
|
-
}.freeze
|
235
118
|
end
|
@@ -0,0 +1,122 @@
|
|
1
|
+
module ChordDiagrams
|
2
|
+
FINGERINGS = {
|
3
|
+
# Major Chords
|
4
|
+
'A': '002220',
|
5
|
+
'B': 'x24442',
|
6
|
+
'Bb': 'x13331',
|
7
|
+
'C': 'x32010',
|
8
|
+
'C#': 'x46664',
|
9
|
+
'D': 'x00232',
|
10
|
+
'D#': 'x68886',
|
11
|
+
'E': '022100',
|
12
|
+
'Eb': 'x68886',
|
13
|
+
'F': '133211',
|
14
|
+
'F#': '244322',
|
15
|
+
'G': '320003',
|
16
|
+
'G#': '466544',
|
17
|
+
|
18
|
+
# Root/Five Chords
|
19
|
+
'C5': 'x355xx',
|
20
|
+
'D5': 'x577xx',
|
21
|
+
'D#5': 'x688xx',
|
22
|
+
|
23
|
+
# Six Chords
|
24
|
+
'D6': 'xx0202',
|
25
|
+
'E6': '022120',
|
26
|
+
'G6': '320000',
|
27
|
+
|
28
|
+
# Seventh Chords
|
29
|
+
'A7': '002020',
|
30
|
+
'B7': 'x21202',
|
31
|
+
'C7': 'x32310',
|
32
|
+
'C#7': 'x46464',
|
33
|
+
'D7': 'x00212',
|
34
|
+
'E7': '020100',
|
35
|
+
'F7': '131211',
|
36
|
+
'F#7': '242322',
|
37
|
+
'G7': '320001',
|
38
|
+
'G#7': '464544',
|
39
|
+
|
40
|
+
# Major Seventh Chords
|
41
|
+
'AM7': 'x02120',
|
42
|
+
'CM7': 'x32000',
|
43
|
+
'DM7': 'xx0222',
|
44
|
+
'EM7': 'xx2444',
|
45
|
+
'FM7': '132211',
|
46
|
+
|
47
|
+
# Major Suspended 2nd Chords
|
48
|
+
'Dsus2': 'xx0230',
|
49
|
+
'Asus2': 'x02200',
|
50
|
+
|
51
|
+
# Major Suspended 4th Chords
|
52
|
+
'Asus4': 'x02230',
|
53
|
+
'Dsus4': 'xx0233',
|
54
|
+
'Esus4': '022200',
|
55
|
+
|
56
|
+
# Seventh Suspended 4th Chords
|
57
|
+
'A7sus4': '002030',
|
58
|
+
'G7sus4': '353533',
|
59
|
+
|
60
|
+
# Minor Chords
|
61
|
+
'Am': '002210',
|
62
|
+
'Bm': 'x24432',
|
63
|
+
'Cm': 'x35543',
|
64
|
+
'C#m': 'x46654',
|
65
|
+
'Dm': 'x00231',
|
66
|
+
'Em': '022000',
|
67
|
+
'Fm': '133111',
|
68
|
+
'F#m': '244222',
|
69
|
+
'Gm': '355333',
|
70
|
+
'G#m': '466444',
|
71
|
+
|
72
|
+
# Minor Seventh Chords
|
73
|
+
'Am7': '002010',
|
74
|
+
'A#m7': 'x13121',
|
75
|
+
'Bm7': 'x24232',
|
76
|
+
'Cm7': 'x35343',
|
77
|
+
'C#m7': 'x46454',
|
78
|
+
'Dm7': 'x00211',
|
79
|
+
'Em7': '020030',
|
80
|
+
'Fm7': '131111',
|
81
|
+
'F#m7': '242222',
|
82
|
+
'Gm7': '353333',
|
83
|
+
|
84
|
+
# Minor Eleventh Chords
|
85
|
+
'Bm11': 'x20220',
|
86
|
+
'F#m11': '202200',
|
87
|
+
|
88
|
+
# Major 9th Chords
|
89
|
+
'Cadd9': 'x32033',
|
90
|
+
|
91
|
+
# Major Chords with Bass Notes
|
92
|
+
'A/C#': '002220',
|
93
|
+
'A/E': '04222x',
|
94
|
+
'A/F#': '202220',
|
95
|
+
'Bb/A': 'x00331',
|
96
|
+
'C/B': 'x22010',
|
97
|
+
'C/E': '032010',
|
98
|
+
'D/A': 'x04232',
|
99
|
+
'D/F#': '200232',
|
100
|
+
'F/A': 'x03211',
|
101
|
+
'G/B': 'x20003',
|
102
|
+
|
103
|
+
# Seventh Chords with Bass Notes
|
104
|
+
'C7/G': '3323xx',
|
105
|
+
'D7/F#': '200212',
|
106
|
+
'G7/F': '123003',
|
107
|
+
|
108
|
+
# Minor Chords with Bass Notes
|
109
|
+
'Am/D': 'xx0210',
|
110
|
+
'Am/G': '302210',
|
111
|
+
'A#m/D#': 'xx1321',
|
112
|
+
'Dm/F': '10323x',
|
113
|
+
'Gm/Bb': 'x10333',
|
114
|
+
|
115
|
+
# Diminished Chords
|
116
|
+
'G#dim': '4564xx',
|
117
|
+
|
118
|
+
# Diminished Seventh Chords
|
119
|
+
'D#dim7': 'xx1212',
|
120
|
+
'G#dim7': '456464'
|
121
|
+
}.freeze
|
122
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chord_diagrams
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Kelly
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05
|
11
|
+
date: 2019-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: victor
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- bin/setup
|
85
85
|
- chord_diagrams.gemspec
|
86
86
|
- lib/chord_diagrams.rb
|
87
|
+
- lib/chord_diagrams/fingerings.rb
|
87
88
|
- lib/chord_diagrams/version.rb
|
88
89
|
homepage: https://github.com/spilth/chord_diagrams
|
89
90
|
licenses:
|