-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdasynthV2.html
More file actions
226 lines (178 loc) · 7.75 KB
/
dasynthV2.html
File metadata and controls
226 lines (178 loc) · 7.75 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
<!-- /* // ****** LICENSE NOTICE ****** \\
COPYRIGHT: 2020 Stuart Peel
This PROGRAM is distributed under the terms of the:
AGPL-3.0-or-later
*/ -->
<!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/dasynthv2.css">
</head>
<body>
<div class="headWrap">
<header>
<h2 class="title">Digital Audio Synth</h2>
</header>
<!-- Navigation with dropdown info box -->
<nav >
<div class="linkWrap">
<a href="./index.html">Home</a>
<!-- Tell the user what each key does -->
<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>
</div>
</div>
</kbInfo>
</div>
</nav>
</div>
<main>
<div class="mainWrap">
<div class="controls">
<fieldset class="fieldset">
<legend>Controls</legend>
<!-- Audio / Media Recorder controls START -->
<fieldset class="fieldset">
<legend>Media Recorder</legend>
<p><i>ALT+Z</i> 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>
</div>
</fieldset>
<!-- Audio / Media Recorder controls END -->
<div class="spacer"></div>
<!-- ****** Musical keys (piano/synth) settings START -->
<fieldset class="fieldset">
<legend>Musical Key Settings</legend>
<div class="sliderCtrls">
<!-- Waveform slider controls -->
<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>
<!-- Decay slider Controls -->
<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>
<!-- Octave slider controls -->
<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>
</div>
</fieldset>
<!-- ****** Musical keys (piano/synth) settings END -->
<div class="spacer"></div>
<!-- Kettle Drum Slider Controls -->
<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>
<!-- HTML5 Input Form Elements For File Upload -->
<div class="spacer"></div>
<fieldset class="fieldset">
<legend>Upload</legend>
<h4>EXPERIMENTAL</h4>
<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>
</fieldset>
</div>
</div>
</main>
<footer>
<div class="footer">
<p>Digital Audio Synth, an open source project: fishbite 2022</p>
<p>
Source code available here:
<a href="https://github.com/Fishbite/webAudio" target="_blank"
>GitHub WebAudio Repo</a
>
</p>
</div>
</footer>
<script src="./src/script.js"></script>
<script type="module" src="./src/playMusic.js"></script>
<script src="./src/upload.js"></script>
<!-- <script src="./src/timed.js"></script> -->
</body>
</html>