sonic-pi-net / sonic-pi

Code. Music. Live.
https://sonic-pi.net
Other
10.77k stars 922 forks source link

anomolous behaviour for midi_sysex on Linux versions of Sonic Pi #3335

Open rbnpi opened 12 months ago

rbnpi commented 12 months ago

midi_sysex commands do not appear to be sent when running SP4.4 on linux (/raspberry-pi and debian 12 checked)

The midi string appears to be blocked, and to release it you need to follow the command with another midi command (I used midi_note_off, but also tried with a midi_cc command) and then it works. Tested by sending to a midi monitor snoopmidi

The program below worked

Operation on Mac and Windows PC worked as expected without the extra midi_note_off

use_real_time
use_midi_defaults port: "midisnoop_midi_input_130_0",channel: 1
midi_sysex 240, 146, 12, 12, 146, 12, 12, 146, 12, 12, 146, 12, 247
sleep 0.001
midi_note_off 8 # this bodge extra midi command needs to be present for it to work
samaaron commented 12 months ago

Hi there,

this is odd. However, if it's working just fine on Windows and macOS but not Linux - then that's likely to be an issue with either the rtMIDI implementation on Linux or whatever rtMIDI is using in Linux-land to actually send the MIDI out. I'm not sure this is anything we can directly address within Sonic Pi itself.

However, I have seen that there is a more recent rtMIDI release, so it might make sense to try building a version with that new release.

rbnpi commented 12 months ago

I've substituted RtMidi.cpp and RtMidi.h files for those from version 6.0 and rebuilt but no change. AFAICS the changes in RtMidi are mainly the addition of Android support. However, there are issues with long SysEx messages mentioned, so it looks as if it is an area than can give problems. However my tests were with relatively short messages.

samaaron commented 12 months ago

Ah, that's a real shame. Thanks for trying this though. Perhaps it's worth raising the issue with them and see what they say?