InvisibleWrench / FlutterMidiCommand

A Flutter plugin to send and receive MIDI
BSD 3-Clause "New" or "Revised" License
90 stars 46 forks source link

Add an option to receive the raw MIDI packets as received from the device without buffering #111

Open intonarumori opened 3 months ago

intonarumori commented 3 months ago

I have a use case where I need access to the raw MIDI packets sent by a MIDI device. Specifically I’d like to circumvent the part of the platform code where the library buffers data to wait for every part of a SysEx transfer to be received first before forwarding it to Flutter.

I'm working with samplers from the `80s where not all parts of the MIDI specifications was formalized, so it's crucial to be able to access incoming data without any buffering.

I've implemented a solution with the following goals in mind:

I've implemented this by modifying the platform interface and added the platfrom specific implementation for iOS here: https://github.com/InvisibleWrench/FlutterMidiCommand/pull/110 https://github.com/InvisibleWrench/flutter_midi_command_platform_interface/pull/2

Let me know what you think, thanks.

mortenboye commented 3 months ago

I can appreciate this use case. Just curious, do you intent to handle all midi parsing on your own for all communication or only for SysEx and maybe only sometimes?

The PR contains a bunch of port handling as well. Is that related to your other ticket?