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
Created attachment 226899 [details]
Updated patch against most recent version of audio/pd, fix build on FreeBSD 13 (which is also needed on the most recent version of audio/pd), make it closer to audio/pd without getting rid of improved features like NLS support and fixes for portlint warnings
A more conservative patch will be provided in another PR which just fixes the FreeBSD 13 build, adds proper NLS support, gets rid of portlint warnings, but without MIDI support.
This patch at present provides all of those features in addition to adding support for MIDI devices.
Hi, I'm a maintainer of Mixxx DJ software which also uses PortMidi. I recently forked this unmaintained old library to rewrite its really hacky old CMake build system with modern CMake and clean up the repository: https://github.com/mixxxdj/portmidi
It would be great to merge your patches for PortMidi upstream and use that rather than this vendored copy in pd. I would be happy to review pull requests for the repository I linked above.
(In reply to Be from comment #4)
I agree, as later versions use upstreamed portmidi, and a I made a PR for the official audio/portmidi, which isn't used by this version.
I want to update to the latest version of pd soonish, so when I switch to that, I'll use the upstreamed portmidi, or better yet, your version with the improved cmake build system.
If you have any suggestions, or improved patches on this port that I submitted last year, I'm open to switching it to use your repository: