plugdata-team / plugdata

Pure Data as a plugin, with a new GUI
https://plugdata.org
GNU General Public License v3.0
1.58k stars 67 forks source link

MPE output gets mangled #1916

Open spDuchamp opened 1 month ago

spDuchamp commented 1 month ago

If you wire raw [midiin] to raw [midiout] and stream MPE data through, it will work in Puredata, but the MPE output is mangled when attempting this with Plugdata. demo: https://www.youtube.com/watch?v=E-ccaMuc68k

The MidiDeviceManager uses sendMessageNow, but I think that sendBlockOfMessagesNow might be required to handle MPE data.

timothyschoen commented 3 weeks ago

I'm now using sendBlockOfMessagesNow, along with a few other fixes that I think might help.

Could you try out this build when it's done compiling?

https://github.com/plugdata-team/plugdata/actions/runs/11639118413

spDuchamp commented 2 weeks ago

I had a little trouble testing that version. When I go into Settings->MIDI and try to enable the "from plugdata" output, that setting doesn't seem to work, and is disabled when I reopen those settings. That output is what I'm able to monitor using the ShowMIDI tool. (https://github.com/gbevin/ShowMIDI)

So for these tests I used MidiView (https://hautetechnique.com/midi/midiview/) and was able to specify MidiView as an output, and it appears that data is being dropped. Here is a screenshot from MidiView, and you can see white log lines from the iPad (MusiKraken doing a one note bend), and you can see grey lines that are being sent from Plugdata direct into MidiView.

Screenshot 2024-11-05 at 3 22 13 PM

Pitch wheel and Channel pressure come through, but are detached from notes. This is pretty consistent with the problems I've been seeing.

To compare, here is the MidiView log with the same pass through [midiin] wired to [midiout] patch running in vanilla Pd.

Screenshot 2024-11-05 at 3 35 52 PM
spDuchamp commented 2 weeks ago

I've been looking around trying to find an example of JUCE code doing MPE output and not finding a lot.

Here is one example I can find on sending MPE output. https://github.com/gbevin/SendMIDI/blob/master/Source/MpeTestScenario.cpp and in that example data is sent ultimately using sendMessageNow.

I may have lead you in the wrong direction with that sendBlockOfMessagesNow suggestion.

I'm just really not sure what exactly Geert's code is doing that makes the MPE work.