Drive baseline probes by input role and calibrate the inputs they exposed #13

Merged
peterswimm merged 1 commit from baseline-inputs into main 2026-10-22 02:25:25 +00:00
Owner

Scope

Baseline probes now drive each probed input with the stimulus its role needs. The models those stimuli exposed are calibrated against G1-Emu, each in both export_faust and its render_module_output mirror.

  • Stimulus by port role (BASELINE_PROBE_STIMULI):
    • trig/trigger/retrig → ClkGen.
    • gate → Keyboard gate (port 1).
    • vel → Keyboard velocity (port 2).
    • Note and pitch inputs are unchanged.
  • DrumSynth 58 velocity: level is linear in vel, clipped to 0..1, and independent of Amount. An unpatched vel reads 1.
  • Mod-Env 23 retrig: a rising retrig edge drops the gate for one sample, so g1_env_adsr re-attacks from its current level.
  • EnvFollower 71:
    • Model: a peak detector with a 0.6 ms hold and a 7 ms peak release, then a one-pole attack/release stage.
    • Attack: 4.38 ms at 64, doubling every 12 steps. Release: 0.91 ms + 8.97 ms·2^(v/20.3).
    • Fitted to gate steps; the fixture now feeds it a gated Mod-Env burst.
  • CompareAB 89: adds the A>=B logic output (per Nomad2026), which makes it control-observable.
  • MasterOsc 97:
    • Observed through a slaved OscSlvE, which makes it audio-observable.
    • Pitch inputs are wired: coarse, fine, kbt, and pitch mod 1/2 with the Type II depth law.
  • PolyAreaIn 127:
    • Sums the poly section's CVA bus at 0.5× its output level; +6 dB doubles it. Muted outputs and outputs to the main pair are excluded.
    • Exportable as approximate, not Disting-released.
  • AudioIn 2: the G1 reference now runs with the adapter's --input-sine 220 (L 220 Hz, R 440 Hz). The model renders the same unit sines.
  • GainControl 44: an undriven control is 0. With shift on, the control maps to (c+1)/2.

No tolerance was widened. No numbered plan was cut and the parity matrix was not regenerated.

The v25 calibration session owns, and this PR leaves untouched:

  • OscA/OscB pitch-mod and FMA
  • ClkGen 68
  • LFOB/LFOC
  • PercOsc
  • Phaser
  • Expander

Testing

  • python3 -m unittest discover -s tests: 137 tests OK. New BaselineInputTests cover each item above.
  • tools/export_public.py into an empty directory verifies clean.
  • Fixture hashes against plan v24: only modules 20, 23, 46, 52, 53, 58, 71, 84, 89, 97, 100 and 127 changed (41 probes). Tier changes are 89 → control-observable, and 97 and 127 → audio-observable. AudioIn and GainControl fixtures are byte-identical; their change is in the adapter tone and the model.
  • Full probe sweep on a scratch plan (every v24 probe re-run, plus 22 new):
Verdict v24 scratch
pass 842 865
level 192 191
pitch 298 294
shape-or-phase 100 110
peak-only 7 7
both-silent 36 39
silence-mismatch 14 5
Probe(s) v24 → scratch
002-001, 002-002, 002-003 (AudioIn) silence-mismatch → pass
044-001, 044-002, 044-005, 044-006 (GainControl, undriven) silence-mismatch → both-silent
044-003 (GainControl shift) level → pass
058-034, 058-035 (DrumSynth trig/vel) silence-mismatch → pass
071-003, 071-004 (EnvFollower) pitch → pass
071-001, 071-002, 071-005, 071-006, 071-007 pitch → shape-or-phase †
053-002 (S&H trig) both-silent → shape-or-phase †
020-016 (ADSR retrig) shape-or-phase → pitch †
020-015, 023-020, 046-014, 052-024, 084-008 pass → shape-or-phase / pitch ‡
089-001..004 (CompareAB, new) 3 pass, 1 pitch †
097-001..013 (MasterOsc, new) 12 pass, 1 shape-or-phase
127-001..005 (PolyAreaIn, new) 5 pass

No other v24 verdict changed, and no real v24 pass regressed.

‡ Vacuous passes, now midpoint-equivalent (not regressions). In v24 these gate/trig probes were fed a Keyboard note. On G1 an envelope gate driven by a note fires only above note 64.5, so the envelope never fired. All five shared the identical idle rms_error of 0.0022. Now that the gate fires, each matches its own module's midpoint metric:

  • 020-015: 0.0517 (020-001: 0.0517)
  • 023-020: 0.0525 (023-001: 0.0526)
  • 046-014: 0.0433 (046-001: 0.0433)
  • 052-024: 0.0424 (052-001: 0.0423)
  • 084-008: 0.0980 (084-001: 0.0980)

What still fails is the OscA pitch-mod observer, which v25 owns.

† These are observed through the OscA control observer or depend on ClkGen phase, both owned by v25. With ClkGen's phase patched in scratch only, all four Mod-Env retrig cases pass (rms 0.004–0.006). G1 ClkGen rises at 0.0658 + n·0.125 s, while Faust rises about 49 ms earlier.

Impact Statement

  • Envelope, drum and sample-and-hold gate/trig/vel probes now exercise the module instead of measuring an idle observer. This removes five vacuous passes from the baseline.
  • Four modules gain G1-calibrated behaviour: DrumSynth velocity, Mod-Env retrig, EnvFollower and GainControl.
  • AudioIn and the previously structural-only MasterOsc, CompareAB and PolyAreaIn become measurable.
  • PolyAreaIn becomes Faust-exportable as approximate. It stays off the Disting release list.
  • The G1 reference adapter gains an --input-sine stimulus, used only for patches that contain AudioIn.

Follow-ups, not fixed here:

  • Bipolar Constant scaling is (v−64)/64 on G1; the model uses /63.
  • ADSR retrig is unmodelled.
  • Keyboard velocity reads 1.0 at MIDI 100 on G1; the model uses 100/127.
  • MasterOsc pitch-mod is 3.7–16.5 cents off through the shared Type II depth law (v25).
## Scope Baseline probes now drive each probed input with the stimulus its role needs. The models those stimuli exposed are calibrated against G1-Emu, each in both `export_faust` and its `render_module_output` mirror. - **Stimulus by port role** (`BASELINE_PROBE_STIMULI`): - `trig`/`trigger`/`retrig` → ClkGen. - `gate` → Keyboard gate (port 1). - `vel` → Keyboard velocity (port 2). - Note and pitch inputs are unchanged. - **DrumSynth 58 velocity:** level is linear in vel, clipped to 0..1, and independent of Amount. An unpatched vel reads 1. - **Mod-Env 23 retrig:** a rising retrig edge drops the gate for one sample, so `g1_env_adsr` re-attacks from its current level. - **EnvFollower 71:** - Model: a peak detector with a 0.6 ms hold and a 7 ms peak release, then a one-pole attack/release stage. - Attack: 4.38 ms at 64, doubling every 12 steps. Release: 0.91 ms + 8.97 ms·2^(v/20.3). - Fitted to gate steps; the fixture now feeds it a gated Mod-Env burst. - **CompareAB 89:** adds the `A>=B` logic output (per Nomad2026), which makes it control-observable. - **MasterOsc 97:** - Observed through a slaved OscSlvE, which makes it audio-observable. - Pitch inputs are wired: coarse, fine, kbt, and pitch mod 1/2 with the Type II depth law. - **PolyAreaIn 127:** - Sums the poly section's CVA bus at 0.5× its output level; +6 dB doubles it. Muted outputs and outputs to the main pair are excluded. - Exportable as `approximate`, not Disting-released. - **AudioIn 2:** the G1 reference now runs with the adapter's `--input-sine 220` (L 220 Hz, R 440 Hz). The model renders the same unit sines. - **GainControl 44:** an undriven control is 0. With shift on, the control maps to (c+1)/2. No tolerance was widened. No numbered plan was cut and the parity matrix was not regenerated. The v25 calibration session owns, and this PR leaves untouched: - OscA/OscB pitch-mod and FMA - ClkGen 68 - LFOB/LFOC - PercOsc - Phaser - Expander ## Testing - `python3 -m unittest discover -s tests`: 137 tests OK. New `BaselineInputTests` cover each item above. - `tools/export_public.py` into an empty directory verifies clean. - Fixture hashes against plan v24: only modules 20, 23, 46, 52, 53, 58, 71, 84, 89, 97, 100 and 127 changed (41 probes). Tier changes are 89 → control-observable, and 97 and 127 → audio-observable. AudioIn and GainControl fixtures are byte-identical; their change is in the adapter tone and the model. - Full probe sweep on a scratch plan (every v24 probe re-run, plus 22 new): | Verdict | v24 | scratch | |---|---|---| | pass | 842 | 865 | | level | 192 | 191 | | pitch | 298 | 294 | | shape-or-phase | 100 | 110 | | peak-only | 7 | 7 | | both-silent | 36 | 39 | | silence-mismatch | 14 | 5 | | Probe(s) | v24 → scratch | |---|---| | 002-001, 002-002, 002-003 (AudioIn) | silence-mismatch → pass | | 044-001, 044-002, 044-005, 044-006 (GainControl, undriven) | silence-mismatch → both-silent | | 044-003 (GainControl shift) | level → pass | | 058-034, 058-035 (DrumSynth trig/vel) | silence-mismatch → pass | | 071-003, 071-004 (EnvFollower) | pitch → pass | | 071-001, 071-002, 071-005, 071-006, 071-007 | pitch → shape-or-phase † | | 053-002 (S&H trig) | both-silent → shape-or-phase † | | 020-016 (ADSR retrig) | shape-or-phase → pitch † | | 020-015, 023-020, 046-014, 052-024, 084-008 | pass → shape-or-phase / pitch ‡ | | 089-001..004 (CompareAB, new) | 3 pass, 1 pitch † | | 097-001..013 (MasterOsc, new) | 12 pass, 1 shape-or-phase | | 127-001..005 (PolyAreaIn, new) | 5 pass | No other v24 verdict changed, and no real v24 pass regressed. ‡ **Vacuous passes, now midpoint-equivalent (not regressions).** In v24 these gate/trig probes were fed a Keyboard note. On G1 an envelope gate driven by a note fires only above note 64.5, so the envelope never fired. All five shared the identical idle rms_error of 0.0022. Now that the gate fires, each matches its own module's midpoint metric: - 020-015: 0.0517 (020-001: 0.0517) - 023-020: 0.0525 (023-001: 0.0526) - 046-014: 0.0433 (046-001: 0.0433) - 052-024: 0.0424 (052-001: 0.0423) - 084-008: 0.0980 (084-001: 0.0980) What still fails is the OscA pitch-mod observer, which v25 owns. † These are observed through the OscA control observer or depend on ClkGen phase, both owned by v25. With ClkGen's phase patched in scratch only, all four Mod-Env retrig cases pass (rms 0.004–0.006). G1 ClkGen rises at 0.0658 + n·0.125 s, while Faust rises about 49 ms earlier. ## Impact Statement - Envelope, drum and sample-and-hold gate/trig/vel probes now exercise the module instead of measuring an idle observer. This removes five vacuous passes from the baseline. - Four modules gain G1-calibrated behaviour: DrumSynth velocity, Mod-Env retrig, EnvFollower and GainControl. - AudioIn and the previously structural-only MasterOsc, CompareAB and PolyAreaIn become measurable. - PolyAreaIn becomes Faust-exportable as `approximate`. It stays off the Disting release list. - The G1 reference adapter gains an `--input-sine` stimulus, used only for patches that contain AudioIn. Follow-ups, not fixed here: - Bipolar Constant scaling is (v−64)/64 on G1; the model uses /63. - ADSR retrig is unmodelled. - Keyboard velocity reads 1.0 at MIDI 100 on G1; the model uses 100/127. - MasterOsc pitch-mod is 3.7–16.5 cents off through the shared Type II depth law (v25).
Drive baseline probes by input role and model the inputs that exposed
All checks were successful
PR policy check / policy-gate (pull_request) Successful in 0s
832a70d101
Probed trig/retrig inputs get a ClkGen, gate inputs the Keyboard gate and
vel inputs Keyboard velocity, so envelope and drum probes actually fire.
Calibrate DrumSynth velocity, Mod-Env retrig, the EnvFollower peak/hold and
attack/release laws, MasterOsc pitch (observed through a slaved OscSlvE),
the PolyAreaIn CVA bridge, AudioIn against the adapter test tone and
GainControl, and add CompareAB's A>=B output.
peterswimm deleted branch baseline-inputs 2026-10-22 02:25:26 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
peter-swimm/nardwahl!13
No description provided.