-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
235 lines (231 loc) · 10.9 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
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Josefin+Slab" />
<link rel="stylesheet" href="style.css"></link>
<meta charset="utf-8">
<script src="https://use.fontawesome.com/6e602445b2.js"></script>
<scipt src="script.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/qwerty-hancock/0.5.1/qwerty-hancock.min.js"></script>
<title>Synth</title>
</head>
<body>
<div class="page-wrapper">
<div class="synth-wrapper">
<div class="oscillator-class-wrapper">
<div class="osc1-wrapper">
<div class="wrap-text-slider">
<div class="osc1-text" id="osc1-text">OSC 1</div>
<input type="range" id="osc1-gain" min="0" max=".8" step=".05" value="0.5"></input>
</div>
<div class="dropdowns-container">
<div class="wave-dropdown">
<label>Waveform</label>
<select id="osc1-waveform" class="dropdown">
<div class="wave-dropdown-content">
<option value="sine">sine</option>
<option value="square">square</option>
<option value="triangle">triangle</option>
<option value="sawtooth">sawtooth</option>
</div>
</select>
</div>
<div class="octave-dropdown">
<label>Octave</label>
<select id="osc1-octave" class="dropdown">
<option value="-2">-2</option>
<option value="-1">-1</option>
<option selected="selected "value="0">Middle C</option>
<option value="1">+1</option>
<option value="2">+2</option>
</select>
</div>
</div>
</div>
<!-- -->
<div class="osc2-wrapper">
<div class="wrap-text-slider">
<div class="osc2-text" id="osc2-text"> OSC 2</div>
<input type="range" id="osc2-gain" min="0" max=".8" step=".05" value="0"></input>
</div>
<div class="dropdown2-container">
<div class="wave-dropdown">
<label>Waveform</label>
<select id="osc2-waveform" class="dropdown">
<div class="wave-dropdown-content">
<option value="sine">sine</option>
<option value="square">square</option>
<option value="triangle">triangle</option>
<option value="sawtooth">sawtooth</option>
</div>
</select>
</div>
<div class="octave-dropdown">
<label>Octave</label>
<select id="osc2-octave" class="dropdown">
<option value="-2">-2</option>
<option value="-1">-1</option>
<option selected="selected "value="0">Middle C</option>
<option value="1">+1</option>
<option value="2">+2</option>
</select>
</div>
</div>
</div>
<!-- -->
<div class="lfo-container">
<div class="label-switch-container">
<label class="lfo-title" id="lfo-title"> LFO</label>
<label class="switch">
<input type="checkbox" id="toggle-lfo">
<div class="slider round"></div>
</label>
</div>
<div class="lfo-slider-container">
<div class="lfo-freq-wrapper">
<div class="lfo-freq-text">LFO Frequency</div>
<input type="range" id="lfo" min="0.5" max="12.0" step=".5" value="0.5"></input>
</div>
<div class="lfo-mix-container">
<div class="lfo-mix-text">LFO Mix</div>
<input type="range" id="lfo-volume" min="0.0" max="1.0" step=".05" value="0.2"></input>
</div>
</div>
</div>
<div class="description-container">
<div class="osc-description" id="osc-description">
<div class="help-title">Oscillator</div>
<div class="help-content">Generates a waveform which is processed and sent to your speakers. Control volume with the slider, tone with the waveform select, and the octave(how high or low the note is) with the octave select.</div>
</div>
<div class="lfo-description" id="lfo-description">
<div class="help-title">Low-frequency Oscillator</div>
<div class="help-content">Creates a rhythmic pulse connected to the frequency of an oscillator. The frequency range in this case is between 0Hz and 12Hz. The higher the frequency, the faster the pulse. Control the volume of this oscillator with the LFO Mix slider.</div>
</div>
<div class="distortion-description" id="distortion-description">
<div class="help-title">Distortion</div>
<div class="help-content">Modulates the shape of the wave to create a 'fuzzier' or 'crunchier' sound.</div>
</div>
<div class="record-description" id="record-description">
<div class="help-title">Record/Download</div>
<div class="help-content">Click Record to begin recording sound. Click Stop to stop this recording. Click Download once you have recorded something to download. Recordings are not saved, so clicking the record button a second time will delete the previous take.</div>
</div>
<div class="envelope-description" id="envelope-description">
<div class="help-title">Envelope</div>
<div class="help-content">Determines the shape of the note in terms of volume over time. Attack controls how long the note takes to reach full volume. Release controls how long the note takes to completely stop.</div>
</div>
<div class="lpf-description" id="lpf-description">
<div class="help-title">Low Pass Filter</div>
<div class="help-content">Filters out all frequencies above a certain threshold. Allows frequencies below to 'pass' through. Can be useful for cleaning up a 'tinny' sound.</div>
</div>
<div class="hpf-description" id="hpf-description">
<div class="help-title">High Pass Filter</div>
<div class="help-content">Filters out all frequencies below a certain threshold. Allows frequencies above to 'pass' through. Can be useful for cleaning up a muddy sound.</div>
</div>
<div class="delay-description" id="delay-description">
<div class="help-title">Delay</div>
<div class="help-content">Causes the note to be repeated after it is played. Gain determines the amount of times the note will be repeated as well as it's intensity. Rate determines the amount of time between the repeated notes. If you want to stop the current delay just turn the gain all the way down.</div>
</div>
</div>
</div>
<div class="mid-synth">
<div class="distortion-download-row-wrapper">
<div class="distortion-wrapper">
<div class="distortion-text" id="distortion-text"> Toggle Distortion</div>
<label class="distortion-switch switch">
<input type="checkbox" id="toggle-distortion">
<div class="slider round"></div>
</label>
</div>
<div class="recorder">
<div class="buttons">
<button class="record-button" id="record">Record</button>
<button class="download-button" id="download">Download</button>
<i class="fa fa-question-circle-o" aria-hidden="true" id="record-help"></i>
</div>
<div class="player">
<audio controls class="sound-player"></audio>
</div>
</div>
</div>
<div class="envelope-wrapper">
<div class="envelope-title" id="envelope-title"> Envelope</div>
<div class="attack-wrapper">
<div class="attack-text">Attack</div>
<input type="range" id="attack" min="0" max="2.5"step="0.01" value="0"></input>
</div>
<div class="release-wrapper">
<div class="release-text">Release</div>
<input type="range" id="decay" min=".01" max="16" step=".01" value=".3"></input>
</div>
</div>
<canvas class="canvas" id="my-canvas">
</canvas>
<div class="keyboard-wrapper">
<div id="keyboard" class="keyboard"></div>
</div>
</div>
<div class="right-synth">
<div class="low-pass-wrapper">
<div class="low-pass-text"id="lpf-text"> Low Pass Filter</div>
<div class="low-pass-slider-wrapper">
<input id='lpf-freq' type='range' step='.5' min='0' max='100' value="100"></input>
</div>
</div>
<div class="highpass-wrapper">
<div class="highpass-text" id="hpf-text"> High Pass Filter</div>
<div class="highpass-slider-wrapper">
<input id='hpf-freq' step='.5' type='range' min='0' max='100' value='0'></input>
</div>
</div>
<div class="delay-wrapper">
<div class="delay-text">
<div id="delay-label" class="delay-label">Delay</div>
<label class="delay-switch switch">
<input type="checkbox" id="toggle-delay">
<div class="slider round"></div>
</label>
</div>
<div class="delay-vol-slider-wrapper">
<div class="delay-vol-text">Gain</div>
<input type="range" id="delay-mix" max="0.74" min="0" value=".4" step=".01">
</div>
<div class="delay-time-slider-wrapper">
<div class="delay-time-text">Rate</div>
<input type="range" id="delay-time" max="1.0" min=".2" step=".01" value=".5">
</div>
<!-- <div class="delay-time-slider-wrapper"> -->
<!-- <div class="delay-time-text">Rate</div>
<input type="range" id="delay-time" max="2.0" min = ".1" step=".1"> -->
<!-- </div> -->
</div>
<div class="master-vol-wrapper">
<div class="master-vol-text"> Master Volume</div>
<div class="master-vol-slider-wrapper">
<input type="range" id="volume" max="1.1" min="0" step=".01" value="0.5"></input>
</div>
</div>
<div class="links-container">
<div class="created">Created By Paul Parker</div>
<div class="year">2017</div>
<div class='email'>[email protected]</div>
<div class="github"><a href="https://github.com/paulstuartparker/" class="github">GitHub</a></div>
<button class="modal-button" id="modal-open">Help</button>
<div class="modal" id="modal">
<div class="modal-content">
<span class="close-modal" id ="close">×</span>
<p>Welcome to waveShaper, a digital synthesizer built with Javascript!</p>
<div>To get started playing, use your computer keyboard. The home key row corresponds to the white keys on a piano, and the row above corresponds to the black keys.</div>
<div>For a more in depth description of what everything does, hover your mouse over the title of each component.</div>
</div>
</div>
</div>
</div>
</div>
<div class="page-bottom">
</div>
<script src="hover.js"></script>
<script src="synth.js"></script>
<script src="modal.js"></script>
</body>
</html>