aud_midi_core
Runtime contracts of the aud_midi family: backend interfaces, a fake backend, the software scheduler, the port registry and diagnostics.
Part of the aud_midi family, see aud_midi.
Goals
- MidiBackend, advertiser and BLE transport interfaces
- FakeMidiBackend for tests
- Software scheduler with the send contract
- Port registry and diagnostics bus
- No dart:io, dart:ffi or dart:isolate
State
Implemented; every file is covered 100 % by its own tests on the Dart VM, and the pure-Dart tests also pass in Chrome (dart test -p chrome test/clock test/engine test/fake test/backend test/ble test/error).
- Contracts:
MidiBackendwith virtual port, Bluetooth and network sub-APIs,MidiBackendHost,MidiServiceAdvertiser,MidiBleTransport,MidiException. - Clock:
MidiSystemClock(Timeline.nowon the VM,performance.now()in the browser),MidiClockMapper, andMidiFakeClockwithMidiFakeTimersfor tests. MidiEnginehosts one backend in the current isolate: per input a MIDI 1.0 parser or UMP decoder, JR timestamps as sender time, optional translation, bounded queues with overflow diagnostics; per output translation to the port's protocol, encoding, scheduling by the operating system or the software scheduler (with a lookahead for ports that cannot discard),cancelPendingand panic; port registry with re-plug candidates and devices; diagnostics bus; a fixed shutdown order.MidiCompositeBackendcombines backends,MidiBleBluetoothBackendruns BLE-MIDI over a GATT client.FakeMidiBackendwith loopback, hotplug, failures and in-memory virtual ports, BLE and network sessions. The contract tests run against it: they prove the Dart abstraction, not a native binding.
See the plan in aud_midi_pm.
Installation
dart pub add aud_midi_core
Contributing
Libraries
- aud_midi_core
- The runtime contracts of the aud_midi family: backend interfaces, the package clock, the engine that hosts a backend, scheduling, the port registry, diagnostics and a fake backend for tests.