aboutsummaryrefslogtreecommitdiffstats
path: root/maximilian_examples/20.FFT_example.cpp
blob: 086dac0aecd6e913162bca06675b3a86a51d4e40 (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, 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];
    
}