File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -316,10 +316,15 @@ void AudioAnalyzer::loadAudioSettings(){
316316 beatTrack->setConfidentThreshold (0.35 );
317317
318318 // Audio Analysis
319- fft = ofxFft::create (bufferSize, OF_FFT_WINDOW_HAMMING);
319+ fft = new ofxVP::Fft ();
320+ fft->setup (bufferSize);
320321
321- fftBinSize = fft->getBinSize ();
322- fft_binSizeHz = ((sampleRate/2 )/(fftBinSize-1 ));
322+ fftBinSize = (bufferSize / 2 ) + 1 ;
323+ // avoid division by 0
324+ if (fftBinSize<=1 ){
325+ fftBinSize = 2 ;
326+ }
327+ fft_binSizeHz = (sampleRate/2 )/(fftBinSize-1 );
323328 fft_StrongestBinValue = 0 .0f ;
324329 fft_StrongestBinIndex = 0 ;
325330 fft_pitchBin = 0 ;
Original file line number Diff line number Diff line change 3636
3737#include " PatchObject.h"
3838
39- #include " ofxFft .h"
39+ #include " ofxVPFFT .h"
4040#include " ofxBTrack.h"
4141
4242#include " imgui_plot.h"
@@ -82,7 +82,7 @@ class AudioAnalyzer : public PatchObject {
8282 std::mutex audioMutex;
8383
8484 // Analysis variables
85- ofxFft *fft;
85+ ofxVP::Fft *fft;
8686 ofxBTrack *beatTrack;
8787
8888 float *plot_data;
Original file line number Diff line number Diff line change @@ -340,7 +340,8 @@ void pdspParametricEQ::loadAudioSettings(){
340340 sampleRate = this ->ofxVPXml .getMosaicConfigInt (" sample_rate_in" );
341341 bufferSize = this ->ofxVPXml .getMosaicConfigInt (" buffer_size" );
342342
343- fft = ofxFft::create (bufferSize, OF_FFT_WINDOW_HAMMING);
343+ fft = new ofxVP::Fft ();
344+ fft->setup (bufferSize);
344345 spectrum = new float [fft->getBinSize ()];
345346 l1Filter = new std::vector<float >;
346347 m1Filter = new std::vector<float >;
Original file line number Diff line number Diff line change 3636
3737#include " PatchObject.h"
3838
39- #include " ofxFft .h"
39+ #include " ofxVPFFT .h"
4040
4141#include " imgui_plot.h"
4242#include " imgui-knobs.h"
@@ -65,7 +65,7 @@ class pdspParametricEQ : public PatchObject{
6565 void loadAudioSettings ();
6666
6767
68- ofxFft *fft;
68+ ofxVP::Fft *fft;
6969 float *spectrum;
7070
7171 pdsp::Scope scope;
You can’t perform that action at this time.
0 commit comments