Expand description
USB-MIDI transport for Oscyl synth drivers.
candidates picks the ports any registered driver (DRIVERS)
claims; a Device drives one synth’s driver session over a Link:
MidirLink for a real synth on desktop (feature midir: ALSA on Linux, CoreMIDI on macOS, WinMM on Windows;
input arrives through midir’s callback as byte chunks and is framed into
SysEx messages), PushLink on platforms that move the bytes
themselves (Android, iOS), or SimLink for a simulated one. One
thread can serve several devices at once.
Modules§
- hotplug
- Notice synths being plugged in or unplugged, from ALSA sequencer
announcements (event-driven: the caller polls the file descriptors from
its own main loop and calls
PortWatcher::drain_changeswhen they are ready). - logue
- The logue family’s own operations (user units, global and tuning
data), which the driver contract does not model, for every logue
driver: the minilogue xd and the prologue. A
Deviceruns them between its driver session’s ops, pumped like them.
Structs§
- Candidate
- A port whose name matches a driver’s hint; not yet confirmed by the
device inquiry (
crate::Device::opendoes that). - Device
- An open connection to one synth, through its driver’s session.
- Input
Sender - The input end of a
PushLink: the platform pushes received bytes (in any fragments) and closes it when the port goes away. - Midir
Link - The real synth over midir (ALSA on Linux).
- Opening
- A synth being opened: the device inquiry is out, the answer awaited
without blocking (
Opening::pollfrom a pumping loop). - Push
Link - Output through a closure; input pushed by the platform through the
paired
InputSenderand framed into SysEx messages here. - SimLink
- The simulated synth. Replies are computed when a message is sent and queued; receiving never waits.
Enums§
Statics§
- DRIVERS
- Every driver this transport can find synths for.
Traits§
- Link
- A bidirectional SysEx connection to a synth.
Functions§
- candidates
- Every (port, driver) pair where the port’s name contains one of the driver’s hints, in port order.
- driver
- The registered driver with this
oscyl_driver::Info::id. - list_
ports - Names of all MIDI input and output ports, for diagnostics.
- port_
label - A port’s name as Oscyl spells it on every platform. Windows’ class
driver names a device’s later ports “MIDIIN2 (minilogue xd)” and
“MIDIOUT2 (minilogue xd)”; both become “minilogue xd _ MIDI 2”, the
name such a port gets on Android (the mobile app’s
midiPortName), so the input and output pair up and the drivers’ hints match. - run_all
- Run every device’s queued ops at once in this thread, interleaved, until
all are idle.
on_eventgets each event with its device’s index. The results hold transport errors per device (such a device stops; cancel it); op failures areSessionEvent::Failedevents. - scan
- Candidates among the connected ports that are both an input and an output.
- wait
- Block until
bellrings oruntilpasses (None: until it rings). Rings that piled up meanwhile are drained: their input is already queued for the next pump. Keep a sender ofbellalive, or aNonewait returns at once.