diff options
Diffstat (limited to 'maximilian_examples/20.FFT_example.cpp')
| -rw-r--r-- | maximilian_examples/20.FFT_example.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/maximilian_examples/20.FFT_example.cpp b/maximilian_examples/20.FFT_example.cpp new file mode 100644 index 0000000..086dac0 --- /dev/null +++ b/maximilian_examples/20.FFT_example.cpp @@ -0,0 +1,31 @@ + +#include "maximilian.h" +#include "libs/maxim.h" + +maxiOsc mySine, myPhasor; // This is the oscillator we will use to generate the test tone +maxiFFT myFFT; + + + +void setup() { + + myFFT.setup(1024, 512, 2); + +} + +void play(double *output) { + + + float myOut=mySine.sinewave(myPhasor.phasor(0.2,100,5000)); + //output[0] is the left output. output[1] is the right output + + if (myFFT.process(myOut)) { + + //if you want you can mess with FFT frame values in here + + } + + output[0]=myOut;//simple as that! + output[1]=output[0]; + +}
\ No newline at end of file |
