onMidiDataReceived property
Stream firing events whenever a midi package is received.
The event contains the raw bytes contained in the MIDI package.
Implementation
@override
Stream<MidiPacket>? get onMidiDataReceived {
// print("get on midi data");
_rxStream ??= _rxChannel.receiveBroadcastStream().map<MidiPacket>((d) {
var dd = d["device"];
// print("device data $dd");
var device = MidiDevice(
dd['id'], dd["name"], dd["type"], dd["connected"] == "true");
return MidiPacket(Uint8List.fromList(List<int>.from(d["data"])),
d["timestamp"] as int, device);
});
return _rxStream;
}