aboutsummaryrefslogtreecommitdiffstats
path: root/maximilian_examples/20.FFT_example.cpp
blob: b6728d2a360310f28b6649a3539cc7e0ff3e62c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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, 256);
    
}

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];
    
}