Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run edrumulus_gui.py on Windows #115

Closed
thijstriemstra opened this issue Nov 8, 2023 · 19 comments
Closed

Unable to run edrumulus_gui.py on Windows #115

thijstriemstra opened this issue Nov 8, 2023 · 19 comments

Comments

@thijstriemstra
Copy link
Contributor

thijstriemstra commented Nov 8, 2023

OS: Win10
Python: 3.10
Shell: Git bash
Controller: ESP32

After following the manual and installing Python packages I tried running edrumulus_gui.py using:

tools/edrumulus_gui.py rtmidi

which results in:

/usr/bin/env: ‘python3’: No such file or directory

I would suggest using this in the docs instead:

python tools/edrumulus_gui.py rtmidi

but it results in:

Redirection is not supported.

Any idea?

@thijstriemstra
Copy link
Contributor Author

thijstriemstra commented Nov 8, 2023

If I use Powershell instead:

Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import rtmidi
>>> rtmidi.API_WINDOWS_MM in rtmidi.get_compiled_api()
True
>>> midiout = rtmidi.MidiOut()
>>> midiout.get_ports()
['Microsoft GS Wavetable Synth 0']

so rtmidi works.

Running:

 python .\tools\edrumulus_gui.py rtmidi

I get this error instead:

Traceback (most recent call last):
  File "C:\Users\foo\projects\edrumulus\edrumulus\tools\edrumulus_gui.py", line 593, in <module>
    midiin, port_name_in   = open_midiinput([s for s in rtmidi.MidiIn().get_ports() if in_name in s][0], client_name="EdrumulusGUI")
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\foo\projects\edrumulus\edrumulus\tools\edrumulus_gui.py", line 597, in <module>
    raise Exception("No Teensy Edrumulus device found")
Exception: No Teensy Edrumulus device found

But I'm using an ESP32 though.. I haven't compiled and updated the code on the esp32 yet, but the error is confusing since I'm not using a Teensy, so opened #116

Running:

 python tools\edrumulus_gui.py

results in:

Traceback (most recent call last):
  File "C:\Users\foo\projects\edrumulus\edrumulus\tools\edrumulus_gui.py", line 40, in <module>
    import jack
ModuleNotFoundError: No module named 'jack'

@corrados
Copy link
Owner

corrados commented Nov 8, 2023

Did you run loopMIDI and HairlessMIDI before you started edrumulus_gui? See #16 (reply in thread)

@corrados
Copy link
Owner

corrados commented Nov 8, 2023

@corrados
Copy link
Owner

corrados commented Nov 8, 2023

Also checkout the comment here: https://github.com/corrados/edrumulus/blob/main/doc/manual.md#edrumulus-user-manual

"Python to control Edrumulus trigger parameters in real-time.
Install the Python PIP packages python-rtmidi and windows-curses."

Did you install these Python packages?

@corrados
Copy link
Owner

corrados commented Nov 8, 2023

If I use Powershell instead:

For me edrumulus_gui worked fine under Windows in a normal CMD shell (i.e., no power shell).

@thijstriemstra
Copy link
Contributor Author

thijstriemstra commented Nov 8, 2023

Install the Python PIP packages python-rtmidi and windows-curses."

Did you install these Python packages?

Yes, see my previous comment:

Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import rtmidi
rtmidi.API_WINDOWS_MM in rtmidi.get_compiled_api()
True
midiout = rtmidi.MidiOut()
midiout.get_ports()
['Microsoft GS Wavetable Synth 0']

For me edrumulus_gui worked fine under Windows in a normal CMD shell (i.e., no power shell).

I'll try that as well.

Did you run loopMIDI and HairlessMIDI before you started edrumulus_gui? See #16 (reply in thread)

No, but when I do start them, and then run python tools\edrumulus_gui.py rtmidi, I'm getting a new exception:

Traceback (most recent call last):
  File "C:\Users\foo\projects\edrumulus\edrumulus\tools\edrumulus_gui.py", line 40, in <module>
    import jack
ModuleNotFoundError: No module named 'jack'

C:\Users\foo\projects\edrumulus\edrumulus>python tools\edrumulus_gui.py rtmidi
Traceback (most recent call last):
  File "C:\Users\foo\projects\edrumulus\edrumulus\tools\edrumulus_gui.py", line 613, in <module>
    load_settings()
  File "C:\Users\foo\projects\edrumulus\edrumulus\tools\edrumulus_gui.py", line 405, in load_settings
    with open("settings/trigger_settings.txt", "r") as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'settings/trigger_settings.txt'

This is a relative path issue, I'll submit a patch.

@thijstriemstra
Copy link
Contributor Author

With pr #117 I am able to run python tools\edrumulus_gui.py rtmidi but the prompt/window is just empty:

empty

Hopefully this is because I haven't my edrumulus esp32 device connected (because I haven't flashed new firmware yet)? Have you/can you try to start the edrumulus gui without a device connected @corrados and do you also get a blank screen in that case?

@corrados
Copy link
Owner

corrados commented Nov 8, 2023

Did you install these Python packages?

Yes, see my previous comment:

You have to be very carefully with the Python packages. Unfortunately, there are multiple rtmidi packages available but only the python-rtmidi works with Edrumulus. Please make sure you actually installed exactly this package and no other.

No, but when I do start them, and then run python tools\edrumulus_gui.py rtmidi, I'm getting a new exception:

Traceback (most recent call last):
File "C:\Users\foo\projects\edrumulus\edrumulus\tools\edrumulus_gui.py", line 40, in
import jack
ModuleNotFoundError: No module named 'jack'

That indicates that the command line argument is not correctly given to the script. If rtmidi command line argument is given, no jack audio is used at all.

but the prompt/window is just empty [...] Hopefully this is because I haven't my edrumulus esp32 device connected

Exactly. Edrumulus must be connected for the script to work. Otherwise I also get an empty screen.

@thijstriemstra
Copy link
Contributor Author

Exactly. Edrumulus must be connected for the script to work. Otherwise I also get an empty screen.

Great, then I'm confident to upgrade firmware and have ability to tune the parameters. I'd hate to put my edrumulus out of commission and go through trouble of reverting the firmware. Could you merge #117 though, without it I'm getting path issues.

@corrados
Copy link
Owner

corrados commented Nov 8, 2023

Before you update, please tag your current Git commit to be able to easily go back to the old version (just in case ;-) ).

@corrados
Copy link
Owner

corrados commented Nov 8, 2023

Could you merge #117 though, without it I'm getting path issues.

done

@thijstriemstra
Copy link
Contributor Author

thanks. I'll upgrade firmware tomorrow and if everything's fine, close this ticket.

@thijstriemstra
Copy link
Contributor Author

if everything's fine, close this ticket.

So yesterday we were all ready to test out the new code, flashed new firmware, started edrumulus_gui.py and unfortunately it resulted in same black command prompt.. no errors, nothing. How can I debug this issue?

@corrados
Copy link
Owner

Have you checked that you have loopMIDI correctly configured with the names "EdrumulusIn" and "EdrumulusOut"? You can try to flip the assignments in HairlessMIDI. Maybe this is the issue.

@corrados
Copy link
Owner

I have just tried it out with the latest Git main branch and it works fine for me:
grafik

@corrados
Copy link
Owner

I am pretty sure that it does not make a difference but you could try to enter the tools directory and start the script from there (you are in the edrumulus root directory: grafik). At least this is what I usually do.

@thijstriemstra
Copy link
Contributor Author

Have you checked that you have loopMIDI correctly configured with the names "EdrumulusIn" and "EdrumulusOut"?

Good point, I used a different name, let me try.

thijstriemstra added a commit to thijstriemstra/edrumulus that referenced this issue Nov 11, 2023
@thijstriemstra
Copy link
Contributor Author

thijstriemstra commented Nov 11, 2023

Good point, I used a different name, let me try.

Awesome, that worked:

working setup

I opened #121 to clarify things a little bit more, thanks for the screenshot.

@thijstriemstra
Copy link
Contributor Author

I am pretty sure that it does not make a difference but you could try to enter the tools directory and start the script from there

I believe this potential issue was fixed with #117 but before that PR it would surely be an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants