Skip to content

touchdesigner: expose scalar value-port inputs as parameters#135

Closed
jcelerier wants to merge 1 commit into
mainfrom
fix/td-value-port-params
Closed

touchdesigner: expose scalar value-port inputs as parameters#135
jcelerier wants to merge 1 commit into
mainfrom
fix/td-value-port-params

Conversation

@jcelerier

Copy link
Copy Markdown
Member

Found by the golden differential (#134): audio effects had no adjustable controls in TouchDesigner.

Cause

An input like an effect's amount — int value with a range but no widget — is a value-port (avnd::value_port = parameter_port && !control_port). The TD binding built its parameters from control_input_introspection (widget controls only), so value-ports were silently dropped. Minimal's Grunge, Presets' Preamp/Volume, the per-sample Gain, etc. simply weren't parameters — you couldn't set them, and the effect always ran with the default.

Fix

parameter_setup now also walks parameter_input_introspection and creates a TD parameter for every scalar value-port (arithmetic / enum / string); the matching parameter_update reads them back into the object each cook. Additive and safe:

  • widget controls are untouched (value_port excludes control_port, so no double-append),
  • aggregate value-ports (vectors/maps/…) are skipped — TD has no parameter kind for those.

Result

With the controls settable, Minimal / Presets / PerSampleProcessor{,2} / ZeroDependencyAudioEffect went from MISMATCH to matching the raw-C++ golden oracle (overall differential match 46 → 50).

🤖 Generated with Claude Code

An input like an audio effect's amount (`int value` + a range but no widget) is a
value-port -- avnd::value_port = parameter_port && !control_port. The TD binding
built its parameters from control_input_introspection (widget controls only), so
value-ports were silently dropped: audio effects (Minimal's Grunge, Presets'
Preamp/Volume, the per-sample Gain, ...) had NO adjustable controls in TD, and
their output could never match anything but the default.

parameter_setup now also walks parameter_input_introspection and creates a TD
parameter for every scalar value-port (arithmetic / enum / string); the matching
parameter_update reads them back into the object each cook. Widget controls are
unchanged (value_port excludes control_port, so no double-append), and aggregate
value-ports (vectors/maps/...) are skipped -- TD has no parameter for those.

Found via the golden differential (feature/td-golden-differential): with the
controls now settable, Minimal / Presets / PerSampleProcessor{,2} /
ZeroDependencyAudioEffect went from MISMATCH to matching the raw-C++ oracle
(overall match 46 -> 50).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011s7huWR2wFsLFiMJPjx1z2
@jcelerier

Copy link
Copy Markdown
Member Author

Superseded by #137, which combines all outstanding work into a single PR.

@jcelerier jcelerier closed this Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant