p5.js-sound
p5.js-sound copied to clipboard
Odd behaviour using low bin count for fft.waveforms
I am messing about with FFT and drawing a line for the waveform data.
Using the sample code, I changed the number of bins to 16, the lowest setting. And it displays this odd behaviour, despite using map() to adjust the coords.
Why does it suddenly "step" like that?
CODE
beginShape();
for (let i = 0; i < waveform.length; i++){
let x = map(i, 0, waveform.length, 0, width);
let y = map(waveform[i], -1, 1, 0, height);
vertex(x, y);
}
endShape();
@paulcanning https://editor.p5js.org/ajaymati1000/sketches/FueE4hqMj works fine for me. Or am I missing something?