comparison examples/level_meter/render.cpp @ 311:493a07f6ec09 prerelease

Renamed BelaContext->audioSampleCount to BelaContext->audioFramesElapsed for consistency of terminology
author andrewm
date Fri, 27 May 2016 18:37:51 +0100
parents 02c4ca0e3718
children 9dc5a0ccad25
comparison
equal deleted inserted replaced
310:02c4ca0e3718 311:493a07f6ec09
103 if(out > gAudioPeakLevel) 103 if(out > gAudioPeakLevel)
104 gAudioPeakLevel = out; 104 gAudioPeakLevel = out;
105 else { 105 else {
106 // Make peak decay slowly by only multiplying 106 // Make peak decay slowly by only multiplying
107 // every few samples 107 // every few samples
108 if(((context->audioSampleCount + n) & 31) == 0) 108 if(((context->audioFramesElapsed + n) & 31) == 0)
109 gAudioPeakLevel *= gPeakDecayRate; 109 gAudioPeakLevel *= gPeakDecayRate;
110 } 110 }
111 // LED bargraph on digital outputs 0-9 111 // LED bargraph on digital outputs 0-9
112 for(int led = 0; led < NUMBER_OF_SEGMENTS; led++) { 112 for(int led = 0; led < NUMBER_OF_SEGMENTS; led++) {
113 // All LEDs up to the local level light up. The LED 113 // All LEDs up to the local level light up. The LED