Decompiled APC40 remote script gives metaclass error
Posted: Fri Aug 18, 2023 10:47 am
Hi, I am trying to edit the APC40 remote script. I have decompiled the native files using https://pypi.org/project/uncompyle6/ and placed all the generated python files in Macintosh HD/Users/[username]/Music/Ableton/User Library/APC40 as described here https://help.ableton.com/hc/en-us/artic ... te-scripts.
I have also removed the native remote script folder APC40 from /Applications/Ableton Live 11 Suite.app/Contents/App-Resources/MIDI Remote Scripts to avoid any collision.
I didn't make any change to the decompiled code, but when I start Ableton I can see in the log file (/Users/[username]/Library/Preferences/Ableton/Live 11.3.4/Log.txt) the following error:
The error is given at this line of code in the APC40.py file:
It seems the classes APC and OptimizedControlSurface have incompatible types.
I have also tried to combine them in a new class and use that as metaclass, but it didn't work:
Does anyone have any idea how to make this work?
I have also removed the native remote script folder APC40 from /Applications/Ableton Live 11 Suite.app/Contents/App-Resources/MIDI Remote Scripts to avoid any collision.
I didn't make any change to the decompiled code, but when I start Ableton I can see in the log file (/Users/[username]/Library/Preferences/Ableton/Live 11.3.4/Log.txt) the following error:
Code: Select all
metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its basesCode: Select all
from _Framework.ControlSurface import OptimizedControlSurface
import _APC.APC as APC
class APC40(APC, OptimizedControlSurface): # <------
# ...
I have also tried to combine them in a new class and use that as metaclass, but it didn't work:
Code: Select all
# Define a new metaclass that inherits from the metaclasses of both base classes
class CombinedMeta(type(APC), type(OptimizedControlSurface)):
pass
class APC40(APC, OptimizedControlSurface, metaclass=CombinedMeta):
# ...