diff options
| author | mick grierson <mickgrierson@gmail.com> | 2016-10-09 22:40:54 +0100 |
|---|---|---|
| committer | mick grierson <mickgrierson@gmail.com> | 2016-10-09 22:40:54 +0100 |
| commit | 7f4bec02beedeb71725c65191b8d76f24b56b9a3 (patch) | |
| tree | 8dedba32c2a476d83c47bd226e0c54bac67a8836 /main.cpp | |
| parent | ff891983f82464506b2f6545fd1d26c413638c64 (diff) | |
getLength
Diffstat (limited to 'main.cpp')
| -rwxr-xr-x | main.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
@@ -1,31 +1,22 @@ #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/michaelgrierson/Documents/workspace/Maximilian/beat2.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. - - compressor.setAttack(200); - compressor.setRelease(500); - compressor.setThreshold(0.2); - compressor.setRatio(5); - - //you can set these any time you like. + cout << beats.getLength(); } void play(double *output) {//this is where the magic happens. Very slow magic. + //output[0]=beats.play();//just play the file. Looping is default for all play functions. + output[0]=beats.play(0.68);//play the file with a speed setting. 1. is normal speed. + //output[0]=beats.play(0.5,0,44100);//linear interpolationplay with a frequency input, start point and end point. Useful for syncing. + //output[0]=beats.play4(0.5,0,44100);//cubic interpolation play with a frequency input, start point and end point. Useful for syncing. - //here, we're just compressing the file in real-time - //arguments are input,ratio,threshold,attack,release - out=compressor.compress(beats.play()); - - output[0]=out; - output[1]=out; - + output[1]=output[0]; } |
