-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
32 lines (26 loc) · 926 Bytes
/
script.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
function Timer () {
this.time = 0.0;
this.updateTime = function(rate, val, dt) {
this.time = this.time+rate*dt*val;
}
}
var time_bass = 0;
var time_highs = 0;
var bassTimevar = new Timer();
var timevar = new Timer();
function update(dt) {
var rate_in = inputs.rate_in;
/*if (inputs.zoom >= 1 || inputs.zoom <= -1) {
rate_in += (inputs.zoom * 0.1);
}*/
time_bass += 0.05*(inputs.syn_BassLevel + inputs.syn_BassLevel*inputs.syn_BassLevel)*rate_in;
time_highs += 0.1*(inputs.syn_HighHits + inputs.syn_HighHits*inputs.syn_HighHits)*rate_in;
bassTimevar.updateTime(0.1, inputs.syn_Level*2.0+inputs.syn_Presence+inputs.syn_Hits*2.0*rate_in, dt);
timevar.updateTime(0.4, rate_in, dt);
uniforms.time_bass = time_bass;
uniforms.time_highs = time_highs;
uniforms.script_time = timevar.time;
uniforms.bass_time = bassTimevar.time;
}
function transition() {
}