Created attachment 220980 [details]
I added MIDI support to the current version of audio/pd using the included in-tree version of PortMIDI. I disabled JACK support for now since I couldn't verify if it served any purpose, but I don't really mind if the maintainer wants to keep it on by default. I must admit that I haven't had a chance to test the JACK option yet, so maybe it should be enabled as well. I just know that the port, including PortMIDI support should fully work either with the JACK option disabled or enabled.
this patch is in a large part derived from Raphael Graf's
patches for a sndio backend on the OpenBSD audio/portmidi port, enhanced to
detect a variable number of MIDI (umidi) devices:
I was able to add support for 9999 MIDI inputs, although more work needs to be done to get MIDI outputs working. I can submit a patch for that soon.
I have compiled and tested this port heavily on multiple FreeBSD 12.0 and 12.1 RELEASE systems, and I have used this patched version extensively with numerous MIDI input devices (see below; input only tested so far, since I haven't implemented MIDI output support in audio/pd yet).
As noted above, I've tested PortMIDI on FreeBSD with the following MIDI devices:
* Roger Linn LinnStrument
* Hornberg Research hb1 breath controller
* Keith McMillen Instruments SoftStep 2 foot controller
* Keith McMillen Instruments QuNeo
* Roland GR-55 Guitar Synthesizer (MIDI output only on foot pedal, USB MIDI output requires a special driver)
* Evolution U-Control UC-33e
* Behringer FCB1010 Foot Controller
* Yamaha PSR-280 keyboard
My apologies for sitting on this patch since July, I just haven't had enough opportunity to test it until recently...
Note that I was able to test all of these MIDI devices at once, using a few USB MIDI interfaces. Since it was so many devices that I didn't have enough USB ports or USB MIDI interfaces for each device individually, mostly for older devices lacking a USB port, I used a Kenton MERGE-8 which in turn was associated with a single USB MIDI device to verify if it handled several devices on one UMIDI device correctly, which also works.
As far as I can tell, PureData should also work correctly in the much more common case of lacking any MIDI devices. It currently doesn't detect devices by their name (but rather by number, which could be a bit more intuitive), which is a limitation that I intend to address at some point, but as long as it is plugged in before starting pd, then it should be correctly detected.
I have also experimented with midithru devices created by midicat (part of audio/sndio), so that works in audio/pd as well.
Thank you for the report and patch Timothy
^Triage: [tags] in issue Titles are deprecated