tiny javascript library for midi input in the any browser/os with webmidi
fft.js is a javascript library that makes it easy to analyze real-time audio input.
init(int samples)init(samples) requests microphone input and sets up a buffer with the given number of samples. samples must be between 32 and 2048.
fft()fft() returns an array of integers between 0 and 255. Each item in the array is a frequency band. The integer is its amplitude.
setup()setup() returns true if microphone input has been granted.
var fftjs = new FFTJS();
fftjs.init(32);
$('button#fft-button').on('click', function() {
$('#fft-display').text(JSON.stringify(fftjs.fft()));
});