DeepSmeag / MinilabMk2-Ableton-script

This project is intended for those who are into music production, have a Minilab Mk2 MIDI controller and use Ableton Live as their DAW.
28 stars 3 forks source link

Some encoders and all pads not working #8

Open CoenKonings opened 2 years ago

CoenKonings commented 2 years ago

I'm using Live 11.1.5 on Windows 10 Version 10.0.19043 Build 19043. I have the latest version of the minilab mk2 firmware (1.1.2), and I am using your template

Most encoders/knobs are working properly, except:

None of the pads are working properly. Pressing them does nothing (though I can see MIDI messages coming in), and none of them light up.

I've attached the logs. The problem seems to be this:

2022-06-11T12:38:16.781241: info: RemoteScriptError: Exception in thread Thread-73:
Traceback (most recent call last):
  File "..\..\..\output\Live\win_64_static\Release\python-bundle\Python/lib\threading.py", line 917, in _bootstrap_inner
  File "..\..\..\output\Live\win_64_static\Release\python-bundle\Python/lib\threading.py", line 865, in run
  File "C:\Users\coenk\Documents\Ableton\User Library\Remote Scripts\MinilabMk2_Alternate\test.py", line 988, in _update_clip_leds
    for clip in xrange(0, len(self.song_instance.tracks)):
NameError: name 'xrange' is not defined

Which I believe is caused by Ableton 11 using Python3 instead of Python2.

I don't really have time to do so right now, but when I do, I may try to fix it myself. (If you haven't had a chance to fix it by that time)

Log.txt

CoenKonings commented 2 years ago

So I've added a quick hacky fix to test.py:

try:
    xrange
except NameError:
    xrange = range

Now the pads light up properly, but the other problems have not changed.

New log file (with new errors): Log.txt

DeepSmeag commented 2 years ago

Hi there, try changing xrange to range and let me know if it works, so I can update the script. I don't have ableton or the controller available to test things out. range is the python3 standard for looping through numbers. Thanks for the interest, I hope this quick fix works.

Quick edit: I think there will be more errors to fix, so let me know if this one goes away so we can focus on the others.

CoenKonings commented 2 years ago

Hi, thanks for your reply! I already tried the fix you proposed and it worked, but it revealed some other problems, which you can find in the comment I made on this issue yesterday.

If I have some time this summer I'll try to find a fix myself, but I'll have to learn about control surface programming before I can do so

edit: link to the comment

DeepSmeag commented 2 years ago

Hi again, I'm looking through the log and the errors I see are still related to range. Are you sure you replaced all occurrences of xrange to a normal range? If you tried to change xrange to range inside a function the change is not necessarily global, since we're talking local scope. And since Python executes as it goes...changing it globally won't really make sense either because that line of code has a chance of not ever being executed. Let me know.

Simboubou commented 2 years ago

I'm having the exact same problem. Encoder 8 doesn't work as intend and the pads don't work either. While I can live without knob 8 (it's not very precise anyway), I find the default control script quite useless without the ability to start AND stop clips. Replacing all the xranges didn't help.

I'd willing to start debuging this (I can do python), but I don't know how and where to start.

Log.txt

Simboubou commented 2 years ago

To be precise, replacing the xranges fixes the initial pad coloring, but they don't work as intended. While it would be nice to fix the pads, my main use for this script is the "stop clip" feature.