|
|
|
@ -35,7 +35,7 @@ void AudioEffectSimpleChorus::update(void) |
|
|
|
|
audio_block_t *inputAudioBlock = receiveReadOnly(); // get the next block of input samples
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
// Check is block is disabled
|
|
|
|
|
// Check is block is disablee
|
|
|
|
|
if (m_enable == false) { |
|
|
|
|
// do not transmit or process any audio, return as quickly as possible.
|
|
|
|
|
if (inputAudioBlock) release(inputAudioBlock); |
|
|
|
@ -76,6 +76,7 @@ void AudioEffectSimpleChorus::update(void) |
|
|
|
|
audio_block_t *blockToRelease = m_memory->addBlock(inputAudioBlock); |
|
|
|
|
|
|
|
|
|
// Chorus
|
|
|
|
|
size_t half_delay_samples=size_t(float(m_delaySamples)/2+0.5); |
|
|
|
|
float *mod = lfo.getNextVector(); |
|
|
|
|
audio_block_t *lfoData = nullptr; |
|
|
|
|
lfoData = allocate(); |
|
|
|
@ -83,19 +84,16 @@ void AudioEffectSimpleChorus::update(void) |
|
|
|
|
for(uint8_t i=0;i<AUDIO_BLOCK_SAMPLES;i++) |
|
|
|
|
{ |
|
|
|
|
//m_memory->getSamples(blockToOutput,m_delaySamples);
|
|
|
|
|
m_memory->getSamples(lfoData,float(m_delaySamples)/2+(m_intensity*mod[i]*float(m_delaySamples)/2),3); |
|
|
|
|
if(mod[i]==0.0) |
|
|
|
|
blockToOutput->data[i]=lfoData->data[1]; |
|
|
|
|
else if(mod[i]<0.0) |
|
|
|
|
blockToOutput->data[i]=int16_t(((float(lfoData->data[0])-lfoData->data[1])*(1+mod[i]))+lfoData->data[0]+0.5); |
|
|
|
|
else |
|
|
|
|
blockToOutput->data[i]=int16_t(((float(lfoData->data[2])-lfoData->data[1])*mod[i])+lfoData->data[2]+0.5); |
|
|
|
|
//blockToOutput->data[i]=inputAudioBlock->data[i];
|
|
|
|
|
m_memory->getSamples(lfoData,half_delay_samples+size_t((float(half_delay_samples)*mod[i]+0.5)),1); |
|
|
|
|
blockToOutput->data[i]=lfoData[0]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// perform the wet/dry mix mix
|
|
|
|
|
//m_postProcessing(blockToOutput, inputAudioBlock, blockToOutput);
|
|
|
|
|
transmit(blockToOutput); |
|
|
|
|
|
|
|
|
|
release(inputAudioBlock); |
|
|
|
|
release(lfoData); |
|
|
|
|
if(m_previousBlock) |
|
|
|
|
release(m_previousBlock); |
|
|
|
|