Apply modifier for pitch_cc and tune cc
This commit is contained in:
parent
bf4bdad656
commit
ddeecf41b9
1 changed files with 13 additions and 2 deletions
|
|
@ -471,8 +471,14 @@ void sfz::Voice::fillWithData(AudioSpan<float> buffer) noexcept
|
||||||
multiplicativeEnvelope(events, *bends, bendLambda, bendStepFactor);
|
multiplicativeEnvelope(events, *bends, bendLambda, bendStepFactor);
|
||||||
else
|
else
|
||||||
multiplicativeEnvelope(events, *bends, bendLambda);
|
multiplicativeEnvelope(events, *bends, bendLambda);
|
||||||
|
|
||||||
applyGain<float>(*bends, *jumps);
|
applyGain<float>(*bends, *jumps);
|
||||||
|
|
||||||
|
for (const auto& mod : region->tuneCC) {
|
||||||
|
const auto events = resources.midiState.getCCEvents(mod.cc);
|
||||||
|
multiplicativeEnvelope(events, *bends, [&](float x) { return centsFactor(x * mod.value); });
|
||||||
|
applyGain<float>(*bends, *jumps);
|
||||||
|
}
|
||||||
|
|
||||||
jumps->front() += floatPositionOffset;
|
jumps->front() += floatPositionOffset;
|
||||||
cumsum<float>(*jumps, *jumps);
|
cumsum<float>(*jumps, *jumps);
|
||||||
sfzInterpolationCast<float>(*jumps, *indices, *leftCoeffs, *rightCoeffs);
|
sfzInterpolationCast<float>(*jumps, *indices, *leftCoeffs, *rightCoeffs);
|
||||||
|
|
@ -562,9 +568,14 @@ void sfz::Voice::fillWithGenerator(AudioSpan<float> buffer) noexcept
|
||||||
multiplicativeEnvelope(events, *bends, bendLambda, bendStepFactor);
|
multiplicativeEnvelope(events, *bends, bendLambda, bendStepFactor);
|
||||||
else
|
else
|
||||||
multiplicativeEnvelope(events, *bends, bendLambda);
|
multiplicativeEnvelope(events, *bends, bendLambda);
|
||||||
|
|
||||||
applyGain<float>(*bends, *frequencies);
|
applyGain<float>(*bends, *frequencies);
|
||||||
|
|
||||||
|
for (const auto& mod : region->tuneCC) {
|
||||||
|
const auto events = resources.midiState.getCCEvents(mod.cc);
|
||||||
|
multiplicativeEnvelope(events, *bends, [&](float x) { return centsFactor(x * mod.value); });
|
||||||
|
applyGain<float>(*bends, *frequencies);
|
||||||
|
}
|
||||||
|
|
||||||
waveOscillator.processModulated(frequencies->data(), leftSpan.data(), buffer.getNumFrames());
|
waveOscillator.processModulated(frequencies->data(), leftSpan.data(), buffer.getNumFrames());
|
||||||
copy<float>(leftSpan, rightSpan);
|
copy<float>(leftSpan, rightSpan);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue