comparison examples/03-Analog/analog-input/render.cpp @ 537:bfcbeb437869 API-update

Updated RTAudioSettings with in/out, ported some examples and libpd
author Giulio Moro <giuliomoro@yahoo.it>
date Fri, 24 Jun 2016 01:36:07 +0100
parents 9f455f01edd5
children 3016638b4da2
comparison
equal deleted inserted replaced
528:5c8f46fcd4d0 537:bfcbeb437869
66 amplitude = analogRead(context, n/gAudioFramesPerAnalogFrame, gSensorInputAmplitude); 66 amplitude = analogRead(context, n/gAudioFramesPerAnalogFrame, gSensorInputAmplitude);
67 } 67 }
68 68
69 float out = amplitude * sinf(gPhase); 69 float out = amplitude * sinf(gPhase);
70 70
71 for(unsigned int channel = 0; channel < context->audioChannels; channel++) 71 for(unsigned int channel = 0; channel < context->audioOutChannels; channel++)
72 context->audioOut[n * context->audioChannels + channel] = out; 72 context->audioOut[n * context->audioChannels + channel] = out;
73 73
74 gPhase += 2.0 * M_PI * frequency * gInverseSampleRate; 74 gPhase += 2.0 * M_PI * frequency * gInverseSampleRate;
75 if(gPhase > 2.0 * M_PI) 75 if(gPhase > 2.0 * M_PI)
76 gPhase -= 2.0 * M_PI; 76 gPhase -= 2.0 * M_PI;