Bug 252188 - audio/pd: Add MIDI support via PortMIDI and sndio
Summary: audio/pd: Add MIDI support via PortMIDI and sndio
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2020-12-27 06:32 UTC by Timothy Beyer
Modified: 2020-12-27 07:29 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (brittlehaus)


Attachments
audio_pd.diff (24.69 KB, patch)
2020-12-27 06:32 UTC, Timothy Beyer
koobs: maintainer-approval? (brittlehaus)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Beyer 2020-12-27 06:32:51 UTC
Created attachment 220980 [details]
audio_pd.diff

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:
http://openbsd-archive.7691.n7.nabble.com/audio-portmidi-input-td363848.html
https://marc.info/?l=openbsd-ports&m=155221816900336&w=2

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...
Comment 1 Timothy Beyer 2020-12-27 07:21:12 UTC
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.
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2020-12-27 07:29:20 UTC
Thank you for the report and patch Timothy

^Triage: [tags] in issue Titles are deprecated