comparison examples/basic_analog_input/render.cpp @ 314:611306d840b3 prerelease

Merge
author Giulio Moro <giuliomoro@yahoo.it>
date Fri, 27 May 2016 19:00:43 +0100
parents 1feb9c23ac57
children db2fe4e1b88e
comparison
equal deleted inserted replaced
313:c770cdf3d8b2 314:611306d840b3
59 // is twice as high 59 // is twice as high
60 60
61 for(unsigned int n = 0; n < context->audioFrames; n++) { 61 for(unsigned int n = 0; n < context->audioFrames; n++) {
62 if(!(n % gAudioFramesPerAnalogFrame)) { 62 if(!(n % gAudioFramesPerAnalogFrame)) {
63 // Even audio samples: update frequency and amplitude from the matrix 63 // Even audio samples: update frequency and amplitude from the matrix
64 frequency = map(analogReadFrame(context, n/gAudioFramesPerAnalogFrame, gSensorInputFrequency), 0, 1, 100, 1000); 64 frequency = map(analogRead(context, n/gAudioFramesPerAnalogFrame, gSensorInputFrequency), 0, 1, 100, 1000);
65 amplitude = analogReadFrame(context, n/gAudioFramesPerAnalogFrame, gSensorInputAmplitude); 65 amplitude = analogRead(context, n/gAudioFramesPerAnalogFrame, gSensorInputAmplitude);
66 } 66 }
67 67
68 float out = amplitude * sinf(gPhase); 68 float out = amplitude * sinf(gPhase);
69 69
70 for(unsigned int channel = 0; channel < context->audioChannels; channel++) 70 for(unsigned int channel = 0; channel < context->audioChannels; channel++)