-
Notifications
You must be signed in to change notification settings - Fork 0
/
fmbasic_old-shit.js
36 lines (26 loc) · 1.24 KB
/
fmbasic_old-shit.js
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
/* --------------- SLIDER VALUES --------------- */
document.getElementById("slider_modFreq").addEventListener('input', function () {
// 'input' create a continous input detection
// alternative could be 'change'
this.osc_modulator.frequency.value = this.value * 8;
});
document.getElementById("slider_modGain").addEventListener('input', function () {
this.osc_modulatorGain.gain.value = this.value*1000;
});
document.getElementById("osc_carrier_freq").addEventListener('input', function () {
this.osc_carrier.frequency.value = (this.value*1000)+200;
});
document.getElementById("mstrGain").addEventListener('input', function () {
this.mstrGain.gain.value = this.value;
});
document.getElementById("panStereo").addEventListener('input', function () {
this.panStereo.pan.value = (this.value-0.5)*2; // pan range [-1., 1.]
});
document.getElementById("slider_ampAttack").addEventListener('input', function () {
this.amp.attack = this.value;
this.amp.attack = parseFloat(this.amp.attack);
});
document.getElementById("slider_ampDecay").addEventListener('input', function () {
this.amp.decay = this.value;
this.amp.decay = parseFloat(this.amp.decay);
});