Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8026

Troubleshooting • USB MIDI Hub (Host for multiple MIDI devices)

$
0
0
I know the Pi can easily act as a MIDI host and connect multiple devices together - this is easy to achieve using aconnect.
The Git repo here https://github.com/gdsports/rpi-usb-host-midi-hub causes me problems and the main problem lies in the automatic detection of attached MIDI devices resulting in a Python error.
Here is part of the script which gets the aconnect output and searches for the attached devices:

for line in os_system("/usr/bin/aconnect -l -o"):
client=re.search("client (\d*)\:", line)
if client and not re.search("Through", line):

This'd and perhaps other parts of the script at https://github.com/gdsports/rpi-usb-hos ... connect.py throw the error:
TypeError: cannot use a string pattern on a bytes-like object

I have tried to modify the python script to cast the vale back into something that can be searched but my Python scripting is not up to the task. Here is what I tried:
client=re.search("client (\d*)\:", line).code('utf-8')

No good!

Can somebody with better Python skills have a look at https://github.com/gdsports/rpi-usb-hos ... connect.py and suggest corrections to get it working?

Thanks!

Statistics: Posted by TeaTimeSoon — Wed Mar 27, 2024 2:09 pm



Viewing all articles
Browse latest Browse all 8026

Trending Articles