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

Newb to MIDI Remote Scripts #20

Open
kithara opened this issue Nov 2, 2014 · 6 comments
Open

Newb to MIDI Remote Scripts #20

kithara opened this issue Nov 2, 2014 · 6 comments

Comments

@kithara
Copy link

kithara commented Nov 2, 2014

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
Copy link

egasimus commented Nov 3, 2014

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
Copy link
Author

kithara commented Nov 3, 2014

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
Copy link

egasimus commented Nov 4, 2014

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
Copy link
Author

kithara commented Nov 9, 2014

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:

  • Backup Axiom Directlink pyc files from MIDI Remote Scripts folder in my current Live Resources folder.
  • Copy the 9 *.py files from my clone of this repo to the MIDI Remote Scripts folder.
  • Restart Live... The py files are all compiled to byte code.
  • 'No blue lights' on my Axiom 61 indicating updates to the axiom,j the faders don't work etc. The keyboard sends midi ok.

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
Copy link

#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
Copy link
Author

kithara commented Nov 10, 2014

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 [email protected] 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
#20 (comment)
.

Sent from Gmail Mobile on my iPad

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