aboutsummaryrefslogtreecommitdiffstats
path: root/maximilian_examples/20.FFT_example.cpp
diff options
context:
space:
mode:
authormick grierson <mickgrierson@gmail.com>2015-12-08 14:56:16 +0000
committermick grierson <mickgrierson@gmail.com>2015-12-08 14:56:16 +0000
commit39ea0d49f49ac6dbdfda8a5a7b40ac8ff3f738e2 (patch)
treeb4011c0d56336cbed20cc9f75a24e38cf5426fd4 /maximilian_examples/20.FFT_example.cpp
parentfba2ae1dd01c41319fc5c967b486e781447aa3ec (diff)
adding fft terminal example
Diffstat (limited to 'maximilian_examples/20.FFT_example.cpp')
-rw-r--r--maximilian_examples/20.FFT_example.cpp31
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