src/ofxAubioMelBands.cpp: make nBands a parameter
authorPaul Brossier <piem@piem.org>
Tue, 19 Jan 2016 19:57:18 +0000 (20:57 +0100)
committerPaul Brossier <piem@piem.org>
Tue, 19 Jan 2016 19:57:18 +0000 (20:57 +0100)
src/ofxAubioMelBands.cpp
src/ofxAubioMelBands.h

index 0516fb2..fecb455 100644 (file)
@@ -33,11 +33,12 @@ void ofxAubioMelBands::setup()
 void ofxAubioMelBands::setup(string method, int buf_s, int hop_s, int samplerate)
 {
     ofxAubioBlock::setup(method, buf_s, hop_s, samplerate);
+    nBands = 40;
     pv = new_aubio_pvoc(buf_s, hop_s);
     spectrum = new_cvec(buf_s);
-    fb = new_aubio_filterbank(40, buf_s);
+    fb = new_aubio_filterbank(nBands, buf_s);
     aubio_filterbank_set_mel_coeffs_slaney(fb, samplerate);
-    bands = new_fvec(40);
+    bands = new_fvec(nBands);
     energies = bands->data;
 
     if (pv && fb) {
index 885df28..c04f62f 100644 (file)
@@ -36,6 +36,7 @@ class ofxAubioMelBands : public ofxAubioBlock {
        void setup();
        void setup(string method, int buf_s, int hop_s, int samplerate);
 
+       int nBands;
        float *energies;
 
     private: