|
|
@ -41,9 +41,6 @@ |
|
|
|
|
|
|
|
|
|
|
|
#define RV_MASTER_LOWPASS_F (0.6f) // master lowpass scaled frequency coeff.
|
|
|
|
#define RV_MASTER_LOWPASS_F (0.6f) // master lowpass scaled frequency coeff.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AudioEffectPlateReverb_F32::AudioEffectPlateReverb_F32() : AudioStream_F32(2, inputQueueArray_f32) { begin();} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool AudioEffectPlateReverb_F32::begin() |
|
|
|
bool AudioEffectPlateReverb_F32::begin() |
|
|
|
{ |
|
|
|
{ |
|
|
|
inputGainSet = 0.5f; |
|
|
|
inputGainSet = 0.5f; |
|
|
@ -124,7 +121,7 @@ void AudioEffectPlateReverb_F32::update() |
|
|
|
{ |
|
|
|
{ |
|
|
|
#if defined(__IMXRT1062__) |
|
|
|
#if defined(__IMXRT1062__) |
|
|
|
if (!initialised) return; |
|
|
|
if (!initialised) return; |
|
|
|
audio_block_f32_t *blockL, *blockR; |
|
|
|
audio_block_f32_t *blockL, *blockR, *blockSilent; |
|
|
|
int16_t i; |
|
|
|
int16_t i; |
|
|
|
float acc; |
|
|
|
float acc; |
|
|
|
float rv_time; |
|
|
|
float rv_time; |
|
|
@ -159,11 +156,38 @@ void AudioEffectPlateReverb_F32::update() |
|
|
|
blockL = AudioStream_F32::receiveReadOnly_f32(0); |
|
|
|
blockL = AudioStream_F32::receiveReadOnly_f32(0); |
|
|
|
blockR = AudioStream_F32::receiveReadOnly_f32(1); |
|
|
|
blockR = AudioStream_F32::receiveReadOnly_f32(1); |
|
|
|
if (!blockL || !blockR)
|
|
|
|
if (!blockL || !blockR)
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// preapare silent block
|
|
|
|
|
|
|
|
blockSilent = AudioStream_F32::allocate_f32(); |
|
|
|
|
|
|
|
if (!blockSilent) // no memory,
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if (blockL) AudioStream_F32::release(blockL); |
|
|
|
if (blockL) AudioStream_F32::release(blockL); |
|
|
|
if (blockR) AudioStream_F32::release(blockR); |
|
|
|
if (blockR) AudioStream_F32::release(blockR); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
memset(&blockSilent->data[0], 0, blockSilent->length*sizeof(float32_t)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (blockL) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
AudioStream_F32::transmit(blockL, 0); |
|
|
|
|
|
|
|
AudioStream_F32::release(blockL); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
AudioStream_F32::transmit(blockSilent, 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (blockR)
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
AudioStream_F32::transmit(blockR, 1); |
|
|
|
|
|
|
|
AudioStream_F32::release(blockR); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
AudioStream_F32::transmit(blockSilent, 1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
AudioStream_F32::release(blockSilent); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
AudioStream_F32::transmit(blockL, 0);
|
|
|
|
AudioStream_F32::transmit(blockL, 0);
|
|
|
|
AudioStream_F32::transmit(blockR, 1); |
|
|
|
AudioStream_F32::transmit(blockR, 1); |
|
|
|
AudioStream_F32::release(blockL); |
|
|
|
AudioStream_F32::release(blockL); |
|
|
@ -171,12 +195,12 @@ void AudioEffectPlateReverb_F32::update() |
|
|
|
return; |
|
|
|
return; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case BYPASS_MODE_OFF: |
|
|
|
case BYPASS_MODE_OFF: |
|
|
|
blockL = AudioStream_F32::allocate_f32(); |
|
|
|
blockSilent = AudioStream_F32::allocate_f32(); |
|
|
|
if (!blockL) return; |
|
|
|
if (!blockSilent) return; |
|
|
|
memset(&blockL->data[0], 0, blockL->length*sizeof(float32_t)); |
|
|
|
memset(&blockSilent->data[0], 0, blockSilent->length*sizeof(float32_t)); |
|
|
|
AudioStream_F32::transmit(blockL, 0);
|
|
|
|
AudioStream_F32::transmit(blockSilent, 0);
|
|
|
|
AudioStream_F32::transmit(blockL, 1); |
|
|
|
AudioStream_F32::transmit(blockSilent, 1); |
|
|
|
AudioStream_F32::release(blockL);
|
|
|
|
AudioStream_F32::release(blockSilent);
|
|
|
|
return; |
|
|
|
return; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case BYPASS_MODE_TRAILS: |
|
|
|
case BYPASS_MODE_TRAILS: |
|
|
@ -188,11 +212,27 @@ void AudioEffectPlateReverb_F32::update() |
|
|
|
blockR = AudioStream_F32::receiveWritable_f32(1); |
|
|
|
blockR = AudioStream_F32::receiveWritable_f32(1); |
|
|
|
|
|
|
|
|
|
|
|
if (!blockL || !blockR)
|
|
|
|
if (!blockL || !blockR)
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// preapare silent block
|
|
|
|
|
|
|
|
blockSilent = AudioStream_F32::allocate_f32(); |
|
|
|
|
|
|
|
if (!blockSilent) // no memory,
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if (blockL) AudioStream_F32::release(blockL); |
|
|
|
if (blockL) AudioStream_F32::release(blockL); |
|
|
|
if (blockR) AudioStream_F32::release(blockR); |
|
|
|
if (blockR) AudioStream_F32::release(blockR); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
memset(&blockSilent->data[0], 0, blockSilent->length*sizeof(float32_t)); |
|
|
|
|
|
|
|
if (!blockL)
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
blockL = blockSilent; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!blockR)
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
blockR = blockSilent; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
flags.cleanup_done = 0; |
|
|
|
flags.cleanup_done = 0; |
|
|
|
rv_time = rv_time_k; |
|
|
|
rv_time = rv_time_k; |
|
|
|
|
|
|
|
|
|
|
|