aboutsummaryrefslogtreecommitdiffstats
path: root/maximilian_examples/1.TestTone.cpp
blob: b8da07c1f8874e2b42c42de9f589328ade5dfb7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//This example shows how to create one of the most fundamental building blocks in computer audio. The sine wave.
//The sine wave is an oscillator - it oscillates back and forth between two values in a particular shape.


#include "maximilian.h"

maxiOsc mySine;//let's create an oscillator and give it a name.

void setup() {//some inits
    //nothing to go here this time
}

void play(double *output) {//this is where the magic happens. Very slow magic.
    
    //output[0] is the left output. output[1] is the right output
    output[0]=mySine.sinewave(440);//simple as that!
    
}