-Reverb, Sidechain and PostSidechain sends implemented

main
Harry van Haaren 2013-07-28 13:42:05 +01:00
parent 14bbc49e49
commit 85a13864c0
3 changed files with 24 additions and 1 deletions

View File

@ -17,8 +17,15 @@ class Buffers
void* midi [32];
enum BUFFER {
// AUDIO
MASTER_OUTPUT = 0,
MASTER_INPUT,
REVERB,
SIDECHAIN,
POST_SIDECHAIN,
// MIDI
MASTER_MIDI_INPUT,
APC_INPUT,
APC_OUTPUT,

View File

@ -50,6 +50,12 @@ Jack::Jack()
JackPortIsOutput,
0 );
/// prepare internal buffers
buffers.audio[Buffers::REVERB] = (float*) malloc( sizeof(float) * nframes );
buffers.audio[Buffers::SIDECHAIN] = (float*) malloc( sizeof(float) * nframes );
buffers.audio[Buffers::POST_SIDECHAIN] = (float*) malloc( sizeof(float) * nframes );
for(int i = 0; i < NTRACKS; i++)
{
loopers.push_back( new Looper(i) );

View File

@ -60,10 +60,20 @@ class TrackOutput : public AudioProcessor
}
uiUpdateCounter += nframes;
/// copy audio data into reverb / sidechain / master buffers
float* trackBuf = buffers->audio[Buffers::TRACK_0 + track];
float* reverb = buffers->audio[Buffers::REVERB];
float* sidechain = buffers->audio[Buffers::SIDECHAIN];
float* postSidechain = buffers->audio[Buffers::POST_SIDECHAIN];
for(int i = 0; i < nframes; i++)
{
// copy data here
*reverb++ += *trackBuf * _toReverb;
*sidechain++ += *trackBuf * _toSidechain;
*postSidechain++ += *trackBuf * _toPostSidechain;
trackBuf++;
}
}