InvisibleWrench / FlutterMidiCommand

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

Linux platform support #28

Closed maks closed 3 years ago

maks commented 3 years ago

Thank you for this excellent plugin!

It would be nice to add Linux support now that Flutter Desktop is available in beta channel and even a snapshot on stable.

Going by this answer RtMidi and PortMidi seem to be the 2 choices on Linux, with RtMidi looking to be fairly simple to bind to and somewhat maintained.

And looking at prior art in the NodeJS ecosystem, it looks like the node module uses RtMidi so that maybe the better way to go and follow a well worn path.

Also according to its docs this also requires asound-dev package, since I guess RtMidi needs ALSA headers to compile on Linux.

EDIT: turns out (of course) there is more than 1 midi node module, this one seems to just use ALSA directly on Linux.

mortenboye commented 3 years ago

Linux support is on the way. It will be a direct link to ALSA using FFI. No external dependencies aside from ALSA

maks commented 3 years ago

Brilliant! thanks @mortenboye you've just made my day!

Sounds actually like a much better approach than I was suggesting with RtMidi to use FFI with asound directly as it avoids the issue I'm facing with another desktop package I'm working on, of how to setup building a library within a package or shipping prebuilt lib binaries for every platform.

Please let me know if I can help in anyway. I've got a few different controllers (Korg Nanokey studio, Novation launchpad mk2 and soon Akai fire) and I'm keen especially to use this for a tricky usecase of sending sysex messages to the Akai fire from a RPI.

mortenboye commented 3 years ago

@maks v0.3.1 is up now, with linux support.

maks commented 3 years ago

Thank you @mortenboye this is brillant!! I'll start trying it out. And I see you've added nullsafety support in this release too! 🎉