gluon / AbletonLive9_RemoteScripts

Unofficial repository for Ableton Live 9 MIDI Remote Scripts by Julien Bayle
http://julienbayle.net/ableton-live-9-midi-remote-scripts/
514 stars 245 forks source link

Newb to MIDI Remote Scripts #20

Open kithara opened 9 years ago

kithara commented 9 years ago

Greetings,

I am running Ableton 9.1.5 on Windows 7.

I just started playing around with MIDI remote scripts. After playing with a hello world script I adapted from here: http://remotescripts.blogspot.com/2010/03/introduction-to-framework-classes.html I woud consistently get this error:

Required dependency register_component not provided for <_Framework.TransportComponent.TransportComponent object at 0x4276F350

Next, I cloned this repo, chose a controller I own (Axiom Directlink), copied the py files to the ableton remote scripts directory after backing up the pyc. When ableton starts up pyc files are created, however they do not work either and I still get the same error.

Required dependency register_component not provided for <_Framework.TransportComponent.TransportComponent object at 0x4276F350

Next, I put back the backed up PYC, restarted ableton and everything worked again.

My next thought - why not decompile the working PYC files that ship with Ableton? I made a fresh release build of pycdc with cmake and visual studio 2013 and threw all the working pyc in the newly restored Ableton Axiom Directlink folder at pycdc. I quickly inspected the py files in PyCharm and they looked ok to me.However after putting them in the axiom directlink directory again (after deleting them of course) I restarted Ableton, they py go compiled to pyc and got the same error - again.

What am I missing?

Any help would be greatly appreciated. I hope there is something super dumb I am doing which accounts for my repeated failure to get anything working.

Regards Kithara

egasimus commented 9 years ago

Maybe you need to do your init code within a with self.component_guard(): block? I can't remember if this was the exact issue I was having but I do remember ending up with somewhat similarly cryptic error message if I forgot my component guards.

kithara commented 9 years ago

Hi egasimus,

Thanks for your response. It turns out there is something new in relation to that with component_guard() statement. I did some more googling and found this on the Ableton forums which solved my problem: https://forum.ableton.com/viewtopic.php?f=1&t=200513&start=0

The missing piece was this: from future import with_statement #compatibility for Live 9, need to be written at the first line of script

So of course I inspected the source on GitHub and I find the same import statement in the Axiom_DirectLink.py and yet neither the current decompile, or the one I did the other day from the 9.1.5 scripts directory works for different reasons.

Well, I will have to sleuth further, but at least for now my hello world example is working. Kithara

egasimus commented 9 years ago

Ah yes, the from __future__ import is there because Live uses Python 2.5 internally. So you neeed to do that in order to make it actually undestand the with statement which AFAIK was first implemented in 2.5 but enabled by default only in 2.6. It's a Python thing, not an Ableton thing per se.

For reference, here's what component_guard looks like. Hmmm...

kithara commented 9 years ago

So far, I'm having success starting from scratch with a hello world script however, when I try to work with any decompiled Axiom Directlink script found in this repo (9.1.4), or my own decompiled version (9.1.5) of the scripts I have zero luck so far.

I am wondering if I am missing something basic. What I have done is:

When I check the logs, I get:

27212 ms. RemoteScriptMessage: (Axiom_DirectLink) Initialising... 27215 ms. Exception: Script could not be loaded.

I have tried a full backup of MIDI Remote Scripts with a full copy of the 9.1.4 repo files. In this case, nothing works at all (meaning my other devices also do not work).

Here is my setup: Ableton 9.1.5 Windows 7 Axiom 61 (2nd Gen), Launch Control, APC 40 and Oxygen 25.

It may well be as simple as - I'm on 9.1.5 and the 9.1.4 scripts won't work. However, my own decompile of the production pyc also does not work.

I have decompiled with my own build of pycdc for windows. I built this in Visual C++ 2013.

My next step would be create an Axiom_Directlink2 folder and slowly build the axiom script to full functionality line by line to find the problem. This would be painful, but I would learn alot I guess.

By the way - why do all the script files in this repo have this as the first line:

Embedded file name: /Users/versonator/Jenkins/live/Binary/Core_Release_64_static/mid (etc...)

Where is that coming from. When I decompile, I don't see that in my results.

Thanks for any help

egasimus commented 9 years ago

Embedded file name: /Users/versonator/Jenkins/live/Binary/Core_Release_64_static/mid (etc...)

This is obviously a path on the original developer's machine. :-) Jenkins is a "continuous integration" system that Ableton are apparently using for their builds.

"Script could not be loaded" sounds very much like an exception during the initial parsing of the script, such as an ImportError or perhaps SyntaxError... I'm shooting in the dark here, since I've never done any pyc decompilation myself (and abandoned the Ableton scripting battle quite early anyway) -- but could the decompiler be outputting Python code in a more recent version of the language, e.g. 2.7 or 3.0+? You should be aiming for Python 2.5 since that's what Ableton has.

kithara commented 9 years ago

Hi Adam,

I will post something more substantial tomorrow. I just spent the last 6 hours doing printf debugging to the Ableton log, restarted Ableton about 50 times and finally got the axiom direct link script working. I have blue lights, and I have to test more tomorrow to see if all the axiom Features are working.

What I ended up doing was fixing a bunch of logic around setting up shift buttons for the mixer, session Clip slots and the transport buttons.

I suspect that you maybe right; some side effect of my decompilation was messing with Boolean operations and comparisons with None. So that was my decompilation, but the copy on github didn't work for me either so the same problem could be effecting other scripts in the repo

Anyway thanks for your response and I'll let you know what else I discover

Kithara

On Monday, November 10, 2014, Adam Avramov notifications@github.com wrote:

Embedded file name:

/Users/versonator/Jenkins/live/Binary/Core_Release_64_static/mid (etc...)

This is obviously a path on the original developer's machine. :-) Jenkins http://jenkins-ci.org/ is a "continuous integration" system that Ableton are apparently using for their builds.

"Script could not be loaded" sounds very much like an exception during the initial parsing of the script, such as an ImportError or perhaps SyntaxError... I'm shooting in the dark here, since I've never done any pyc decompilation myself (and abandoned the Ableton scripting battle quite early anyway) -- but could the decompiler be outputting Python code in a more recent version of the language, e.g. 2.7 or 3.0+? You should be aiming for Python 2.5 since that's what Ableton has.

— Reply to this email directly or view it on GitHub https://github.com/gluon/AbletonLive9_RemoteScripts/issues/20#issuecomment-62351591 .

Sent from Gmail Mobile on my iPad