-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdasynthV3.html
More file actions
497 lines (257 loc) · 12.5 KB
/
dasynthV3.html
File metadata and controls
497 lines (257 loc) · 12.5 KB
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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
<!-- /* // ****** LICENSE NOTICE ****** \\
COPYRIGHT: 2020 Stuart Peel
This PROGRAM is distributed under the terms of the:
AGPL-3.0-or-later
What does this mean? Well, basically it free!
Do what you want with it:
Use it
Modify it
Give it away as a freebee!
Sell it
Distribute it
If you modify it, please make it available to everyone,
it's part of the license T's & C's
// ****** LICENSE NOTICE ****** \\
*/ -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Music Machine</title>
<link rel="stylesheet" href="./styles/dasynthv3.css">
</head>
<body>
<!-- ************ Header START ************* -->
<div class="headWrap">
<header>
<h2 class="title">Digital Audio Synth</h2>
</header>
<!-- ************ Header END ************* -->
<!-- ************ Navigation Start ************ -->
<nav >
<div class="linkWrap">
<a href="./index.html">Home</a>
<!-- ************ Keyboard Manual START ************ -->
<kbInfo>
<div class="dropdown">
<a class="dropbtn" href="#" rel="noopener noreferrer">Keyboard Info</a>
<div class="dropContent">
<h2>Musical Keys:</h2>
</br>
<p><i>Keys q to p:</i> play C4 through E5</p>
<p><i>Keys 2, 3, 5, 6, 7, 9, 0:</i> play sharps/flats</p>
<h2>Pre-recorded Music:</h2>
</br>
<p><i>Key A:</i> play music normal</p>
<p><i>Key S:</i> play music panning.</p>
<p><i>Key D:</i> Stop Music</p>
<h2>Drum Sounds:</h2>
</br>
<p><i>Key Z:</i> Kick drum (synthesized)</p>
<p><i>Keys X, C, & V:</i> Kettle drums (synthesized)</p>
<p><i>Key M:</i> Snare drum (synthesized)</p>
<p><i>Key K:</i> Hihat (sampled)</p>
<p><i>Key L:</i> Triangle (synthesized)</p>
</div>
</div>
</kbInfo>
<!-- ************ Keyboard Manual END ************ -->
<!-- ************ User manual START ************ -->
<a href="./howto.html" target="_blank">How To ???</a>
</div>
<!-- ************ User manual END ************ -->
</nav>
</div>
<!-- ************ Navigation END ************* -->
<!-- ************ Controls START ************* -->
<main>
<div class="mainWrap">
<div class="controls">
<fieldset class="fieldset">
<legend>Controls</legend>
<!-- ************* Synth settings START ************* -->
<!-- ************* Voice Picker START ************* -->
<fieldset class="fieldset">
<legend>Musical Key Settings</legend>
<label for="voice">Select An Instrument</label>
<select name="voice" id="voice">
<option value="" selected>Select Voice</option>
<option value="one" >One Soft Oscillator</option>
<option value="two">Two Soft Oscillators</option>
<option value="three">Plinky Plonky Reverb</option>
<option value="four">Distortion & Reverb in a Church</option>
<option value="five">Nice Bass in Octave 2</option>
<option value="six">The Voice of chatGPT</option>
<option value="seven">Piano - set type="saw" octave=1-3</option>
<option value="eight">Experimental</option>
</select>
<!-- ************* Voice Picker END ************* -->
<!-- ************* Waveform slider controls START ************* -->
<div class="sliderCtrls">
<div class="ctrlWrap">
<p>
Wave Form:
</p>
<label class="label" id="waveTypeLabel" for="waveTypeValue"
>sin</label
>
<input
class="slider"
id="waveTypeValue"
name="waveTypeValue"
type="range"
min="0"
max="3"
value="0"
step="1"
/>
</div>
<!-- ************* Waveform slider controls END ************* -->
<!-- ************* Decay slider Controls START ************* -->
<div class="ctrlWrap">
<p>
Decay:
</p>
<label class="label" id="decayTimeLabel" for="decayTimeValue"
>2</label
>
<input
class="slider"
id="decayTimeValue"
name="decayTimeValue"
type="range"
min="0"
max="10"
value="2"
step="0.5"
/>
</div>
<!-- ************* Decay slider Controls END ************* -->
<!-- ************* Octave slider controls START ************* -->
<div class="ctrlWrap">
<p>
Octave:
</p>
<label class="label" id="octaveValueLabel"for="octaveValue">4</label>
<input class="slider" id="octaveValue" type="range" min="0" max="7" value="4" step="1"/>
</div>
<!-- ************* Octave slider controls END ************* -->
</div>
</fieldset>
<!-- ************* Synth settings END ************* -->
<div class="spacer"></div>
<!-- ************* Kettle Drum Slider Controls START ************* -->
<fieldset class="fieldset">
<legend class="echoLegend">Kettle Drum Echo</legend>
<div class="kettleWrap">
<p>
Echo:
</p>
<label class="label" id="echoValueLabel"for="echoValue">0</label>
<input class="slider" id="echoValue" type="range" min="0" max="1" value="0" step="0.05"/>
</div>
</fieldset>
<div class="spacer"></div>
<!-- ************* Kettle Drum Slider Controls END *************-->
<!-- ************* Audio / Media Recorder controls START ************* -->
<fieldset class="fieldset">
<legend>Media Recorder</legend>
<p><b><i>ALT+Z</i></b> Keys to Start Recording</p>
<p id="recordBtnDescription" role="description">
Stop button active when recording
</p>
<div class="audioWrap">
<div class="audioctrls">
<button
type="button"
aria-disabled="true"
aria-describedby="recordBtnDescription"
class="btn"
id="stopBtn"
>
_READY_TO_RECORD_
</button>
<audio id="audioTag" controls="true"></audio>
</div>
<p>Right click media player, select <b>"Save Audio As"</b> when finished recording</p>
</div>
</fieldset>
<!-- ************* Audio / Media Recorder controls END ************* -->
<div class="spacer"></div>
<!-- ************* Select A Music Track START ************* -->
<fieldset class="fieldset">
<legend class=""><b>NEW!!!</b> Select Music Track:</legend>
<div class="">
<p>Right click the Media Recorder, save the audio file, then browse for the music you have downloaded.</p>
<p>Or, select any music file from your hard drive!</p>
<div><input class="file" id="file" type="file" accept="audio/*" /></div>
<p>If you haven't recorded anything yet, here's a <a href="./audio/rhythmic-bass-base_39bpm_D_major.wav" rel="noopener noreferrer">a sample file</a> to get you going :-P</p>
<p>Press keys <b>A</b> to play,and <b>D</b> to stop </p>
</div>
<!-- ************* Music Playback Volume Slider Controls START ************* -->
<div class="ctrlWrap">
<p>
Volume:
</p>
<label class="label pb" id="playbackLabel" for="playbackVolValue"
>1</label
>
<input
class="slider"
id="playbackVolValue"
name="playbackVolValue"
type="range"
min="0"
max="5"
value="1"
step="0.1"
/>
</div>
<!-- ************* Music Playback Volume Slider Controls END ************* -->
</fieldset>
<!-- ************* Select A Music Track END ************* -->
<div class="spacer"></div>
<!-- ************* HTML5 Input Form Elements For File Upload START ************* -->
<fieldset class="fieldset">
<legend >Upload</legend>
<h4 class="upload">EXPERIMENTAL</h4>
<p>Note: This utility uploads your recording to the server, however, you need a login account to do so.</p>
<input id="fileupload" class=".btn" type="file" name="fileupload" /><span>File Size: <span id="fileSize">0</span>KB</span>
<span>Type: </span><span id="fileType"></span>
<span id="hexTag"></span>
<button id="uploadBtn" class="btn" onclick="uploadFile()">Upload</button>
<br>
<p>file size limit 4MB</p>
<p>filename MUST be <b>music.wav</b></p>
<p>filetype MUST be WAV and not another filetype with the .wav extension</p>
</fieldset>
<!-- ************* HTML5 Input Form Elements For File Upload END ************* -->
</fieldset>
</div>
</div>
</main>
<!-- ************ Controls END ************* -->
<!-- ************ Footer START ************* -->
<footer>
<div class="footer">
<p>an open source project maintained by: fishbite 2022</p>
<p>
source code available here:
<a href="https://github.com/Fishbite/webAudio" target="_blank"
>GitHub WebAudio Repo</a
>
</p>
</div>
</footer>
<!-- ************ Footer END ************* -->
<!-- ************ Scripts START ************* -->
<!-- recordingChain.js must be loaded first -->
<script src="./src/recordingChain.js"></script>
<script type="module" src="./src/script.js"></script>
<script type="module" src="./src/playMusicV2.js"></script>
<script src="./src/upload.js"></script>
<!-- ************ Scripts END ************* -->
</body>
</html>