aboutsummaryrefslogtreecommitdiffstats
path: root/ofxMaxim/ofxMaximExamples0062OSX/ofMaxim_example/src/testApp.cpp
diff options
context:
space:
mode:
authormick <mickgrierson@gmail.com>2014-10-15 09:45:43 +0100
committermick <mickgrierson@gmail.com>2014-10-15 09:45:45 +0100
commita38ec23a22a45f7fd902f97e5fe38c9f1a7fb6e6 (patch)
tree52412b545adaaa7a3aff7bc4b6729944dd997713 /ofxMaxim/ofxMaximExamples0062OSX/ofMaxim_example/src/testApp.cpp
parentb0e96ad845e55bc26c546124927c6afecdcffce3 (diff)
ok
Diffstat (limited to 'ofxMaxim/ofxMaximExamples0062OSX/ofMaxim_example/src/testApp.cpp')
-rw-r--r--ofxMaxim/ofxMaximExamples0062OSX/ofMaxim_example/src/testApp.cpp24
1 files changed, 3 insertions, 21 deletions
diff --git a/ofxMaxim/ofxMaximExamples0062OSX/ofMaxim_example/src/testApp.cpp b/ofxMaxim/ofxMaximExamples0062OSX/ofMaxim_example/src/testApp.cpp
index 9f5bcb3..c86526e 100644
--- a/ofxMaxim/ofxMaximExamples0062OSX/ofMaxim_example/src/testApp.cpp
+++ b/ofxMaxim/ofxMaximExamples0062OSX/ofMaxim_example/src/testApp.cpp
@@ -29,11 +29,9 @@ void testApp::setup(){
ofBackground(0, 0, 0);
ofSetVerticalSync(true);
- /* This is stuff you always need.*/
sampleRate = 44100; /* Sampling Rate */
- initialBufferSize = 512; /* Buffer Size. you have to fill this buffer with sound*/
-
+ initialBufferSize = 512;
/* Now you can put anything you would normally put in maximilian's 'setup' method in here. */
@@ -42,8 +40,7 @@ void testApp::setup(){
beat.getLength();
- ofSoundStreamSetup(2,0,this, sampleRate, initialBufferSize, 4);/* Call this last ! */
-}
+ ofSoundStreamSetup(2,0,this, sampleRate, initialBufferSize, 4);}
//--------------------------------------------------------------
void testApp::update(){
@@ -53,11 +50,6 @@ void testApp::update(){
//--------------------------------------------------------------
void testApp::draw(){
- /* You can use any of the data from audio received and audiorequested to draw stuff here.
- Importantly, most people just use the input and output arrays defined above.
- Clever people don't do this. This bit of code shows that by default, each signal is going to flip
- between -1 and 1. You need to account for this somehow. Get the absolute value for example.
- */
ofSetColor(255, 255, 255,255);
ofRect(600, 300, sample*150, sample*150); /* audio sigs go between -1 and 1. See?*/
@@ -70,17 +62,7 @@ void testApp::audioRequested (float * output, int bufferSize, int nChannels){
for (int i = 0; i < bufferSize; i++){
- /* Stick your maximilian 'play()' code in here ! Declare your objects in testApp.h.
-
- For information on how maximilian works, take a look at the example code at
-
- http://www.maximilian.strangeloop.co.uk
-
- under 'Tutorials'.
-
- */
-
-
+
sample=beat.play(0.5, 0, beat.length);
wave=sine1.sinebuf(abs(mouseX));/* mouse controls sinewave pitch. we get abs value to stop it dropping