llloret / osmid

osmid is a tool to bridge MIDI and OSC. It is currently in use in Sonic Pi
Other
72 stars 12 forks source link

Linux Midi port names #41

Closed ngradwohl closed 7 years ago

ngradwohl commented 7 years ago

On a linux system the alsa midi port names are prefixed by the device name and conain a ":", which is not allowed by the regex in OscInProcessor::ProcessMessage it works when the regex gets changed to

regex addressRegex("/(([[:alnum:]]|\\:|\\s|\\*)+)/(([[:alnum:]]|_)+)");

llloret commented 7 years ago

Hi, thanks for reporting. I'm not sure what the problem is exactly, since things seem to work on Linux. Can you provide some more info, and I'll have a look?

Thank you again.

The project is very young still, so having people like you using it and reporting problems is really great!

ngradwohl commented 7 years ago

on a linux system using alsa 'o2m -l" reports the midi port names in the format ": '

for example on my box my launchpad mini gets reported as

...
   (23): Launchpad Mini: Launchpad Mini MIDI 1
  ... 

so when I send a note on osc message using sonic pi it works if I send it to all devices with /*/note_off But since I have a lot of midi devices connected to my box I want to send the messages to a specific port. Unfortunately this results in a osc message like "/Launchpad Mini: Launchpad Mini MIDI 1/note_on" which results in an address unknown error because the regex rejects the ":"

so it can be fixed by adding \\: to the addressRegex in OscInProcessor like shown above

llloret commented 7 years ago

Hi, @ngradwohl, I have committed your proposed fix to master. Can you confirm that master works ok for you now?

Thanks, Luis

ngradwohl commented 7 years ago

Hi, yes works - thanks!