-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
333 lines (262 loc) · 13.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fretboard</title>
<script src="d3.min.js"></script>
<script src="fretboard.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body onload="putScale();putChord();putProg();">
<div id="content">
<div id='githublink'><a href='https://github.com/mrieppel/fretboard/'><img src="github.png" style="height:25px;"></img></a></div>
<div id="title">Fretboard</div>
<div id="subtitle">Guitar Theory Visualization</div>
<div class="heading">I. Chords</div>
<p class="info">The fretboard below shows the location of every note that occurs in a given chord along the length of the fretboard. In the dropdown menus underneath the fretboard, you can select which chord's notes you want to display. Here you can specify (i) the root note, (ii) the type of chord, and (iii) the tuning that the guitar is in.</p>
<div id="chordinfo"></div>
<svg id="chordboard" width="775" height="200">
<line x1="54" y1="25" x2="54" y2="150" stroke-width="8" stroke="black"/>
<g id="frets" transform="translate(0,25)">
<line x1="105" y1="0" x2="105" y2="125" stroke-width="2" stroke="black"/>
<text x="100" y="140" font-family="Verdana" font-size="11px">1</text>
<line x1="155" y1="0" x2="155" y2="125" stroke-width="2" stroke="black"/>
<circle cx="180" cy="62" r="5" stroke="black" stroke-width="1" fill="black"/>
<text x="150" y="140" font-family="Verdana" font-size="11px">2</text>
<line x1="205" y1="0" x2="205" y2="125" stroke-width="2" stroke="black"/>
<text x="200" y="140" font-family="Verdana" font-size="11px">3</text>
<line x1="255" y1="0" x2="255" y2="125" stroke-width="2" stroke="black"/>
<circle cx="280" cy="62" r="5" stroke="black" stroke-width="1" fill="black"/>
<text x="250" y="140" font-family="Verdana" font-size="11px">4</text>
<line x1="305" y1="0" x2="305" y2="125" stroke-width="2" stroke="black"/>
<text x="300" y="140" font-family="Verdana" font-size="11px">5</text>
<line x1="355" y1="0" x2="355" y2="125" stroke-width="2" stroke="black"/>
<circle cx="380" cy="37" r="5" stroke="black" stroke-width="1" fill="black"/>
<circle cx="380" cy="87" r="5" stroke="black" stroke-width="1" fill="black"/>
<text x="350" y="140" font-family="Verdana" font-size="11px">6</text>
<line x1="405" y1="0" x2="405" y2="125" stroke-width="2" stroke="black"/>
<text x="400" y="140" font-family="Verdana" font-size="11px">7</text>
<line x1="455" y1="0" x2="455" y2="125" stroke-width="2" stroke="black"/>
<circle cx="480" cy="62" r="5" stroke="black" stroke-width="1" fill="black"/>
<text x="450" y="140" font-family="Verdana" font-size="11px">8</text>
<line x1="505" y1="0" x2="505" y2="125" stroke-width="2" stroke="black"/>
<text x="500" y="140" font-family="Verdana" font-size="11px">9</text>
<line x1="555" y1="0" x2="555" y2="125" stroke-width="2" stroke="black"/>
<text x="550" y="140" font-family="Verdana" font-size="11px">10</text>
<line x1="605" y1="0" x2="605" y2="125" stroke-width="2" stroke="black"/>
<circle cx="630" cy="37" r="5" stroke="black" stroke-width="1" fill="black"/>
<circle cx="630" cy="87" r="5" stroke="black" stroke-width="1" fill="black"/>
<text x="600" y="140" font-family="Verdana" font-size="11px">11</text>
<line x1="655" y1="0" x2="655" y2="125" stroke-width="2" stroke="black"/>
<text x="650" y="140" font-family="Verdana" font-size="11px">12</text>
<line x1="705" y1="0" x2="705" y2="125" stroke-width="2" stroke="black"/>
<text x="700" y="140" font-family="Verdana" font-size="11px">13</text>
<line x1="755" y1="0" x2="755" y2="125" stroke-width="2" stroke="black"/>
<text x="750" y="140" font-family="Verdana" font-size="11px">14</text>
</g>
<g class="string" id="s1" transform="translate(0,25)">
<line x1="50" y1="0" x2="770" y2="0" stroke-width="1" stroke="black"/>
</g>
<g class="string" id="s2" transform="translate(0,50)">
<line x1="50" y1="0" x2="770" y2="0" stroke-width="1" stroke="black"/>
</g>
<g class="string" id="s3" transform="translate(0,75)">
<line x1="50" y1="0" x2="770" y2="0" stroke-width="1" stroke="black"/>
</g>
<g class="string" id="s4" transform="translate(0,100)">
<line x1="50" y1="0" x2="770" y2="0" stroke-width="1" stroke="black"/>
</g>
<g class="string" id="s5" transform="translate(0,125)">
<line x1="50" y1="0" x2="770" y2="0" stroke-width="1" stroke="black"/>
</g>
<g class="string" id="s6" transform="translate(0,150)">
<line x1="50" y1="0" x2="770" y2="0" stroke-width="1" stroke="black"/>
</g>
</svg>
<div id="chordselectors">
<select id="chordroot" onchange="putChord();">
<option value="C" selected>C</option>
<option value="C#">C♯</option>
<option value="Db">D♭</option>
<option value="D">D</option>
<option value="D#">D♯</option>
<option value="Eb">E♭</option>
<option value="E">E</option>
<option value="F">F</option>
<option value="F#">F♯</option>
<option value="Gb">G♭</option>
<option value="G#">G♯</option>
<option value="G">G</option>
<option value="Ab">A♭</option>
<option value="A">A</option>
<option value="A#">A♯</option>
<option value="Bb">B♭</option>
<option value="B">B</option>
<option value="B#">B♯</option>
</select>
<select id="chordmode" onchange="putChord();">
<option value="2,2,1,2,2,2,1" selected>maj</option>
<option value="2,1,2,2,1,2,2">min</option>
<option value="2,2,1,3,1,2,1">aug</option>
<option value="2,1,2,1,2,2,2">dim</option>
<option value="2,2,1,2,2,2,1">sus4</option>
<option value="2,2,1,2,2,2,1">maj6</option>
<option value="2,1,2,2,2,1,2">min6</option>
<option value="2,2,1,2,2,1,2">7</option>
<option value="2,2,1,2,2,2,1">maj7</option>
<option value="2,1,2,2,1,2,2">min7</option>
<option value="2,1,2,1,2,1,3">dim7</option>
<option value="2,2,1,2,2,1,2">9</option>
</select>
<select id="chordtuning" onchange="putChord();">
<option value="E,A,D,G,B,E" selected>Standard Tuning</option>
<option value="D,A,D,G,B,E">Drop D</option>
<option value="D,A,D,F#,A,D">Open D</option>
<option value="E,B,E,G#,B,E">Open E</option>
<option value="D,G,D,G,B,D">Open G</option>
<option value="C,G,C,G,C,E">Open C</option>
<option value="C,G,C,E,G,C">Open C v2</option>
<option value="D,D,D,D,D,D">Ostrich</option>
</select>
</div> <!-- Close chordselectors div -->
<div class="heading">II. Scales</div>
<p class="info">The fretboard below shows the location of every note that occurs in a given scale along the length of the fretboard. In the dropdown menus underneath the fretboard, you can select the key for which you want to display a scale. Here you can specify (i) the root note, (ii) the mode of the key, and (iii) the tuning that the guitar is in.</p>
<div id="scaleinfo"></div>
<svg id="scaleboard" width="775" height="200">
<line x1="54" y1="25" x2="54" y2="150" stroke-width="8" stroke="black"/>
<g id="frets" transform="translate(0,25)">
<line x1="105" y1="0" x2="105" y2="125" stroke-width="2" stroke="black"/>
<text x="100" y="140" font-family="Verdana" font-size="11px">1</text>
<line x1="155" y1="0" x2="155" y2="125" stroke-width="2" stroke="black"/>
<circle cx="180" cy="62" r="5" stroke="black" stroke-width="1" fill="black"/>
<text x="150" y="140" font-family="Verdana" font-size="11px">2</text>
<line x1="205" y1="0" x2="205" y2="125" stroke-width="2" stroke="black"/>
<text x="200" y="140" font-family="Verdana" font-size="11px">3</text>
<line x1="255" y1="0" x2="255" y2="125" stroke-width="2" stroke="black"/>
<circle cx="280" cy="62" r="5" stroke="black" stroke-width="1" fill="black"/>
<text x="250" y="140" font-family="Verdana" font-size="11px">4</text>
<line x1="305" y1="0" x2="305" y2="125" stroke-width="2" stroke="black"/>
<text x="300" y="140" font-family="Verdana" font-size="11px">5</text>
<line x1="355" y1="0" x2="355" y2="125" stroke-width="2" stroke="black"/>
<circle cx="380" cy="37" r="5" stroke="black" stroke-width="1" fill="black"/>
<circle cx="380" cy="87" r="5" stroke="black" stroke-width="1" fill="black"/>
<text x="350" y="140" font-family="Verdana" font-size="11px">6</text>
<line x1="405" y1="0" x2="405" y2="125" stroke-width="2" stroke="black"/>
<text x="400" y="140" font-family="Verdana" font-size="11px">7</text>
<line x1="455" y1="0" x2="455" y2="125" stroke-width="2" stroke="black"/>
<circle cx="480" cy="62" r="5" stroke="black" stroke-width="1" fill="black"/>
<text x="450" y="140" font-family="Verdana" font-size="11px">8</text>
<line x1="505" y1="0" x2="505" y2="125" stroke-width="2" stroke="black"/>
<text x="500" y="140" font-family="Verdana" font-size="11px">9</text>
<line x1="555" y1="0" x2="555" y2="125" stroke-width="2" stroke="black"/>
<text x="550" y="140" font-family="Verdana" font-size="11px">10</text>
<line x1="605" y1="0" x2="605" y2="125" stroke-width="2" stroke="black"/>
<circle cx="630" cy="37" r="5" stroke="black" stroke-width="1" fill="black"/>
<circle cx="630" cy="87" r="5" stroke="black" stroke-width="1" fill="black"/>
<text x="600" y="140" font-family="Verdana" font-size="11px">11</text>
<line x1="655" y1="0" x2="655" y2="125" stroke-width="2" stroke="black"/>
<text x="650" y="140" font-family="Verdana" font-size="11px">12</text>
<line x1="705" y1="0" x2="705" y2="125" stroke-width="2" stroke="black"/>
<text x="700" y="140" font-family="Verdana" font-size="11px">13</text>
<line x1="755" y1="0" x2="755" y2="125" stroke-width="2" stroke="black"/>
<text x="750" y="140" font-family="Verdana" font-size="11px">14</text>
</g>
<g class="string" id="s1" transform="translate(0,25)">
<line x1="50" y1="0" x2="770" y2="0" stroke-width="1" stroke="black"/>
</g>
<g class="string" id="s2" transform="translate(0,50)">
<line x1="50" y1="0" x2="770" y2="0" stroke-width="1" stroke="black"/>
</g>
<g class="string" id="s3" transform="translate(0,75)">
<line x1="50" y1="0" x2="770" y2="0" stroke-width="1" stroke="black"/>
</g>
<g class="string" id="s4" transform="translate(0,100)">
<line x1="50" y1="0" x2="770" y2="0" stroke-width="1" stroke="black"/>
</g>
<g class="string" id="s5" transform="translate(0,125)">
<line x1="50" y1="0" x2="770" y2="0" stroke-width="1" stroke="black"/>
</g>
<g class="string" id="s6" transform="translate(0,150)">
<line x1="50" y1="0" x2="770" y2="0" stroke-width="1" stroke="black"/>
</g>
</svg>
<br>
<div id="scaleselectors">
<select id="scaleroot" onchange="putScale();">
<option value="C" selected>C</option>
<option value="C#">C♯</option>
<option value="Db">D♭</option>
<option value="D">D</option>
<option value="D#">D♯</option>
<option value="Eb">E♭</option>
<option value="E">E</option>
<option value="F">F</option>
<option value="F#">F♯</option>
<option value="Gb">G♭</option>
<option value="G#">G♯</option>
<option value="G">G</option>
<option value="Ab">A♭</option>
<option value="A">A</option>
<option value="A#">A♯</option>
<option value="Bb">B♭</option>
<option value="B">B</option>
<option value="B#">B♯</option>
</select>
<select id="scalemode" onchange="putScale();">
<option value="2,2,1,2,2,2,1" selected>Major</option>
<option value="2,1,2,2,1,2,2">Minor</option>
<option value="2,2,1,2,2,2,1">Maj. Pentatonic</option>
<option value="2,1,2,2,1,2,2">Min. Pentatonic</option>
<option value="2,1,2,1,1,1,2,2">Blues</option>
<option value="2,1,2,2,2,1,2">Dorian</option>
<option value="1,2,2,2,1,2,2">Phrygian</option>
<option value="2,2,2,1,2,2,1">Lydian</option>
<option value="2,2,1,2,2,1,2">Mixolydian</option>
<option value="1,2,2,1,2,2,2">Locrian</option>
</select>
<select id="scaletuning" onchange="putScale();">
<option value="E,A,D,G,B,E" selected>Standard Tuning</option>
<option value="D,A,D,G,B,E">Drop D</option>
<option value="D,A,D,F#,A,D">Open D</option>
<option value="E,B,E,G#,B,E">Open E</option>
<option value="D,G,D,G,B,D">Open G</option>
<option value="C,G,C,G,C,E">Open C</option>
<option value="C,G,C,E,G,C">Open C v2</option>
<option value="D,D,D,D,D,D">Ostrich</option>
</select>
</div> <!-- Close scaleselectors div -->
<div class="heading">III. Putting it Together: Chord Progressions</div>
<p class="info">The table below displays the seven chords based on a given key/scale. In the drop down menu you can select the root note and the key (major or minor) for which you want to display the chords.</p>
<p>Chords based on <span id="keyspan">C Major</span>:</p>
<div id="progdiv"></div> <!-- Close progdiv div -->
<div id="progselectors">
<select id="progroot" onchange="putProg();">
<option value="C" selected>C</option>
<option value="C#">C♯</option>
<option value="Db">D♭</option>
<option value="D">D</option>
<option value="D#">D♯</option>
<option value="Eb">E♭</option>
<option value="E">E</option>
<option value="F">F</option>
<option value="F#">F♯</option>
<option value="Gb">G♭</option>
<option value="G#">G♯</option>
<option value="G">G</option>
<option value="Ab">A♭</option>
<option value="A">A</option>
<option value="A#">A♯</option>
<option value="Bb">B♭</option>
<option value="B">B</option>
<option value="B#">B♯</option>
</select>
<select id="progmode" onchange="putProg();">
<option value="2,2,1,2,2,2,1" selected>Major</option>
<option value="2,1,2,2,1,2,2">Minor</option>
</select>
</div> <!-- Close progselectors div -->
<p>Here's a <a href="http://musictheorysite.com/namethatkey/">nice program</a> from the MusicTheorySite for going in the other direction: determining the key on the basis of a chord progression.</p>
</div> <!-- Close container div -->
<div id='footer'>© 2018 Michael Rieppel</div>
</body>
</html>