Live Python3
Live Python3
Custom Python version embedded in Live is really old. Would be great to take advantage of new 3.2+ GIL capabilities described here. https://www.dabeaz.com/python/UnderstandingGIL.pdf
What is the progress of work to migrate to 3.2+
What is the progress of work to migrate to 3.2+
https://musicascode.com - Slack and Discord channels on Ableton Midi Scripts (python)
Re: Live Python3
Can you elaborate as to what would be a correct entry point into such discussion? Are we on our own, lurking around in siloed dark shadows of the LinkedIn chats? BTW: Hi Daniel.
PeterS
PeterS
https://musicascode.com - Slack and Discord channels on Ableton Midi Scripts (python)
Re: Live Python3
Probably the Centrecode beta forum....
BTW it's Darren
Cheers
D
BTW it's Darren
Cheers
D
Re: Live Python3
Think of it like an old wishing well.
It's been at the heart of a village for over 200 years and holds sentimental value for a few old men. It's soon to concreted over to form part of "the dream factory" a 24 storey megamall.
Re: Live Python3
Hopefully the megamall will have a reptile store?
Ableton Live 10 Suite / Push 2 / Max 8 /
Re: Live Python3
Maybe being more specific will help:
I have issues importing ctypes. Can anyone confirm they were able to do this? I was able to append paths before import so any other components required I can most likely work out. So far had a hell of a time trying to figure out threading, seems to be blocking (probably in defense of main live thread). Forking works, but what's the point, multiprocessing is fine but that's also a fork in a way, threading on another hand is slooooow for any new threads. It seems there is something "special" in a way live_python is allowing the threading to be spun up behind the scenes.
I'm currently using Live 10.1 (14th of May) which under hood has the following
so now having this out of the way back to ctypes
Just an FYI, ctypes is importing fine outside of Live, tried adding lib paths to matched moduels inside main ableton structure and outside. If I could only get interpreter console maybe I would figure this out, but having to rely and starting/stoping ableton each time is killing me. Anyone worked with this here? Help!
I have issues importing ctypes. Can anyone confirm they were able to do this? I was able to append paths before import so any other components required I can most likely work out. So far had a hell of a time trying to figure out threading, seems to be blocking (probably in defense of main live thread). Forking works, but what's the point, multiprocessing is fine but that's also a fork in a way, threading on another hand is slooooow for any new threads. It seems there is something "special" in a way live_python is allowing the threading to be spun up behind the scenes.
I'm currently using Live 10.1 (14th of May) which under hood has the following
Code: Select all
== sys.path
[
'/Dropbox/Code/isobar/isobar',
'/Applications/Ableton Live 10 Suite.app/Contents/App-Resources/Python/lib',
'/Applications/Ableton Live 10 Suite.app/Contents/App-Resources/Python/site-packages/raven-5.8.1-py2.7.egg',
'/Applications/Ableton Live 10 Suite.app/Contents/App-Resources/Python/site-packages/setuptools-28.7.1-py2.7.egg',
'/Applications/Ableton Live 10 Suite.app/Contents/App-Resources/Python/site-packages/decorator-3.3.2-py2.5.egg',
'/Applications/Ableton Live 10 Suite.app/Contents/App-Resources/Python/site-packages/python',
'/Applications/Ableton Live 10 Suite.app/Contents/App-Resources/Python/site-packages/abl.util-0.1.16-py2.7.egg',
'/Applications/Ableton Live 10 Suite.app/Contents/App-Resources/Python/site-packages/abl.vpath-0.8.2-py2.7.egg',
'/Applications/Ableton Live 10 Suite.app/Contents/App-Resources/Python/site-packages/multipledispatch-0.4.8-py2.7.egg',
'/Applications/Ableton Live 10 Suite.app/Contents/App-Resources/Python/site-packages/pkg_resources',
'/Applications/Ableton Live 10 Suite.app/Contents/App-Resources/Python/abl.live',
'/Applications/Ableton Live 10 Suite.app/Contents/App-Resources/MIDI Remote Scripts/',
'/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5'
]
== sys.builtin_module_names
('__builtin__', '__main__', '_ast', '_bisect', '_codecs', '_collections', '_csv', '_functools', '_heapq', '_hotshot',
'_io', '_json', '_locale', '_lsprof', '_md5', '_multibytecodec', '_random', '_scproxy', '_sha', '_sha256', '_sha512',
'_socket', '_sqlite3', '_sre', '_ssl', '_struct', '_symtable', '_warnings', '_weakref', 'array', 'binascii', 'cPickle',
'cStringIO', 'cmath', 'datetime', 'dl', 'errno', 'exceptions', 'fcntl', 'future_builtins', 'gc', 'grp', 'imp', 'itertools',
'marshal', 'math', 'mmap', 'operator', 'parser', 'posix', 'pwd', 'pyexpat', 'resource', 'select', 'signal', 'strop',
'sys', 'syslog', 'termios', 'thread', 'time', 'timing', 'unicodedata', 'xxsubtype', 'zipimport', 'zlib')
== platform.sys.version
2.7.12 (default, Mar 20 2019, 10:36:06) [GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)]
== sys.executable (show me python executable, obviously embedded)
/Applications/Ableton Live 10 Suite.app/Contents/MacOS/Live
Code: Select all
2019-06-17T12:23:38.258958: info: RemoteScriptError: Traceback (most recent call last):
2019-06-17T12:23:38.258994: info: RemoteScriptError: File "<string>", line 1, in <module>
2019-06-17T12:23:38.259140: info: RemoteScriptError: File "/Applications/Ableton Live 10 Suite.app/Contents/App-Resources/MIDI Remote Scripts/LiveQL/__init__.py", line 1, in <module>
2019-06-17T12:23:38.259226: info: RemoteScriptError:
2019-06-17T12:23:38.259246: info: RemoteScriptError: from liveql import LiveQL
2019-06-17T12:23:38.259268: info: RemoteScriptError: File "/Applications/Ableton Live 10 Suite.app/Contents/App-Resources/MIDI Remote Scripts/LiveQL/liveql.py", line 2, in <module>
2019-06-17T12:23:38.259315: info: RemoteScriptError:
2019-06-17T12:23:38.259332: info: RemoteScriptError: import ctypes
2019-06-17T12:23:38.259355: info: RemoteScriptError: File "/Applications/Ableton Live 10 Suite.app/Contents/App-Resources/Python/lib/ctypes/__init__.py", line 7, in <module>
2019-06-17T12:23:38.259393: info: RemoteScriptError:
2019-06-17T12:23:38.259410: info: RemoteScriptError: from _ctypes import Union, Structure, Array
2019-06-17T12:23:38.259440: info: RemoteScriptError: ImportError
2019-06-17T12:23:38.259457: info: RemoteScriptError: :
2019-06-17T12:23:38.259479: info: RemoteScriptError: No module named _ctypes
2019-06-17T12:23:38.259494: info: RemoteScriptError:
https://musicascode.com - Slack and Discord channels on Ableton Midi Scripts (python)
Re: Live Python3
Thank you D, I will try that now.
https://musicascode.com - Slack and Discord channels on Ableton Midi Scripts (python)
-
justinancheta
- Posts: 1
- Joined: Mon Jul 24, 2006 6:05 pm
- Location: California USA
- Contact:
Re: Live Python3
@neux I was playing around with this, too. I noticed that it doesn't barf when I import the `threading` module.
For instance I think I can do something like:
However, later on in the code I'm trying to use an OSCServer from a newer version of OSC.py (pyosc module) than LiveOSC v1 or v2 use. It kills Live when I try to execute server.serve_forever(). So close, yet so far.
I just thought it was interesting that `threading` wasn't in your list of available modules. `thread` is, but I believe `threading` is a higher-level abstraction that builds off of the lower-level `thread` module. I'm surprised that I can import it at all, really.
For instance I think I can do something like:
Code: Select all
import threading
...
thread = threading.Thread(target=self.request_x32_to_send_change_notifications)
thread.start()
...
I just thought it was interesting that `threading` wasn't in your list of available modules. `thread` is, but I believe `threading` is a higher-level abstraction that builds off of the lower-level `thread` module. I'm surprised that I can import it at all, really.
Re: Live Python3
@justinancheta i tried both. same thing. Flask works but it takes 120 on average to execute single call. I don't care much for OSC, I just wish there was a way to interact with Live without having to deal with Ableton blocking python abilities on purpose. Tried RESTful Flask (all sorts of threading and forking), I tried queueing. Next in line is either loading/saving calls through a filesystem or maybe pickeled instances. Seems like hell of a workaround to sneak in some call data into Live-python. I understand Ableton wants to protect the runtime but if I want to break it i should be able to. My workflow is not based on live playback. I started collecting my work into a tool called 4bars https://github.com/styk-tv/4bars and also there is about 12 people now on live Slack channel related to python Live/Ableton coding https://musicascode.com/ to get instant invite.
Let me know if you get any further. I'm interested as well. For now OSC is best suited to do outside interfacing through the asynchronous socket they mount.
Peter
Let me know if you get any further. I'm interested as well. For now OSC is best suited to do outside interfacing through the asynchronous socket they mount.
Peter
https://musicascode.com - Slack and Discord channels on Ableton Midi Scripts (python)