Multiport
Multi-timbral instrument with two MIDI input ports: the host routes a separate track to each port, and each port plays its own independently shaped sound (port 0 defaults to a sine pad, port 1 to a saw lead) from a single instance.
Source: examples/truce-example-multiport/.
#What it demonstrates
- Multiple MIDI input ports (
midi_input_ports = 2intruce.toml); VST3 event buses and CLAP note ports carry the port, other formats clamp to one - Reading
event.portto key voices by(port, channel, note)and select the per-port patch - Nested parameter structs with
#[nested(base = 0)]/#[nested(base = 4)]for stable flattened param ids - Sample-accurate event handling: draining
events.get(next)againstsample_offsetinside the render loop - Block-rate smoothed reads with
read_after(n)and voice stealing that prefers releasing voices ProcessStatus::Tail(0)when all voices are silent, plusEvent::on_portin tests
#Parameters
| Name | Range | Unit | Description |
|---|---|---|---|
| P0 Wave | Sine, Saw, Square, Triangle | -- | Port 0 oscillator waveform (default Sine) |
| P0 Cutoff | 0 to 1 | % | Port 0 one-pole low-pass cutoff |
| P0 Release | 0.01 to 4 | s | Port 0 release time |
| P0 Volume | -60 to 6 | dB | Port 0 lane volume |
| P1 Wave | Sine, Saw, Square, Triangle | -- | Port 1 oscillator waveform (default Saw) |
| P1 Cutoff | 0 to 1 | % | Port 1 one-pole low-pass cutoff |
| P1 Release | 0.01 to 4 | s | Port 1 release time |
| P1 Volume | -60 to 6 | dB | Port 1 lane volume |