mungewell / zoom-zt2

Python script to install/remove effects from the Zoom G1Four pedal
MIT License
50 stars 10 forks source link

mido error #42

Closed Colatino closed 2 years ago

Colatino commented 2 years ago

While trying to run the zoomzt2-gui.py i'm getting the following:

input_names = rtmidi.MidiIn().ports File "rtmidi_python.pyx", line 72, in rtmidi_python.MidiIn.cinit (rtmidi_python.cpp:1487) TypeError: expected bytes, str found

To "fix" I commented line 160 from zoomzt2.py and changed line 161:

160    #mido.set_backend('mido.backends.rtmidi_python')
161    midiname='ZOOM G'

The error vanished and the GUI worked as expected

Running windows 11, python 3.10, mido 1.2.10

mungewell commented 2 years ago

Again, Thanks. This might also be fixed by pre-pending the string with a "b" (like b'mido.backends.rtmidi_python').

I'll have to check how old the Mido is on my machine, and see if there's any reason I can't update...

Colatino commented 2 years ago

Again, Thanks. This might also be fixed by pre-pending the string with a "b" (like b'mido.backends.rtmidi_python').

I'll have to check how old the Mido is on my machine, and see if there's any reason I can't update...

mido.set_backend(b'mido.backends.rtmidi_python')
midiname = b"ZOOM G"

Changed to the above and had the issue again

mungewell commented 2 years ago

Always a pain rebuilding a Windows system, I can't get pip install rtmidi to work, how/what did you install?

I have the others as:

Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
wx 4.1.2a1
mido 1.2.10
constuct 2.10.68
Traceback (most recent call last):
  File "C:\Users\simon\Downloads\zoom-zt2-master-20220517\zoom-zt2-master\versions.py", line 11, in <module>
    import rtmidi; print("rtmidi", rtmidi.__version__)
ModuleNotFoundError: No module named 'rtmidi'
C:\Users\simon\Downloads\construct-master-20220518\construct-master>"c:\Program Files\Python\Python310\python.exe" -m pip install rtmidi
Collecting rtmidi
  Downloading rtmidi-2.3.4.tar.gz (51 kB)
     ---------------------------------------- 51.7/51.7 kB 1.3 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: rtmidi
  Building wheel for rtmidi (setup.py) ... error
Colatino commented 2 years ago

Try pip install rtmidi-python

But I remember having some issues with pip installation, I ended up installing with Method 2 as sugested in this page https://www.geeksforgeeks.org/how-to-install-python3-rtmidi-in-windows/

mungewell commented 2 years ago

I was able to get python-rtmidi installed and could duplicate the bug (and fix).

These are the versions I have...

Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
wx 4.1.2a1
mido 1.2.10
constuct 2.10.68
rtmidi 1.4.9

Note: I had to force construct NOT to build an Egg in-order to use it in the prebuilt binaries.

c:\Users\simon\Downloads\construct-master-20220518\construct-master>"c:\Program Files\Python\Python310\python.exe" setup.py install  --single-version-externally-managed --root=/
mungewell commented 2 years ago

Fixed.