Learn control (MIDI/OSC learn)
learn_controlTake a snapshot of all input channels, then wiggle a hardware control to auto-bind its channel to a parameter with scale and offset.
Instructions
EXPERIMENTAL two-step 'MIDI learn'. Call once with mode:'snapshot' (controls at rest) to record every channel of an input CHOP (a midiin/oscin CHOP or a Null fed by one); then wiggle one hardware knob/fader and call again with mode:'bind' — it diffs against the snapshot, finds the channel that moved the most, and binds your target parameter to it by expression (with optional scale/offset). The snapshot is kept in the parent COMP's storage between the two calls. This is live/stateful: verify the matched channel in the report.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | snapshot: record the current value of every channel of source_chop. bind: re-read source_chop, find the channel that moved the most since the snapshot, and bind target to it. Call snapshot first (controls at rest), wiggle one hardware control, then call bind. | |
| source_chop | Yes | Absolute path of the input CHOP carrying the hardware controls (e.g. a midiin/oscin CHOP or a Null fed by one). | |
| target | No | Parameter to drive, written as 'nodePath.parName' (e.g. '/project1/sys/transform1.scale'). Required for mode:'bind'; switched to expression mode so it tracks the matched channel live. | |
| scale | No | Multiply the matched channel value (mapping gain). | |
| offset | No | Add to the scaled value (mapping offset). | |
| min_delta | No | mode:'bind' minimum NORMALIZED movement (default 0.05). The winning channel's delta is normalized by max(|old|, |new|, epsilon) — a unit-free relative change — so a 0–127 MIDI CC and a 0–1 OSC float compare fairly. If the top channel moved less than this, nothing is bound and you're told to wiggle the control harder. Raise it to reject controller jitter; lower it for very small/slow knobs. | |
| parent_path | No | COMP whose storage persists the snapshot between the snapshot and bind calls (defaults to /project1). | /project1 |