Map AudioIn to Disting NT inputs and bring AudioIn to reference-compared #14

Merged
peterswimm merged 2 commits from disting-audio-inputs into main 2026-10-22 03:52:39 +00:00
Owner

Scope

Map AudioIn to the Disting NT's audio inputs, bring AudioIn (2) to reference-compared, and build audition plug-ins for the reference-compared processors (the plug-ins and checklist stay private).

  • Disting inputs.
    • Each Disting build path (build-disting, release-disting, validate-disting) now exports a patch with AudioIn as process(bus_in_left, bus_in_right) = left, right with { … }.
    • nt_arch.cpp exposes these inputs as the plug-in's Input 1 and Input 2 bus parameters.
    • A patch without AudioIn keeps an input-less process. Reference and sweep renders (render-faust) keep the G1-Emu test tone.
  • Scale.
    • Disting outputs already put Faust samples on the bus unchanged, so 1 V is G1 converter full scale.
    • The G1-Emu adapter's --input-sine drives the converters at −12 dBFS (0.25 of full scale), and AudioIn reads that as unit amplitude. So G1_PHYSICAL_INPUT_SCALE = 1 / G1_PHYSICAL_OUTPUT_SCALE = 4: AudioIn is 4 × input volts.
    • AudioIn → 2Output at level 127 therefore passes about 0.5 V/V, as on the G1.
    • Documented in docs/MODULE_COMPATIBILITY.md.
  • AudioIn model. Measured on G1-Emu across 6.9 Hz to 14 kHz stimuli:
    • AudioIn reads at 0.991 of unit gain.
    • It samples the input on a 48 kHz grid and holds each sample for two 96 kHz frames, on odd capture frames. RMS is unchanged and the fundamental falls as cos(πf/96 kHz).
    • Both the Faust export and the Python mirror model this. The hold applies only at the 96 kHz G1 rate.
  • Stimulus control.
    • render-faust and render-g1-reference take --input-sine-hz (default 220 Hz, unchanged).
    • The export now writes the tone frequency exactly. It was formatted with .1f, which turned 6.875 Hz into 6.9 Hz.
  • Catalog. AudioIn is marked reference-compared (13 modules now), with the catalog doc regenerated and the roadmap note updated.

Testing

  • python3 -m unittest discover -s tests: 150 OK.
  • tools/export_public.py into an empty directory: public tree verified.
  • Byte identity. Before the AudioIn model change, every module's baseline fixture produced a non-Disting Faust export identical to origin/main: 212 exports at 48 and 96 kHz, 0 diffs. The tests pin hashes for two AudioIn patches, so a Disting-only change can't alter calibration renders.
  • New tests:
    • Disting process signature and the ×4 scale.
    • A Faust compile reporting 2 inputs.
    • The input-less fallback for patches without AudioIn.
    • Exact tone-frequency export.
    • The AudioIn hold on odd frames and its gain.

AudioIn reference suite (private G1-Emu vs Faust, default tolerances, no widening). AudioIn has no parameters, inputs or note response, so its free variable is the converter stimulus:

Scenario Case Result
representative-midpoints 220/440 Hz test tone pass (rel 2.4%)
port-coverage output left, output right pass, pass
parameter-extremes stimulus 27.5 Hz, stimulus 7040 Hz pass, pass (7 kHz failed before the input-hold fix)
modulation 6.875 Hz sub-audio input on the audio path pass (rel 0.7%; failed at 13% before the exact-frequency fix)
midi-events note-on at 0.25 s, note-on at 0.5 s (input path undisturbed) pass, pass

Audition builds. Each is AudioIn → module → 2Output, with --reference-evidence. All twelve pass preflight-disting (ok) and build-disting, and validate-disting compiled 12/12:

  • AudioIn pass-through to 2Output, and to 1Output
  • FilterBank
  • Mixer(8)
  • Overdrive
  • OnOff
  • Delay
  • Shaper
  • LevMult
  • LevAdd
  • 1to2Fade
  • 2to1Fade

Nothing was copied to a device.

Impact Statement

  • Disting NT plug-ins built from patches with AudioIn now process real audio from two selectable bus inputs. Before, they played an internal test sine; patches with no source were silent.
  • The input level convention (1 V = converter full scale, AudioIn = 4 × volts) is fixed and documented. Typical ±5 V Eurorack audio is about 20× hotter than G1 full scale, so sources should be attenuated.
  • Reference renders of patches with AudioIn change slightly: the measured gain is 0.991 and the input is held on a 48 kHz grid at 96 kHz. Other patches are unchanged.
  • No cases, captures, ROM material, plug-in objects or local paths are included.
## Scope Map AudioIn to the Disting NT's audio inputs, bring AudioIn (2) to `reference-compared`, and build audition plug-ins for the reference-compared processors (the plug-ins and checklist stay private). - **Disting inputs.** - Each Disting build path (`build-disting`, `release-disting`, `validate-disting`) now exports a patch with AudioIn as `process(bus_in_left, bus_in_right) = left, right with { … }`. - `nt_arch.cpp` exposes these inputs as the plug-in's Input 1 and Input 2 bus parameters. - A patch without AudioIn keeps an input-less `process`. Reference and sweep renders (`render-faust`) keep the G1-Emu test tone. - **Scale.** - Disting outputs already put Faust samples on the bus unchanged, so 1 V is G1 converter full scale. - The G1-Emu adapter's `--input-sine` drives the converters at −12 dBFS (0.25 of full scale), and AudioIn reads that as unit amplitude. So `G1_PHYSICAL_INPUT_SCALE = 1 / G1_PHYSICAL_OUTPUT_SCALE = 4`: AudioIn is 4 × input volts. - AudioIn → 2Output at level 127 therefore passes about 0.5 V/V, as on the G1. - Documented in `docs/MODULE_COMPATIBILITY.md`. - **AudioIn model.** Measured on G1-Emu across 6.9 Hz to 14 kHz stimuli: - AudioIn reads at 0.991 of unit gain. - It samples the input on a 48 kHz grid and holds each sample for two 96 kHz frames, on odd capture frames. RMS is unchanged and the fundamental falls as cos(πf/96 kHz). - Both the Faust export and the Python mirror model this. The hold applies only at the 96 kHz G1 rate. - **Stimulus control.** - `render-faust` and `render-g1-reference` take `--input-sine-hz` (default 220 Hz, unchanged). - The export now writes the tone frequency exactly. It was formatted with `.1f`, which turned 6.875 Hz into 6.9 Hz. - **Catalog.** AudioIn is marked `reference-compared` (13 modules now), with the catalog doc regenerated and the roadmap note updated. ## Testing - `python3 -m unittest discover -s tests`: 150 OK. - `tools/export_public.py` into an empty directory: public tree verified. - **Byte identity.** Before the AudioIn model change, every module's baseline fixture produced a non-Disting Faust export identical to origin/main: 212 exports at 48 and 96 kHz, 0 diffs. The tests pin hashes for two AudioIn patches, so a Disting-only change can't alter calibration renders. - **New tests:** - Disting `process` signature and the ×4 scale. - A Faust compile reporting 2 inputs. - The input-less fallback for patches without AudioIn. - Exact tone-frequency export. - The AudioIn hold on odd frames and its gain. AudioIn reference suite (private G1-Emu vs Faust, default tolerances, no widening). AudioIn has no parameters, inputs or note response, so its free variable is the converter stimulus: | Scenario | Case | Result | |---|---|---| | representative-midpoints | 220/440 Hz test tone | pass (rel 2.4%) | | port-coverage | output left, output right | pass, pass | | parameter-extremes | stimulus 27.5 Hz, stimulus 7040 Hz | pass, pass (7 kHz failed before the input-hold fix) | | modulation | 6.875 Hz sub-audio input on the audio path | pass (rel 0.7%; failed at 13% before the exact-frequency fix) | | midi-events | note-on at 0.25 s, note-on at 0.5 s (input path undisturbed) | pass, pass | **Audition builds.** Each is AudioIn → module → 2Output, with `--reference-evidence`. All twelve pass `preflight-disting` (ok) and `build-disting`, and `validate-disting` compiled 12/12: - AudioIn pass-through to 2Output, and to 1Output - FilterBank - Mixer(8) - Overdrive - OnOff - Delay - Shaper - LevMult - LevAdd - 1to2Fade - 2to1Fade Nothing was copied to a device. ## Impact Statement - Disting NT plug-ins built from patches with AudioIn now process real audio from two selectable bus inputs. Before, they played an internal test sine; patches with no source were silent. - The input level convention (1 V = converter full scale, AudioIn = 4 × volts) is fixed and documented. Typical ±5 V Eurorack audio is about 20× hotter than G1 full scale, so sources should be attenuated. - Reference renders of patches with AudioIn change slightly: the measured gain is 0.991 and the input is held on a 48 kHz grid at 96 kHz. Other patches are unchanged. - No cases, captures, ROM material, plug-in objects or local paths are included.
peterswimm deleted branch disting-audio-inputs 2026-10-22 03:52:39 +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!14
No description provided.