touchdesigner: expose scalar value-port inputs as parameters#135
Closed
jcelerier wants to merge 1 commit into
Closed
touchdesigner: expose scalar value-port inputs as parameters#135jcelerier wants to merge 1 commit into
jcelerier wants to merge 1 commit into
Conversation
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
Member
Author
|
Superseded by #137, which combines all outstanding work into a single PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by the golden differential (#134): audio effects had no adjustable controls in TouchDesigner.
Cause
An input like an effect's amount —
int valuewith a range but no widget — is a value-port (avnd::value_port = parameter_port && !control_port). The TD binding built its parameters fromcontrol_input_introspection(widget controls only), so value-ports were silently dropped. Minimal'sGrunge, Presets'Preamp/Volume, the per-sampleGain, etc. simply weren't parameters — you couldn't set them, and the effect always ran with the default.Fix
parameter_setupnow also walksparameter_input_introspectionand creates a TD parameter for every scalar value-port (arithmetic / enum / string); the matchingparameter_updatereads them back into the object each cook. Additive and safe:value_portexcludescontrol_port, so no double-append),Result
With the controls settable,
Minimal/Presets/PerSampleProcessor{,2}/ZeroDependencyAudioEffectwent from MISMATCH to matching the raw-C++ golden oracle (overall differential match 46 → 50).🤖 Generated with Claude Code