-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathGrooveDBCreateGroove.html
318 lines (290 loc) · 15.2 KB
/
GrooveDBCreateGroove.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
<html>
<head>
<title>Groove Scribe</title>
<meta name="viewport" content="width=1024, initial-scale=1.0">
<!-- Other peoples JS libraries -->
<!-- new version of MIDI.JS Disabled
<!-- shim required by midi.js
<script src="./MIDI.js/inc/shim/Base64.js" type="text/javascript"></script>
<script src="./MIDI.js/inc/shim/Base64binary.js" type="text/javascript"></script>
<script src="./MIDI.js/inc/shim/WebAudioAPI.js" type="text/javascript"></script>
<script src="./MIDI.js/inc/shim/WebMIDIAPI.js" type="text/javascript"></script>
<!-- jasmid package midi package required by midi.js
<script src="./MIDI.js/inc/jasmid/stream.js"></script>
<script src="./MIDI.js/inc/jasmid/midifile.js"></script>
<script src="./MIDI.js/inc/jasmid/replayer.js"></script>
<!-- midi.js package for playing a midi file
<script src="./MIDI.js/js/MIDI/audioDetect.js" type="text/javascript"></script>
<script src="./MIDI.js/js/MIDI/gm.js" type="text/javascript"></script>
<script src="./MIDI.js/js/MIDI/loader.js" type="text/javascript"></script>
<script src="./MIDI.js/js/MIDI/plugin.audiotag.js" type="text/javascript"></script>
<script src="./MIDI.js/js/MIDI/plugin.webaudio.js" type="text/javascript"></script>
<script src="./MIDI.js/js/MIDI/plugin.webmidi.js" type="text/javascript"></script>
<script src="./MIDI.js/js/MIDI/player.js" type="text/javascript"></script>
<!-- utils for midi.js
<script src="./MIDI.js/js/util/dom_request_xhr.js" type="text/javascript"></script>
<script src="./MIDI.js/js/util/dom_request_script.js" type="text/javascript"></script>
-->
<!-- old version of MIDI.JS -->
<script src="./MIDI.js/js/MIDI/AudioDetect.js" type="text/javascript"></script>
<script src="./MIDI.js/js/MIDI/LoadPlugin.js" type="text/javascript"></script>
<script src="./MIDI.js/js/MIDI/Plugin.js" type="text/javascript"></script>
<script src="./MIDI.js/js/MIDI/Player.js" type="text/javascript"></script>
<script src="./MIDI.js/inc/DOMLoader.XMLHttp.js" type="text/javascript"></script>
<script src="./MIDI.js/inc/jasmid/stream.js"></script>
<script src="./MIDI.js/inc/jasmid/midifile.js"></script>
<script src="./MIDI.js/inc/jasmid/replayer.js"></script>
<script src="./MIDI.js/inc/Base64.js"></script>
<script src="./MIDI.js/inc/base64binary.js"></script>
<!-- jsmidgen for generating a midi file -->
<script src="./js/jsmidgen.js" type="text/javascript"></script>
<!-- script to render ABC to an SVG image -->
<script type="text/javascript" src="./js/abc2svg-1.js"></script>
<!-- script for sharing to social sites -->
<script src="js/share-button.min.js"></script>
<!-- our custom JS -->
<script src="js/groove_writer.js"></script>
<script src="js/groove_utils.js"></script>
<script src="js/baseGrooves.js"></script>
<script>
// instantiate a global instance of the GrooveWriterClass. This page only uses one
myGrooveWriter = new GrooveWriter();
</script>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,300' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/share-button.min.css">
<link rel="stylesheet" type="text/css" href="css/groove_writer.css">
<link rel="stylesheet" type="text/css" href="css/groove_display.css">
</head>
<body>
<div id="GrooveWriter">
<!-- use css to position this to the upper right -->
<span class="nonPrintable">
<div id="LeftHandNav">
<span id="divisionButtonContainer">
<span id="timeLabel">TIME</span>
<span class="subdivision" id="4ths" onClick="myGrooveWriter.changeDivision(4)"><span class="buttonFraction"><sup>1</sup>/<sub>4</sub></span></span>
<span class="subdivision" id="8ths" onClick="myGrooveWriter.changeDivision(8)"><span class="buttonFraction"><sup>1</sup>/<sub>8</sub></span></span>
<span class="subdivision" id="16ths" onClick="myGrooveWriter.changeDivision(16)"><span class="buttonFraction"><sup>1</sup>/<sub>16</sub></span></span>
<span class="subdivision" id="32ths" onClick="myGrooveWriter.changeDivision(32)"><span class="buttonFraction"><sup>1</sup>/<sub>32</sub></span></span>
<span class="subdivision" id="12ths" onClick="myGrooveWriter.changeDivision(12)"><div><span class="buttonFraction"><sup>1</sup>/<sub>8</sub></span>TRIPLETS</div></span>
<span class="subdivision" id="24ths" onClick="myGrooveWriter.changeDivision(24)"><div><span class="buttonFraction"><sup>1</sup>/<sub>16</sub></span>TRIPLETS</div></span>
</span>
<script>
if(myGrooveWriter.is_touch_device()) {
document.write('<div id="advancedEditAnchor" onClick="event.preventDefault(); myGrooveWriter.toggleAdvancedEdit()">Advanced Edit</div>');
}
</script>
</div>
<div id="TopNav">
<span id="upperLeft">
<span id="metronomeContainer">
<span id="metronomeLabel">METRONOME:</span>
<span class="metronomeButton" id="metronomeOff" onClick="myGrooveWriter.metronomeButtonClick(event, '0')">OFF</span>
<span class="metronomeButton" id="metronome4ths" onClick="myGrooveWriter.metronomeButtonClick(event, '4')">4th</span>
<span class="metronomeButton" id="metronome8ths" onClick="myGrooveWriter.metronomeButtonClick(event, '8')">8th</span>
<span class="metronomeButton" id="metronome16ths" onClick="myGrooveWriter.metronomeButtonClick(event, '16')">16th</span>
</span>
</span>
<span id="upperRight">
<span class="rightButtons" id="groovesAnchor" onClick="myGrooveWriter.groovesAnchorClick(event)"><i class="fa fa-bars"></i> Base Grooves</span>
<span class="rightButtons" id="helpAnchor" onClick="myGrooveWriter.helpAnchorClick(event)"><i class="fa fa-bars"></i> Help</span>
</span>
</div>
</span>
<div id="RightHandContent">
<span class="nonPrintable">
<div id="midiPlayer"><!-- space for the midiplayer to be attached by the javascript --></div>
<div id="musicalInput">
<span id="measureContainer">
<script>
var genHTML = "";
for(var cur_measure=1; cur_measure <= myGrooveWriter.numberOfMeasures(); cur_measure++) {
genHTML += myGrooveWriter.HTMLforStaffContainer(cur_measure, (cur_measure-1) * myGrooveWriter.notesPerMeasure());
}
document.write(genHTML);
</script>
</span>
</div>
<div id="PermutationOptions">
<script>
var genHTML = "";
genHTML += myGrooveWriter.HTMLforPermutationOptions();
document.write(genHTML);
</script>
</div>
<div id="NotationLine">
<span id='NotationLabel'>Notation</span>
<span id='KeyButton'><input type="checkbox" class="hiddenCheckbox" id="showLegend" onClick="myGrooveWriter.refresh_ABC()"><label id="LegendLabel" for="showLegend"><i class="fa fa-key"></i></label></span>
</div>
</span>
<span class="Printable">
<!-- rendering area -->
<div id="svgTarget" class="svgTarget">
<!-- space for the SVG music go display -->
</div>
</span>
<span class="nonPrintable">
<!-- errors -->
<p class="warnings">Warnings:</p>
<div class="warnings" id="diverr"></div>
<div id="sheetMusicTextFields" style="display:none;">
<b>Title:</b> <input class="sheetMusicInputField" id="tuneTitle" onChange="myGrooveWriter.refresh_ABC()" type="text">
<b>Author:</b> <input class="sheetMusicInputField" id="tuneAuthor" onChange="myGrooveWriter.refresh_ABC()" type="text">
<b>Comment:</b> <input class="sheetMusicInputField" id="tuneComments" onChange="myGrooveWriter.refresh_ABC()" type="text">
</div>
<div id="midiTextOutput">
</div>
<span id="hiddenDescription">
Groove Writer allows drummers to create and share interesting grooves with
WYSIWYG authoring, sheet music creation, and audio playback all in one place.
Use the Groove Writer to write out new grooves, figure out the groove to your favorite songs,
or write down the groove to your latest tune.
</span>
<br>
<!-- GrooveDB output area -->
<div id="GrooveDB_MetaData">
This is the text that should be added to the grooveDB for this groove. Copy and paste it into the edit window for a groove <br>
<p>
<textarea id="GrooveDB_source" rows="12" cols="92" ></textarea>
</div>
<span id="undoStack"></span>
<span id="redoStack"></span>
<!-- ABC notation -->
<!--
<A href="" onClick="event.preventDefault(); myGrooveWriter.ShowHideABCResults();">Show/Hide ABC Notation</a>
-->
<div id="ABC_Results">
ABC Notation is used for rendering the music. You can see what is being generated below.
You can even edit it. <br>
NOTE: whenever the page is modified, the ABC Notation below will be overwritten automatically. <br>
For more information about ABC Notation go here: <a href="http://abcnotation.com/">http://abcnotation.com/</a>
<p>
<textarea id="ABCsource" rows="10" cols="72" ></textarea>
<br>
<button type="button" onclick="myGrooveWriter.displayNewSVG()">Re-render the music</button>
<button type="button" onclick="myGrooveWriter.saveABCtoFile()">Save ABC to file</button>
</div>
<div id="totalPlayTime">
</div>
</span>
</div>
<!-- context menu that will pop up over notes in advaced edit more -->
<div class="noteContextMenu">
<ul id="stickingContextMenu" class="list">
<li onClick='myGrooveWriter.notePopupClick("sticking", "off")'>Off</li>
<li onClick='myGrooveWriter.notePopupClick("sticking","right")'><b>R</b>ight</li>
<li onClick='myGrooveWriter.notePopupClick("sticking","left")'><b>L</b>eft</li>
</ul>
</div>
<div class="noteContextMenu">
<ul id="hhContextMenu" class="list">
<li onClick='myGrooveWriter.notePopupClick("hh", "off")'>Off</li>
<li onClick='myGrooveWriter.notePopupClick("hh","normal")'>Hi-hat normal</li>
<li onClick='myGrooveWriter.notePopupClick("hh","open")'>Hi-hat open</li>
<li onClick='myGrooveWriter.notePopupClick("hh","close")'>Hi-hat closed</li>
<li onClick='myGrooveWriter.notePopupClick("hh","accent")'>Hi-hat accent</li>
<li onClick='myGrooveWriter.notePopupClick("hh","crash")'>Crash</li>
<li onClick='myGrooveWriter.notePopupClick("hh","ride")'>Ride</li>
</ul>
</div>
<div class="noteContextMenu">
<ul id="snareContextMenu" class="list">
<li onClick='myGrooveWriter.notePopupClick("snare", "off")'>Off</li>
<li onClick='myGrooveWriter.notePopupClick("snare", "normal")'>Snare Normal</li>
<li onClick='myGrooveWriter.notePopupClick("snare", "accent")'>Snare Accent</li>
<li onClick='myGrooveWriter.notePopupClick("snare", "ghost")'>Ghost Note</li>
<li onClick='myGrooveWriter.notePopupClick("snare", "xstick")'>Cross Stick</li>
<li onClick='myGrooveWriter.notePopupClick("snare", "flam")'>Flam</li>
<li onClick='myGrooveWriter.notePopupClick("snare", "drag")'>Drag</li>
</ul>
</div>
<div class="noteContextMenu">
<ul id="kickContextMenu" class="list">
<li onClick='myGrooveWriter.notePopupClick("kick", "off")'>Off</li>
<li onClick='myGrooveWriter.notePopupClick("kick", "normal")'>Kick Normal</li>
<li onClick='myGrooveWriter.notePopupClick("kick", "splash")'>Hi-hat foot</li>
<li onClick='myGrooveWriter.notePopupClick("kick", "kick_and_splash")'>Kick & Hi-hat foot</li>
</ul>
</div>
<div class="noteContextMenu">
<ul id="stickingsLabelContextMenu" class="list">
<li onClick='myGrooveWriter.noteLabelPopupClick("stickings", "all_off")'>all <b>Off</b></li>
<li onClick='myGrooveWriter.noteLabelPopupClick("stickings", "alternate")'>alternate</li>
<li onClick='myGrooveWriter.noteLabelPopupClick("stickings", "all_right")'>all <b>R</b>s</li>
<li onClick='myGrooveWriter.noteLabelPopupClick("stickings", "all_left")'>all <b>L</b>s</li>
<li onClick='myGrooveWriter.noteLabelPopupClick("stickings", "cancel")'>cancel</li>
</ul>
</div>
<div class="noteContextMenu">
<ul id="hhLabelContextMenu" class="list">
<li onClick='myGrooveWriter.noteLabelPopupClick("hh", "all_off")'>all Hi-hats <b>Off</b></li>
<li onClick='myGrooveWriter.noteLabelPopupClick("hh", "all_on")'>all Hi-hats <b>On</b></li>
<li onClick='myGrooveWriter.noteLabelPopupClick("hh", "downbeats")'>downbeats</li>
<li onClick='myGrooveWriter.noteLabelPopupClick("hh", "upbeats")'>upbeats</li>
<li onClick='myGrooveWriter.noteLabelPopupClick("hh", "cancel")'>cancel</li>
</ul>
</div>
<div class="noteContextMenu">
<ul id="snareLabelContextMenu" class="list">
<li onClick='myGrooveWriter.noteLabelPopupClick("snare", "all_off")'>all Snares <b>Off</b></li>
<li onClick='myGrooveWriter.noteLabelPopupClick("snare", "all_on")'>all <b>Accented</b></li>
<li onClick='myGrooveWriter.noteLabelPopupClick("snare", "all_on_normal")'>all <b>Normal</b></li>
<li onClick='myGrooveWriter.noteLabelPopupClick("snare", "cancel")'>cancel</li>
</ul>
</div>
<div class="noteContextMenu">
<ul id="kickLabelContextMenu" class="list">
<li onClick='myGrooveWriter.noteLabelPopupClick("kick", "all_off")'>all Kicks <b>Off</b></li>
<li onClick='myGrooveWriter.noteLabelPopupClick("kick", "all_on")'>all Kicks <b>On</b></li>
<li onClick='myGrooveWriter.noteLabelPopupClick("kick", "cancel")'>cancel</li>
</ul>
</div>
<div class="noteContextMenu">
<ul id="permutationContextMenu" class="list">
<li onClick='myGrooveWriter.permutationPopupClick("none")'><b>None</b></li>
<li onClick='myGrooveWriter.permutationPopupClick("kick_16ths")'><b>Kick</b> Permutation</li>
<li onClick='myGrooveWriter.permutationPopupClick("snare_16ths")'><b>Snare</b> Permutation</li>
<!-- >
<li onClick='myGrooveWriter.permutationPopupClick("snare_accent_16ths")'>Accented <b>Snare</b> Permutation</li>
<li onClick='myGrooveWriter.permutationPopupClick("snare_accented_and_diddled_16ths")'>Accented <b>Snare</b> Permutation w/ Diddles</li>
< -->
</ul>
</div>
<div class="noteContextMenu">
<ul id="helpContextMenu" class="list">
<li onClick='myGrooveWriter.helpMenuPopupClick("undo")'>Undo (Ctrl-Z)</li>
<li onClick='myGrooveWriter.helpMenuPopupClick("redo")'>Redo (Ctrl-Y)</li>
<li onClick='myGrooveWriter.helpMenuPopupClick("help")'>Help</li>
<li onClick='myGrooveWriter.helpMenuPopupClick("about")'>About</li>
</ul>
</div>
<div id="grooveListWrapper">
<script>
document.write(grooves.getGroovesAsHTML());
</script>
</div>
<!-- this is used by the share/save button, and is hidden by default -->
<div id="fullURLPopupContainer">
<div id="fullURLPopup">
<button id="fullURLCloseButton" onClick="myGrooveWriter.close_FullURLPopup()">×</button>
Use this URL to return with all the notes the way you set them.<br>
<br>
<input type="text" id="fullURLTextField"><br>
<label>Generate Short URL:<input type="checkbox" id="shortenerCheckbox" onchange="myGrooveWriter.shortenerCheckboxChanged()"></label>
<a href="#" id="fullURLLink">follow link</a>
<br>
<br>
<share-button id="shareButton"></share-button>
</div>
</div>
<script>
// set up the page after it has fully loaded
window.onload = function () {
myGrooveWriter.runsOnPageLoad(); // Initialize the notes
};
</script>
</div>
</body>
</html>