From a38ec23a22a45f7fd902f97e5fe38c9f1a7fb6e6 Mon Sep 17 00:00:00 2001 From: mick Date: Wed, 15 Oct 2014 09:45:43 +0100 Subject: ok --- .../ofMaxim_example/src/testApp.cpp | 24 +++------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'ofxMaxim/ofxMaximExamples0062OSX/ofMaxim_example/src') 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 -- cgit v1.3