diff options
Diffstat (limited to 'client/index.js')
| -rw-r--r-- | client/index.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/client/index.js b/client/index.js index 024c2d4..fbe0491 100644 --- a/client/index.js +++ b/client/index.js @@ -34,16 +34,23 @@ keys.listen(index => { if (last_index !== index) { samplers['smash'].play(randrange(90, 150) + index, 0) last_index = index + draw.clear() + draw.triangle(window.innerWidth/2, window.innerHeight/2, 500) } else if (Math.random() < 0.09) { last_index = -1 } - for (var i = 0; i < count; i++) { + let when, i + for (i = 0; i < count; i++) { // kalimba.play(freq * (i+1)/4, now + Math.random()/(i+1)) + when = Math.random()/2000 + (i + Math.random()/10)/randrange(2,5) samplers['glass'].play( 100 + index*(Math.random() * 10), - now + (Math.random()/2000 + i/10) + now + when ) + setTimeout( () => { + draw.triangle(randint(window.innerWidth), randint(window.innerHeight), randrange(10, 100)) + }, when * 1000) } }) |
