MTG / essentia.js

JavaScript library for music/audio analysis and processing powered by Essentia WebAssembly
https://essentia.upf.edu/essentiajs
GNU Affero General Public License v3.0
632 stars 41 forks source link

Trying to use essentia.SuperFluxExtractor with Max/MSP Api #37

Open thomasdsp opened 3 years ago

thomasdsp commented 3 years ago

Hello,

I'm trying to use essentia.SuperFluxExtractor with the Max/MSP Api :

const max = require('max-api');
const essentia = require('essentia.js');
const load = require('audio-loader');

max.addHandler("path", (pathname) => {  
load(pathname).then(function(buffer){
let channel = buffer.getChannelData(0);
let inputSignalVector = essentia.arrayToVector(channel);
let onset = essentia.SuperFluxExtractor(inputSignalVector, 20., 4096., 1024., 16., 44100., 0.02);
let ticks = essentia.vectorToArray(onset.onsets);

The script print this error to the console but I still have some values of onsets back. Can you help me ?

stderr [ INFO ] On connection TriangularBands::bands → SuperFluxNovelty::bands: stderr [ INFO ] BUFFER SIZE MISMATCH: max=0 - asked for read size 3 stderr [ INFO ] resizing buffer to 24/3 stderr [ INFO ] On connection SuperFluxNovelty::differences → SuperFluxPeaks::novelty: stderr [ INFO ] BUFFER SIZE MISMATCH: max=0 - asked for read size 4096 stderr [ INFO ] resizing buffer to 36040/4505 stderr [ INFO ] TriangularBands: input spectrum size (2049) does not correspond to the "inputSize" parameter (1025). Recomputing the filter bank.