aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
blob: 797f185fd989ed5e851f29d72969ad57a2099959 (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
#include "maximilian.h"

maxiSample beats; //We give our sample a name. It's called beats this time. We could have loads of them, but they have to have different names.
maxiDyn compressor; //this is a compressor
double out;

void setup() {//some inits
	
	beats.load("/Users/mickgrierson/Documents/audio/audio2/orbital1.wav");//load in your samples. Provide the full path to a wav file.
	printf("Summary:\n%s", beats.getSummary());//get info on samples if you like.
	
}

void play(double *output) {//this is where the magic happens. Very slow magic.
	
	
	//here, we're just compressing the file in real-time
	//arguments are input,ratio,threshold,attack,release. a long attack is something like 0.0001 and a long release is like 0.9999.
	
	out=compressor.compressor(beats.play(),10,0.1,0.2,0.9995);

	output[0]=out;	
	output[1]=out;	
	
	//	*output=beats.play(0.69);//play the file with a speed setting. 1. is normal speed.
	//	*output=beats.play(0.5,0,44100);//linear interpolationplay with a frequency input, start point and end point. Useful for syncing.
	//	*output=beats.play4(0.5,0,44100);//cubic interpolation play with a frequency input, start point and end point. Useful for syncing.

}