instrument: the filter's velocity depth knob returns and multiplies the bipolar curve; the pre-v12 lift is a pure domain re-tag

This commit is contained in:
2026-07-31 20:24:40 -04:00
parent cfb53aade3
commit 5e290119c5
22 changed files with 243 additions and 166 deletions
+3
View File
@@ -638,6 +638,7 @@ static void testResolvePlayCarriesTheFilterAndResolvesOnlyItsEnvelope() {
st.filter.settings.driveNorm = 0.125f;
st.filter.settings.morphLaw = reasampler::instrument::engine::filter::MorphLaw::HighNotchLow;
st.filter.modAmount = -0.5;
st.filter.velAmount = -0.375; // distinct from every neighbouring field, so a mis-wire shows
st.filter.velocityCurve = VelocityCurve::fromPoints(
{{0.0, 0.0}, {127.0, 0.25}}, reasampler::instrument::engine::CurveDomain::Bipolar);
st.filter.keyTrack = 1.25;
@@ -655,6 +656,7 @@ static void testResolvePlayCarriesTheFilterAndResolvesOnlyItsEnvelope() {
CHECK(at48.filter.settings.driveNorm == 0.125f);
CHECK(at48.filter.settings.morphLaw == reasampler::instrument::engine::filter::MorphLaw::HighNotchLow);
CHECK(at48.filter.modAmount == -0.5);
CHECK(at48.filter.velAmount == -0.375);
// The transfer curve is dimensionless, so it crosses unchanged — asserted against the
// straight line the two stored knots describe, not against the stored object.
CHECK(at48.filter.velocityCurve.eval(0.0) == 0.0);
@@ -677,6 +679,7 @@ static void testResolvePlayCarriesTheFilterAndResolvesOnlyItsEnvelope() {
const PlayParams bare = resolvePlay(PlaySeconds{}, 48000);
CHECK(!bare.filter.enabled);
CHECK(bare.filter.modAmount == 0.0);
CHECK(bare.filter.velAmount == 0.0);
for (int v = 0; v <= 127; ++v) CHECK(bare.filter.velocityCurve.eval(v) == 0.0);
CHECK(bare.filter.keyTrack == 0.0);
CHECK(bare.filter.env.sustainLevel == 1.0);