SamplerBox icon indicating copy to clipboard operation
SamplerBox copied to clipboard

Various improvements

Open mojca opened this issue 1 year ago • 0 comments

This pull requests includes various changes that I couldn't easily split into individual pull requests as they would conflict with each other, but I would be more than happy to isolate some changes out and remove others.

The changes currently include

  • switching to python-rtmidi (covered by #43)
  • allow configuration of multiple serial ports (I found that useful when receiving MIDI messages over USB; RPi sometimes mounts the USB to 0 and sometimes to 1, for example; it might also be useful on Windows where COM ports get assigned semi-randomly)
  • introduce proper logging (that can easily be redirected to a file instead of just stdout), also log midi messages being received
  • make the code compatible with python 3

What's still missing:

  • updated README and image building script to actually switch to python 3 (not too important, the code works with python 2.7 anyway)
  • I'm not sure about some of the replacements patterns (the existing ones don't work for me in Python 3)
  • I would like to read settings from a config file and/or command-line parameters rather than having to modify the script itself
  • basic error handling for cases when the ALSA library fails

What I'm puzzled about:

  • The source code says "see hack in /boot/cmline.txt: 38400 is 31250 baud for MIDI!", but there's no /boot/cmline.txt anywhere and the baud rate was in fact 38400, not 31250 as claimed. Since we control the midi source, we just switched the baud rate to 115200 on both sides. When sending MIDI messages at 31250 we had tons of strange issues, with midi messaged being misinterpreted at times (while working at other times).

mojca avatar Aug 06 '22 09:08 mojca