diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-04-09 13:34:56 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-04-09 13:34:56 +0200 |
| commit | 4fc9de33355efef3d3a673e870f61fffb1ea4f1d (patch) | |
| tree | 52d8df67af70a5e860bbfb21b494ac0fc96b2383 /client/index.js | |
| parent | f39c218e5bac088009f629bdd97842f29a98aee5 (diff) | |
Diffstat (limited to 'client/index.js')
| -rw-r--r-- | client/index.js | 18 |
1 files changed, 9 insertions, 9 deletions
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( () => { |
