I’ve got it working, and I’m adding this separate reply because the methods of communication between SPI and TD aren’t obvious.
To drag values from a CHOP to variables in TD, you activate the CHOP’s viewer by clicking the little plus-sign flag in its lower right corner. Mousing over the chop then turns the cursor to a caret. Drag this caret on top of the node you want to control, and the caret turns into an arrow, then the target nodes data viewer appears in the upper right. Now drag the arrow cursor over to the data view and drop it on top of the variable you want to control. A menu will appear, and your best choice until you know better is “Export CHOP.”
SPI’s osc works fine, just make sure that your channel names are correct. Since the names are strings, you need quotes around them in SPI, and also a stroke character, which apparently doesn’t get displayed in TD.
MIDI also works fine, the difference from OSC being that MIDI doesn’t have named channels, and the data via MIDI is restricted to 0-127, being communicated by the velocity parameter.
Here are the notes I made for myself:
MIDI into TD on MacOS
To add an IAC bus where SPI will send the MIDI, do:
- Dialogs > MIDI Device Mapper > Create New Mapping
- select an IAC Driver Bus from the dropdown under “In Device”
CHOPS required: MIDI In ==> Select ==> Math ==> [your target]
Comments I’ve seen refer to putting a Null CHOP between the Select and Math, but it seems to work without that, so I don’t yet know what functionality a Null provides.
The MIDI In CHOP will receive all the MIDI coming in from all the In Devices in the MIDI Device Mapper, so you need the Select to grab what you want to direct to your target. I.e., you have one MIDI In and many Selects.
The MIDI note–actually, the note/channel combination–is effectively a channel in TouchDesigner, e.g. “ch1n61” is a Channel Name in a Select. For convenience, a list of channel names that the Select CHOP has already received accumulates in the Select’s dropdown at Channel Names in the Select’s Select tab. You can also manually enter channel names.
MIDI velocity is the data to send to your target, and is only ever in the range 0-1 in increments of 1/128. You need a
Math CHOP to scale the data per your target’s requirements.
BEWARE: TouchDesigner adds 1 to the MIDI note number.