Mercurial > hg > beaglert
comparison examples/bucket_brigade_chorus/render.cpp @ 308:1feb9c23ac57 prerelease
Renamed read/write functions to remove the Frame --> e.g. analogWriteFrameOnce -> analogWriteOnce, digitalReadFrame -> digitalRead
author | andrewm |
---|---|
date | Fri, 27 May 2016 18:21:21 +0100 |
parents | e4392164b458 |
children | 9dc5a0ccad25 |
comparison
equal
deleted
inserted
replaced
307:ff5f346a293e | 308:1feb9c23ac57 |
---|---|
91 } | 91 } |
92 count++; | 92 count++; |
93 | 93 |
94 for(unsigned int n = 0; n < context->audioFrames; n++) { | 94 for(unsigned int n = 0; n < context->audioFrames; n++) { |
95 feedback = 0.4; | 95 feedback = 0.4; |
96 float input = audioReadFrame(context, n, 0) + audioReadFrame(context, n, 1); | 96 float input = audioRead(context, n, 0) + audioRead(context, n, 1); |
97 delay[writePointer++] = input + delay[readPointer]*feedback; | 97 delay[writePointer++] = input + delay[readPointer]*feedback; |
98 float output = (input + 0.9*delay[readPointer++] ) * 0.5; | 98 float output = (input + 0.9*delay[readPointer++] ) * 0.5; |
99 audioWriteFrame(context, n, 0, output); | 99 audioWrite(context, n, 0, output); |
100 audioWriteFrame(context, n, 1, output); | 100 audioWrite(context, n, 1, output); |
101 if(writePointer>=delayLength) | 101 if(writePointer>=delayLength) |
102 writePointer-=delayLength; | 102 writePointer-=delayLength; |
103 if(readPointer>=delayLength) | 103 if(readPointer>=delayLength) |
104 readPointer-=delayLength; | 104 readPointer-=delayLength; |
105 | 105 |