aboutsummaryrefslogtreecommitdiffstats
path: root/maximilian_examples/12.SamplePlayer.cpp
diff options
context:
space:
mode:
authorChris Kiefer <chrisk13fer@gmail.com>2011-08-23 16:59:47 +0100
committerChris Kiefer <chrisk13fer@gmail.com>2011-08-23 16:59:47 +0100
commit9b02537e82866bcfdcb22a5e7fd9c7f5217c2c64 (patch)
tree193b798778c258d52093f17fd41b2f250a079553 /maximilian_examples/12.SamplePlayer.cpp
parentbc4a8dbc0fb0fcafffa1e94edfaedf9c4845cecc (diff)
maximillian basic examples
Diffstat (limited to 'maximilian_examples/12.SamplePlayer.cpp')
-rwxr-xr-xmaximilian_examples/12.SamplePlayer.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/maximilian_examples/12.SamplePlayer.cpp b/maximilian_examples/12.SamplePlayer.cpp
new file mode 100755
index 0000000..2706f0b
--- /dev/null
+++ b/maximilian_examples/12.SamplePlayer.cpp
@@ -0,0 +1,21 @@
+#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.
+
+void setup() {//some inits
+
+ beats.load("/Users/username/somewhere/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.
+
+}
+
+void play(double *output) {//this is where the magic happens. Very slow magic.
+
+ *output=beats.play();//just play the file. Looping is default for all play functions.
+ // *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.
+
+
+}
+