Giter Club home page Giter Club logo

pylive's Introduction

PyLive

PyLive is a framework for querying and controlling Ableton Live from a standalone Python script, mediated via Open Sound Control. Internally, it uses the same API as a Live Control Surface, which means it can do anything that a hardware control surface can do, including:

  • query and modify global parameters such as tempo, volume, pan, quantize, arrangement time
  • query and modify properties of tracks, clips, scenes and devices
  • trigger and stop clips and scenes

It can perform many of the operations described in the AbletonOSC API. More comprehensive feature coverage is a work-in-progress.

If you are looking simply to send MIDI messages to Live, this module is not what you want. Instead, try setting up a virtual MIDI bus and using isobar to generate MIDI sequences.

Note for legacy users: As of 2023, pylive has been updated to to interface exclusively with AbletonOSC for Live 11 support. Legacy LiveOSC is no longer supported beyond v0.2.2.

Requirements

Installation

From PyPi:

pip3 install pylive

Or to install the latest (pre-release) code from git:

git clone https://github.com/ideoforms/pylive.git
cd pylive
python3 setup.py install

To check that pylive is communicating successfully with Ableton Live, try running one of the examples, or run the test suite with:

python3 setup.py test

Usage

#------------------------------------------------------------------------
# Basic example of pylive usage: connect to the Live set, trigger a clip,
# and modulate some device parameters.
#------------------------------------------------------------------------
import live
import random

#------------------------------------------------------------------------
# Query the set's contents, and set its tempo to 110bpm.
#------------------------------------------------------------------------
set = live.Set(scan=True)
set.tempo = 110.0

#------------------------------------------------------------------------
# Each Set contains a list of Track objects.
#------------------------------------------------------------------------
track = set.tracks[0]
print("Track name '%s'" % track.name)

#------------------------------------------------------------------------
# Each Track contains a list of Clip objects.
#------------------------------------------------------------------------
clip = track.clips[0]
print("Clip name '%s', length %d beats" % (clip.name, clip.length))
clip.play()

#------------------------------------------------------------------------
# Mdulate the parameters of a Device object.
#------------------------------------------------------------------------
device = track.devices[0]
parameter = random.choice(device.parameters)
parameter.value = random.uniform(parameter.min, parameter.max)
print("Randomising parameter %s of device %s" % (parameter, device))

Overview

To begin interacting with an Ableton Live set, the typical workflow is as follows. Live should normally be running on localhost, with LiveOSC enabled as a Control Surface.

  • Create a live.Set object, passing scan=True to automatically index the tracks, clips and devices within the set
  • Interact with Live by setting and getting properties on your Set:
    • set.tempo, set.time, set.overdub are global Set properties
    • set.tracks is a list of Track objects
    • set.tracks[N].name, set.tracks[N].mute, are Track properties
    • set.tracks[N].clips is a list of Clip objects (with empty slots containing None)
    • set.tracks[N].devices is a list of Device objects
    • set.tracks[N].devices[M].parameters is a list of Parameter objects

Getters and setters use Python's @property idiom, meaning that accessing set.tempo will query or update your Live set.

If you know that no other processes will interact with Live, set set.caching = True to cache properties such as tempo. This will query the Live set on the first instance, and subsequently return locally-stored values.

For further help, see pydoc live.

Classes

  • Set: Represents a single Ableton Live set in its entirety.
  • Track: A single Live track object. Contains Device and Clip objects. May be a member of a Group.
  • Group: A grouped set of one or more Track objects.
  • Device: An instrument or audio effect residing within a Track. Contains a number of Parameter objects.
  • Parameter: An individual control parameter of a Device, with a fixed range and variable value.

Limitations

Note that pylive is not intended for sending MIDI note events or control messages to a set. For MIDI controls, use a separate module such as mido.

pylive's People

Contributors

axeldelafosse avatar howthebodyworks avatar ideoforms avatar iwebster28 avatar kyrillosl avatar tom-oconnell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pylive's Issues

Non-ASCII character '\xe2' in file live/set.py on line 810

On Mojave
On Live 10.0.6

LiveOsc

commit 0c849b7c45efedf48f0f64b844b82e6734d11ae3 (HEAD -> master, origin/master, origin/HEAD)
Author: Daniel Jones <[email protected]>
Date:   Sun May 26 18:16:50 2019 +0100

    Update README

PyLive

commit 4b845258ca8fa1121e4e81ee7baeda5bec0740e8 (HEAD -> master, origin/master, origin/HEAD)
Author: Daniel Jones <[email protected]>
Date:   Sun May 26 18:18:14 2019 +0100

    Update README

Install of above version based on commit id:

polfilm@mac7:~/git_neux/pylive$ python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to pylive.egg-info/requires.txt
writing pylive.egg-info/PKG-INFO
writing top-level names to pylive.egg-info/top_level.txt
writing dependency_links to pylive.egg-info/dependency_links.txt
reading manifest file 'pylive.egg-info/SOURCES.txt'
writing manifest file 'pylive.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.14-x86_64/egg
running install_lib
running build_py
creating build/bdist.macosx-10.14-x86_64/egg
creating build/bdist.macosx-10.14-x86_64/egg/live
copying build/lib/live/query.py -> build/bdist.macosx-10.14-x86_64/egg/live
copying build/lib/live/object.py -> build/bdist.macosx-10.14-x86_64/egg/live
copying build/lib/live/device.py -> build/bdist.macosx-10.14-x86_64/egg/live
copying build/lib/live/track.py -> build/bdist.macosx-10.14-x86_64/egg/live
copying build/lib/live/constants.py -> build/bdist.macosx-10.14-x86_64/egg/live
copying build/lib/live/__init__.py -> build/bdist.macosx-10.14-x86_64/egg/live
copying build/lib/live/scene.py -> build/bdist.macosx-10.14-x86_64/egg/live
copying build/lib/live/group.py -> build/bdist.macosx-10.14-x86_64/egg/live
copying build/lib/live/exceptions.py -> build/bdist.macosx-10.14-x86_64/egg/live
copying build/lib/live/clip.py -> build/bdist.macosx-10.14-x86_64/egg/live
copying build/lib/live/set.py -> build/bdist.macosx-10.14-x86_64/egg/live
copying build/lib/live/parameter.py -> build/bdist.macosx-10.14-x86_64/egg/live
byte-compiling build/bdist.macosx-10.14-x86_64/egg/live/query.py to query.pyc
byte-compiling build/bdist.macosx-10.14-x86_64/egg/live/object.py to object.pyc
byte-compiling build/bdist.macosx-10.14-x86_64/egg/live/device.py to device.pyc
byte-compiling build/bdist.macosx-10.14-x86_64/egg/live/track.py to track.pyc
byte-compiling build/bdist.macosx-10.14-x86_64/egg/live/constants.py to constants.pyc
byte-compiling build/bdist.macosx-10.14-x86_64/egg/live/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.14-x86_64/egg/live/scene.py to scene.pyc
byte-compiling build/bdist.macosx-10.14-x86_64/egg/live/group.py to group.pyc
byte-compiling build/bdist.macosx-10.14-x86_64/egg/live/exceptions.py to exceptions.pyc
byte-compiling build/bdist.macosx-10.14-x86_64/egg/live/clip.py to clip.pyc
byte-compiling build/bdist.macosx-10.14-x86_64/egg/live/set.py to set.pyc
byte-compiling build/bdist.macosx-10.14-x86_64/egg/live/parameter.py to parameter.pyc
creating build/bdist.macosx-10.14-x86_64/egg/EGG-INFO
copying pylive.egg-info/PKG-INFO -> build/bdist.macosx-10.14-x86_64/egg/EGG-INFO
copying pylive.egg-info/SOURCES.txt -> build/bdist.macosx-10.14-x86_64/egg/EGG-INFO
copying pylive.egg-info/dependency_links.txt -> build/bdist.macosx-10.14-x86_64/egg/EGG-INFO
copying pylive.egg-info/requires.txt -> build/bdist.macosx-10.14-x86_64/egg/EGG-INFO
copying pylive.egg-info/top_level.txt -> build/bdist.macosx-10.14-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/pylive-0.1.5-py2.7.egg' and adding 'build/bdist.macosx-10.14-x86_64/egg' to it
removing 'build/bdist.macosx-10.14-x86_64/egg' (and everything under it)
Processing pylive-0.1.5-py2.7.egg
Copying pylive-0.1.5-py2.7.egg to /usr/local/lib/python2.7/site-packages
Adding pylive 0.1.5 to easy-install.pth file

Installed /usr/local/lib/python2.7/site-packages/pylive-0.1.5-py2.7.egg
Processing dependencies for pylive==0.1.5
Searching for pyliblo==0.10.0
Best match: pyliblo 0.10.0
Processing pyliblo-0.10.0-py2.7-macosx-10.14-x86_64.egg
pyliblo 0.10.0 is already the active version in easy-install.pth
Installing send_osc script to /usr/local/bin
Installing dump_osc script to /usr/local/bin

Using /usr/local/lib/python2.7/site-packages/pyliblo-0.10.0-py2.7-macosx-10.14-x86_64.egg
Finished processing dependencies for pylive==0.1.5


polfilm@mac7:~/git_neux/pylive$ python
Python 2.7.16 (default, Apr 12 2019, 15:32:40)
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import live
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "live/__init__.py", line 35, in <module>
    from .set import *
  File "live/set.py", line 810
SyntaxError: Non-ASCII character '\xe2' in file live/set.py on line 810, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

install of 0.1.4 from pypi works but gives me index out of range on tracks scan. Any hints?

MIDI file to CLIP?

You mentioned in Readme a solid Midi library mido. Is there any chance you could at least provide a hint on how to take few bars of a midi file and turn it into a midi clip?

Clips not returning

I am running pylive 0.4.0, Ableton Live 11.3.2, and AbletonOSC downloaded 2/29/24.

When I open a set with many clips, I cannot seem to get any clips. Even when I create a brand new MIDI track, create a clip, and name it, it doesn't appear in a dump(). When I tried creating a clip with pylive, it returns just fine, but I do not see it in the Ableton GUI.

`import live
import logging

set = live.Set(scan=True)
set.logger.setLevel(logging.DEBUG)
set.dump()`

`───────────────────────────────────────────────────────

Live set with 16 tracks in 0 groups, total 0 clips
────────────────────────────────────────────────────────`

Thank you for this super helpful package!

detailed install instructions?

Hello,

I followed your link to LiveOSC and i got it working on AL9.

I checked my python version and it says: 2.7.11

I installed pyOSC by running: pip install pyOSC

I also installed the package "live" by running: pip install live

When on the examples folder, i try to run an example, for instance:

cd examples
python ex-device-randomise.py

but then i get an error:

Traceback (most recent call last):
  File "ex-device-randomise.py", line 9, in <module>
    import live
ImportError: No module named live

if i move the file one level up and execute

mv ex-device-randomise.py ..
cd ..
python ex-device-randomise.py

i get a different error:

Traceback (most recent call last):
  File "ex-device-randomise.py", line 9, in <module>
    import live
  File "/Users/h/Desktop/--projects/serum/pylive/live/__init__.py", line 35, in <module>
    from set import *
  File "/Users/h/Desktop/--projects/serum/pylive/live/set.py", line 1, in <module>
    import live.query
  File "/Users/h/Desktop/--projects/serum/pylive/live/query.py", line 6, in <module>
    import liblo
ImportError: No module named liblo

By now i'm not sure how to install liblo and also why after installing the package "live" i can't just run my script from the "examples" folder - it seens python isn't finding the files after pip install has run ?

I must be doing something wrong regarding installing the libraries using pip or running multiple versions of python on my OSX ?

Would really appreciate some help here!

Thank you

Migrate from port 9000

Port 9000 is used by the WavesLocalServer process introduced earlier this year, which causes LiveOSC to silently fail.
Set default port in LiveOSC and pylive to something else.

Device on/off

Hi,

Any way to enable/disable device? This is useful to save CPU when a track is not used. In Ableton this is called "Device Activator"

>>> import live
>>>
>>> set = live.Set()
>>> set.scan(scan_devices=True)
tracks = set.tracks
>>> tracks = set.tracks

>>> tracks[0].mute = 1
>>> tracks[0].mute = 0
>>> tracks[0].devices[0]
<live.device.Device object at 0x104922340>
>>> tracks[0].devices[0].name
'Komplete'

>>> tracks[0].devices[0].mute
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Device' object has no attribute 'mute'
>>> tracks[0].devices[0].on
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Device' object has no attribute 'on'
>>>

LiveOSC not working on Windows Live 10.1.42

I've installed the LiveOSC fork into two different installlations of Live on different computers. Neither worked, and the sockets were never opened.

Output from LogServer.py was pretty consistent:


('127.0.0.1', 1427) connected!
('127.0.0.1', 1439) connected!
('127.0.0.1', 1440) connected!
OSCEndpoint starting, local address ('', 9123) remote address ('localhost', 9124)
LiveOSC initialized
OSCEndpoint starting, local address ('', 9123) remote address ('localhost', 9124)
LiveOSC initialized
Refreshing state
Refreshing state
error handling message, errno <module 'errno' (built-in)>: An existing connection was forcibly closed by the remote host
error handling message, errno <module 'errno' (built-in)>: An existing connection was forcibly closed by the remote host
error handling message, errno <module 'errno' (built-in)>: An existing connection was forcibly closed by the remote host
Refreshing state
error handling message, errno <module 'errno' (built-in)>: An existing connection was forcibly closed by the remote host
error handling message, errno <module 'errno' (built-in)>: An existing connection was forcibly closed by the remote host
error handling message, errno <module 'errno' (built-in)>: An existing connection was forcibly closed by the remote host
error handling message, errno <module 'errno' (built-in)>: A non-blocking socket operation could not be completed immediately
error handling message, errno <module 'errno' (built-in)>: A non-blocking socket operation could not be completed immediately

I tried tinkering about with the code, but didn't make it very far due to the sockets being wrapped etc, I tried settings ports other than 9000/9001 and this also didn't work. Since it didn't work on two different computers I'm thinking it wasn't the vagaries of the networking setup on one of them that was causing it to fail.

I didn't quite understand why it starts up twice - I tried to prevent it doing this using a locking file, but it still didn't work (just didn't show any error messages). I'm going to see if I can try it in a copy of Live 10.0.0 next.

Edit: same problem with 10.0

Issues with AbletonOSC Compatibility

Just fyi, I initially tried to use the pylive version installed via pip with AbletonOSC.

For the pip installed version of pylive, I thought it was a matter of simply changing the ports from 9000 and 9001 to the corresponding ones (AbletonOSC uses 11000 and 11001) but this was not successful.

I then tried the most recent (as of this post) code off of git, and it worked for me after a restart.

Clip Name - On Create or Rename

Not sure how we missed it, but we are missing ability to specify clip name. Names are critical as ClyphX is basing entire operations on names of clips.

Any chance we can add Name o the clip to the Clip create method. Capability for naming of the clips is in the LiveOSC fork you are using.

Screenshot 2019-10-05 at 03 48 00

Fix usage example code

The usage example in the README.md currently calls "scan_dvices" and throws an exception on first go. This live should read "scan_device" per the scan function definition:

def scan(self, scan_scenes: bool = False, scan_device: bool = False, scan_clip_names: bool = False):

Screenshot 2023-09-29 at 8 42 03 AM

liblo/cython issues

Hello, I successfully installed cython via pip3 and liblo via brew as recommended in the readme, and I also installed pylive via pip3.

But when I try running setup.py I get this error:

WARNING: The wheel package is not available.
Warning: 'keywords' should be a list, got type 'tuple'
running pytest
Searching for pyliblo>=0.9.1
Reading https://pypi.org/simple/pyliblo/
Downloading https://files.pythonhosted.org/packages/c0/da/4b8052ab5aa07952d7fe7b068d737a042e76373573eadd340f7550eddea9/pyliblo-0.10.0.tar.gz#sha256=fc67f1950b827272b00f9f0dc4ed7113c0ccef0c1c09e9976dead40ebbf1798f
Best match: pyliblo 0.10.0
Processing pyliblo-0.10.0.tar.gz
Writing /var/folders/3_/kmf5dynn0x39j4pjymr2kcvh0000gn/T/easy_install-66qqpjal/pyliblo-0.10.0/setup.cfg
Running pyliblo-0.10.0/setup.py -q bdist_egg --dist-dir /var/folders/3_/kmf5dynn0x39j4pjymr2kcvh0000gn/T/easy_install-66qqpjal/pyliblo-0.10.0/egg-dist-tmp-s2v9mioq
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 154, in save_modules
    yield saved
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "/var/folders/3_/kmf5dynn0x39j4pjymr2kcvh0000gn/T/easy_install-66qqpjal/pyliblo-0.10.0/setup.py", line 20, in <module>
    # way! + try to find workaround so cython gets installed first if not
ModuleNotFoundError: No module named 'Cython'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/modii/Dropbox/Development/Ableton/stealing altiverb/pylive/setup.py", line 5, in <module>
    setup(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/__init__.py", line 165, in setup
    return distutils.core.setup(**attrs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/Users/modii/Dropbox/Development/Ableton/stealing altiverb/pylive/.eggs/pytest_runner-5.3.0-py3.9.egg/ptr.py", line 202, in run
    installed_dists = self.install_dists(dist)
  File "/Users/modii/Dropbox/Development/Ableton/stealing altiverb/pylive/.eggs/pytest_runner-5.3.0-py3.9.egg/ptr.py", line 153, in install_dists
    orig.test.install_dists(dist), self.install_extra_dists(dist)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/command/test.py", line 209, in install_dists
    ir_d = dist.fetch_build_eggs(dist.install_requires)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
    resolved_dists = pkg_resources.working_set.resolve(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 779, in resolve
    dist = best[req.key] = env.best_match(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1064, in best_match
    return self.obtain(req, installer)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1076, in obtain
    return installer(requirement)
  File "/Users/modii/Dropbox/Development/Ableton/stealing altiverb/pylive/.eggs/pytest_runner-5.3.0-py3.9.egg/ptr.py", line 84, in fetch_build_egg
    return cmd.easy_install(req)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/command/easy_install.py", line 686, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/command/easy_install.py", line 712, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/command/easy_install.py", line 897, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/command/easy_install.py", line 1167, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/command/easy_install.py", line 1151, in run_setup
    run_setup(setup_script, args)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 253, in run_setup
    raise
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 135, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 135, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 166, in save_modules
    saved_exc.resume()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 141, in resume
    six.reraise(type, exc, self._tb)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_vendor/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 154, in save_modules
    yield saved
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "/var/folders/3_/kmf5dynn0x39j4pjymr2kcvh0000gn/T/easy_install-66qqpjal/pyliblo-0.10.0/setup.py", line 20, in <module>
    # way! + try to find workaround so cython gets installed first if not
ModuleNotFoundError: No module named 'Cython'

and if i try running a simple script that changes the live sets tempo i get this error:

/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 "/Users/modii/Dropbox/Development/Ableton/stealing altiverb/yoink.py"
Traceback (most recent call last):
  File "/Users/modii/Dropbox/Development/Ableton/stealing altiverb/yoink.py", line 1, in <module>
    import live
  File "<frozen zipimport>", line 259, in load_module
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pylive-0.2.1-py3.9.egg/live/__init__.py", line 34, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pylive-0.2.1-py3.9.egg/live/set.py", line 6, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pylive-0.2.1-py3.9.egg/live/query.py", line 48, in <module>
ModuleNotFoundError: No module named 'liblo'

LiveOSC Listeners?

I'm making a tool for myself and want to make sure I keep cpu usage down. Is there an example of using pylive with LISTENERS or do i just query the set on each beat like in the clip-walk example to get the set.time?

Support for Ableton Live 11 ?

@ideoforms Hi, I was trying to control Ableton Live with LiveOSC recently, but noticed that LiveOSC has only support Live up to version 10. I was wondering if you have any plan to support Ableton Live 11? Thank you very much!

Install error - building wheel for pyliblio

Hi,

tried to instal pylive from PyPi and Git. There is a problem and I can see the the problem but have no idea to solve it.
After reading several threads in forums maybe it is a problem with python and anaconda.
Maybe anyone can help me thanks.
Thanks
System: macOS

My error code via Papi:
Building wheel for pyliblo (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/.../opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/55/mk296wh53bj1bp16q350ltym0000gn/T/pip-install-s5m09wqy/pyliblo/setup.py'"'"'; file='"'"'/private/var/folders/55/mk296wh53bj1bp16q350ltym0000gn/T/pip-install-s5m09wqy/pyliblo/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/55/mk296wh53bj1bp16q350ltym0000gn/T/pip-wheel-ti67mhdy
cwd: /private/var/folders/55/mk296wh53bj1bp16q350ltym0000gn/T/pip-install-s5m09wqy/pyliblo/
Complete output (16 lines):
running bdist_wheel
running build
running build_ext
cythoning src/liblo.pyx to src/liblo.c
/Users/.../opt/anaconda3/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /private/var/folders/55/mk296wh53bj1bp16q350ltym0000gn/T/pip-install-s5m09wqy/pyliblo/src/liblo.pxd
tree = Parsing.p_module(s, pxd, full_module_name)
building 'liblo' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/.../opt/anaconda3/include -arch x86_64 -I/Users/.../opt/anaconda3/include -arch x86_64 -I/Users/.../opt/anaconda3/include/python3.8 -c src/liblo.c -o build/temp.macosx-10.9-x86_64-3.8/src/liblo.o -fno-strict-aliasing -Werror-implicit-function-declaration -Wfatal-errors
src/liblo.c:611:10: fatal error: 'lo/lo.h' file not found
#include "lo/lo.h"
^~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1

ERROR: Failed building wheel for pyliblo

My error code from git

Installed /Users/.../opt/anaconda3/lib/python3.8/site-packages/pylive-0.2.1-py3.8.egg
Processing dependencies for pylive==0.2.1
Searching for pyliblo>=0.9.1
Reading https://pypi.org/simple/pyliblo/
Downloading https://files.pythonhosted.org/packages/c0/da/4b8052ab5aa07952d7fe7b068d737a042e76373573eadd340f7550eddea9/pyliblo-0.10.0.tar.gz#sha256=fc67f1950b827272b00f9f0dc4ed7113c0ccef0c1c09e9976dead40ebbf1798f
Best match: pyliblo 0.10.0
Processing pyliblo-0.10.0.tar.gz
Writing /var/folders/55/mk296wh53bj1bp16q350ltym0000gn/T/easy_install-p15f9dqw/pyliblo-0.10.0/setup.cfg
Running pyliblo-0.10.0/setup.py -q bdist_egg --dist-dir /var/folders/55/mk296wh53bj1bp16q350ltym0000gn/T/easy_install-p15f9dqw/pyliblo-0.10.0/egg-dist-tmp-unake4i4
no previously-included directories found matching 'doc/build'
/Users/.../opt/anaconda3/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /private/var/folders/55/mk296wh53bj1bp16q350ltym0000gn/T/easy_install-p15f9dqw/pyliblo-0.10.0/src/liblo.pxd
tree = Parsing.p_module(s, pxd, full_module_name)
src/liblo.c:611:10: fatal error: 'lo/lo.h' file not found
#include "lo/lo.h"

CLIP Create?

Maybe I missed it.. any way to create a clip?

Could this package be extended to query VST/VST3/AU plugins too?

Like PLugView, but that's a GUI.

I wonder if the object Track could also include another object called Plugin which would list its original name, vendor or the plugin library that it's coming from.

Because the tracks can be named anything and its name can change from one project to the other.

You might not be thinking about adding this to pylive but if you know a way to query that information, that'd be really helpful for me. Thank you!

UnboundLocalError raised when Device is attached to a Group-Track

When scanning a file / set tracks are iterated and handled differently based on the is_foldable field. In the case where it foldable it is locally defined as group and in the case where it isn't it is defined as track. Later in the function it is assumed that track is already defined. However this won't be the case if the track was foldable / was a group. As a result the follow error is raised:

                for device_index, device_data in enumerate(track_data["devices"]):
>                   device = Device(track, device_index, device_data["name"])
E                   UnboundLocalError: local variable 'track' referenced before assignment

To reproduce: add a device to a Group and then try to instantiate a Set with scan=True

Clip color?

Is it possible to get the Clip color? Building my own control surface for Live and I have prototyped this using another python OSC Live control solution, so I know it is possible. Can this library get this info?

Cannot install

Using Python 2.7.14 on Windows 10, Ableton 9.5, running python setup.py install and getting:

cl : Command line error D8021 : invalid numeric argument '/Werror-implicit-function-declaration'
error: Setup script exited with error: command 'C:\\Users\\myusername\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2

Edit: I've got it working after a tedious manual installation of pyliblo. However, now it cannot find my LiveOSC. I've tried both LiveOSC and LiveOSC2. Getting timed out waiting for server response on set.scan() in ex-clip-walk.py. Do I need to do anything else after selecting LiveOSC(2) as Control Surface in Ableton?

CLIP Filename?

Post-recording the audiofile is known to Ableton. I'm trying to retrieve the filename of a clip at Track/Clip index position. However no filename data exists in the current implementation. Is there a way to retrieve it at OSC/Pylive level?

Screenshot 2019-09-21 at 12 12 22

Screenshot 2019-09-21 at 12 12 14

Accessing unofficial Live API's functionalities through pylive

Hi everybody,

I'm wondering if and how it's possible to access some functionalities exposed by the unofficial Ableton Live API, maybe through pylive or other means;
https://julienbayle.studio/PythonLiveAPI_documentation/Live10.0.1.xml

I'm not looking for an offline MIDI controller mapping, rather for a deeper control of Live functionalities, which I don't see supported so far by the LiveOSC mapping (am I wrong?);
specifically, I need to access to the Wavetable's modulation matrix, which is apparently possible thanks to the API.

I guess I could do that with Max's LOM but I would prefer to do it with some solid python code.

Thanks in advance!

Audio to Midi Conversion

Hi. This is a general question rather than an "issue"
I'm not really familiar with OSC but I'm wondering if it's in anyway possible to control/automate Ableton Live's Melody/Harmony/Rhythm to Midi capabilities using pylive (or any other way you can think of)?

Thanks!

Is Python 3 supported?

In the requirements listed in the README, the Python required is listed as "2.6+". I just want to clarify whether or not this is intended to include Python 3. From looking at some of the code, it looks like it does NOT include Python 3. A minor edit to the README to say it also works on Python 3 would be appreciated if it actually is expected to work there.

If I'm correct that Python 3 is not supported, is there any plan to change this? Is something on the Ableton side of things preventing that, or is it more a matter of the work required to add Python 3 support?

Edit: I see that some of the examples were changed to have Python 3 in their shebang line, so maybe this is a work in progress? The first file I looked at was actually in your LiveOSC fork (the logging server), so I might have just assumed incorrectly. It was that plus that fact that all of my setup.py tests seem to be failing for pylive, but maybe that is actually a matter of me incorrectly installing pylive or its dependencies...

Track Create

Would be great at some point to add "track create" There seem to be no default support in OSCLive

Screenshot 2019-09-30 at 19 50 51

Parameters not showing up

Hi there,

First off, this library is awesome 🔥

I have it up-and-running with Ableton 11. I'm able to scan the set, etc. But for some reason, when I examine the devices on a track, the parameters list is always empty. I can't get it to show params for any device I try. Any ideas why this would be? Are there restrictions on the kinds of devices / params that can be read?

Any pointers would be greatly appreciated 🙏

Timed out waiting for response from LiveOSC. Is Live running and LiveOSC installed?

Hi,

Anyone has some ideas what to check?

  • Ableton 10
  • I have python dependencies and LiveOSC installed
  • Except I didn't manage to successfully install liblo

Reaching this line:

https://github.com/ideoforms/pylive/blob/master/live/query.py#L240

My script:

#!/usr/bin/env python3
import live

set = live.Set()
set.scan(scan_devices=True, scan_clip_names=True) # this line fails
set.master_volume = 0

My error:

$ ~/Documents/git/live $ python3 volume.py
Traceback (most recent call last):
  File "/Users/mac/Documents/git/live/volume.py", line 5, in <module>
    set.scan(scan_devices=True, scan_clip_names=True)
  File "/usr/local/lib/python3.9/site-packages/pylive-0.2.1-py3.9.egg/live/set.py", line 642, in scan
  File "/usr/local/lib/python3.9/site-packages/pylive-0.2.1-py3.9.egg/live/set.py", line 326, in num_tracks
  File "/usr/local/lib/python3.9/site-packages/pylive-0.2.1-py3.9.egg/live/query.py", line 240, in query
live.exceptions.LiveConnectionError: Timed out waiting for response from LiveOSC. Is Live running and LiveOSC installed?
$ ~/Documents/git/live $

Ports don't respond:

nc -v localhost 9000
nc -v localhost 9001
nc -v mylocalip 9000
nc -v mylocalip 9001

Settings:
Screenshot 2022-02-07 at 00 44 37

Tested on Ableton Live 9

Hi there,

I just discovered this library and rather exciting about the possibilities of python interacting with AL9.

Is AL9 supported? Has this been tested?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.