Ports
The IO helpers for declaring a device's plugs.Ports are declared in describe with m.addPort(...). A device may declare any number
of each kind.
| Helper | Handle | Kind |
|---|---|---|
audioIn(label, channels) | audio-in | Audio input |
sidechainIn(label, channels) | audio-in-sidechain | Sidechain input |
audioOut(label, channels) | audio-out | Audio output |
midiIn(label) | midi-in | MIDI input |
midiOut(label) | midi-out | MIDI output |
modulationOut(label) | modulation-out, then modulation-out-1, ... | Modulation source (up to 8 per node) |
m.addPort(audioIn("In", 2));
m.addPort(sidechainIn("SC", 2));
m.addPort(audioOut("Out", 2));
m.addPort(midiOut("MIDI"));The host builds the buses and wire handles from the manifest, exactly like a plugin's dynamic buses, so the ports just route.
Reading and writing
- Audio:
ctx.input(ch, i)andctx.output(ch, i, v). A sidechain's channels follow the main input's. Loop overctx.inChannels(). - MIDI:
ctx.midiInCount()/ctx.midiInByte(...)to read,ctx.emitMidi(...)to send. See the device API. - Modulation:
ctx.modOut(i, value)writes the primary modulation output;ctx.modOutAt(out, i, value)writes outputout(declaration order, 0 = the primary) on a multi-output device. See Be a modulation source.