summaryrefslogtreecommitdiff
path: root/client/index.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-03-06 16:00:38 +0100
committerJules Laplace <julescarbon@gmail.com>2018-03-06 16:00:38 +0100
commit735b1f59762023fa652fb6fe36bf8312a350300c (patch)
tree1519043240d87e116d1ac39588bc8651a9f28ef9 /client/index.js
parent25fec83f6f7db468721a38adb2c84a0c0a2121f1 (diff)
reversing fft correctly
Diffstat (limited to 'client/index.js')
-rw-r--r--client/index.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/client/index.js b/client/index.js
index b1351fc..7a01b55 100644
--- a/client/index.js
+++ b/client/index.js
@@ -6,6 +6,7 @@ import draw from './draw'
import keys from './lib/keys'
import color from './lib/color'
import mouse from './lib/mouse'
+import output from './lib/output'
import { Hall } from './lib/hall'
@@ -60,13 +61,13 @@ function redraw(){
keys.listen(index => {
// trigger(Math.random(), ((index+7) % SPEAKER_COUNT) / SPEAKER_COUNT, 0, samplers.smash)
- const sample = samplers.smash.choice()
- const buf = sample.players[0]._buffer.get()
+ const sample = samplers.smash.play(100, Tone.now(), output)
+ console.log(Tone.now())
+ const buf = sample._buffer.get()
if (! buf) return
const pcm = buf.getChannelData(0)
const sr = buf.sampleRate
const duration = buf.duration
- console.log(buf)
console.log(duration.toFixed(2) + " s.")
draw.clear()
draw.waveform(pcm)