From 4fc9de33355efef3d3a673e870f61fffb1ea4f1d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 9 Apr 2018 13:34:56 +0200 Subject: build --- client/index.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'client/index.js') diff --git a/client/index.js b/client/index.js index f2f72c0..a1b12b1 100644 --- a/client/index.js +++ b/client/index.js @@ -23,7 +23,7 @@ let samplers = {} requestAudioContext( () => { samplers['smash'] = new Sampler('samples/smash/g{}.mp3', 12) - // samplers['glass'] = new Sampler('samples/glass/0{}Particle.mp3', 90) + samplers['glass'] = new Sampler('samples/glass/0{}Particle.mp3', 90) }) let last_index = 0 @@ -45,10 +45,10 @@ keys.listen(index => { 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 + when - // ) + samplers['glass'].play( + 100 + index*(Math.random() * 10), + now + when + ) setTimeout( () => { draw.triangle(randint(window.innerWidth), randint(window.innerHeight), randrange(10, 100)) }, when * 1000) @@ -74,10 +74,10 @@ mouse.register({ let when, i, player for (i = 0; i < count; i++) { when = Math.random()/2000 + (i+ Math.random()/10)/randrange(2,5) - // player = samplers['glass'].play( - // 100 * randrange(2,5) / randrange(2,5) * randrange(0.5,1.5), - // now + when - // ) + player = samplers['glass'].play( + 100 * randrange(2,5) / randrange(2,5) * randrange(0.5,1.5), + now + when + ) player.volume.value = isMobile ? -(1+i/2) : -i*i } setTimeout( () => { -- cgit v1.2.3-70-g09d2