Fix wet/dry mix when performing in-place processing (output buffer == input buffer). Previously the plugin was effectively INPLACE_BROKEN but did not declare it. I never noticed this before because all the LADSPA hosts I tested in used out-of-place buffers

This commit is contained in:
Chris Cannam
2022-01-07 13:50:08 +00:00
parent 297cc8d4d0
commit 51c95b412f

View File

@@ -554,6 +554,10 @@ RubberBandPitchShifter::updateFormant()
void void
RubberBandPitchShifter::runImpl(uint32_t insamples) RubberBandPitchShifter::runImpl(uint32_t insamples)
{ {
for (size_t c = 0; c < m_channels; ++c) {
m_delayMixBuffer[c]->write(m_input[c], insamples);
}
size_t offset = 0; size_t offset = 0;
// We have to break up the input into chunks like this because // We have to break up the input into chunks like this because
@@ -572,11 +576,9 @@ RubberBandPitchShifter::runImpl(uint32_t insamples)
offset += block; offset += block;
} }
for (size_t c = 0; c < m_channels; ++c) {
m_delayMixBuffer[c]->write(m_input[c], insamples);
}
float mix = 0.0; float mix = 0.0;
if (m_wetDry) mix = *m_wetDry; if (m_wetDry) mix = *m_wetDry;
for (size_t c = 0; c < m_channels; ++c) { for (size_t c = 0; c < m_channels; ++c) {
if (mix > 0.0) { if (mix > 0.0) {
for (size_t i = 0; i < insamples; ++i) { for (size_t i = 0; i < insamples; ++i) {