Who wants access to Ableton's Python API? .. You? .. Ok!

Discuss music production with Ableton Live.
hoffman2k
Posts: 14718
Joined: Tue Jun 15, 2004 6:40 pm
Location: Belgium
Contact:

Post by hoffman2k » Mon Jun 02, 2008 6:52 pm

At this point I'm not really missing any functions with the hack. So i can work with it in its current state. But I've ran into limitations on what is possible with the lemur, so I'm looking into some tactile solutions.

Michael Hatsis
Posts: 1807
Joined: Tue Nov 16, 2004 6:27 pm
Location: Here and There
Contact:

Post by Michael Hatsis » Mon Jun 02, 2008 8:28 pm

nbinder wrote:I tried APIMIDI with the Pd files and was just getting nonsense data ("scene-e: 1 0 1 1 1 0 1 0", and this doesn't even match to the used clip slots).

Guess you tried it with Max/MSP?

The whole development seems to be stuck, I wrote several messages on the google code and the google groups pages, but no replies or any other activities...

I tried to help myself, as I am not the silly "give me everything and I'll still complain" guy, but could get very much closer since then.
Id try the max version if you can. its been in dev a bit longer than the pd version. lots of features implemented. There has just been a hack that will let the OSC version runn on OS X but its kind of tricky.

hydrogen
Posts: 60
Joined: Wed Feb 20, 2008 12:01 am

Post by hydrogen » Sun Jun 22, 2008 2:51 am

its weird but i had to have python 2.2.3 installed to get this to work.

nbinder
Posts: 867
Joined: Tue Apr 29, 2008 1:47 pm

Post by nbinder » Mon Jun 23, 2008 6:54 am

mike@TrackTeam Audio wrote:Id try the max version if you can. its been in dev a bit longer than the pd version. lots of features implemented. There has just been a hack that will let the OSC version runn on OS X but its kind of tricky.
Thanks for the tip, I solved this problem in the meantime. My version was broken... I downloaded a new one... and voila. Never thought that could have been the reason :oops:

I am running it with c++ right now, the Pd version also did its job very well.

Still I am trying to find a way to gather playing position information of a clip, but as I've asked it twice here and didn't get any replies, I am near to giving up. I know that it is possible, but noone seems to know about it :?

hydrogen
Posts: 60
Joined: Wed Feb 20, 2008 12:01 am

Post by hydrogen » Wed Jun 25, 2008 3:29 am

I'm trying to get callbacks working from the OSCServer but i can't seem to make it happen... maybe somebody can help me out

I got data sending too live... eg.. tempo and changing the names... but the callbacks just don't fire off...

Code: Select all

import sys
import time
import random
sys.path.append('..\_LiveAPICore')

import RemixNet

#Add callback
def my_callback(data):
    print data
    print 'i got a callback'

oscServer = RemixNet.OSCServer('127.0.0.1', 9000, '127.0.0.1', 9001)

def do_it():
    oscServer.processIncomingUDP()
    oscServer.addCallback(my_callback, '/live/tempo')
    oscServer.addCallback(my_callback, '/live/name/clip')
    oscServer.addCallback(my_callback, '/live/name/track')
    
    oscServer.sendOSC('/live/tempo', 115)
    oscServer.sendOSC('/live/tempo')
    oscServer.sendOSC('/live/name/track', (0, 'rouyiyisterr'))
    oscServer.sendOSC('/live/name/track', (0)) 
    oscServer.sendOSC('/live/name/clip', (0,0))
    
    while 1:
        time.sleep(0.1) 
        print 'wait...'

do_it()
help would be extremly appreciated. Thanks!

nbinder
Posts: 867
Joined: Tue Apr 29, 2008 1:47 pm

Post by nbinder » Mon Jun 30, 2008 3:31 pm

I have to admit that I didn't do anything with callbacks, I jused python just for the quick test (set tempo, trigger clip).

Then I switched to C++, as the rest of my project was written there and I feel a bit more like "home" there. If you like to do the stuff in C++, be sure to check out Ross' amazing oscpack library. There are examples how to send/receive stuff, so you might be successfull with just a few lines of code.

hydrogen
Posts: 60
Joined: Wed Feb 20, 2008 12:01 am

Post by hydrogen » Wed Jul 02, 2008 12:01 pm

nbinder wrote:I have to admit that I didn't do anything with callbacks, I jused python just for the quick test (set tempo, trigger clip).

Then I switched to C++, as the rest of my project was written there and I feel a bit more like "home" there. If you like to do the stuff in C++, be sure to check out Ross' amazing oscpack library. There are examples how to send/receive stuff, so you might be successfull with just a few lines of code.
yeh... Unfortunately, c++ is a bit outside my reach atm. I'm an artist by trait and in the 5 years... I taught myself Actionscript, Javascript, LUA and now python. I will take that into consideration.

I decided to work directly in live on the monome -> live connection. The only thing i dislike right now is not being able to debug or print output... any ideas on that?

DIgiDennis
Posts: 142
Joined: Thu Jul 13, 2006 7:07 am
Location: DK - 1659

Post by DIgiDennis » Wed Jul 02, 2008 1:19 pm

hydrogen wrote: The only thing i dislike right now is not being able to debug or print output... any ideas on that?
Took me a while as well. going here: http://svn2.assembla.com/svn/live-api/trunk/src/tools either by svn or manualy download/setup

Some genius made a log server wich can be used to print debug messages to.

Check out the other projects in the trunk to see how it is used.

btw. u need to have python installed to use the log server. It has to be executed in a prompt.

hydrogen
Posts: 60
Joined: Wed Feb 20, 2008 12:01 am

Post by hydrogen » Fri Jul 04, 2008 2:26 pm

DIgiDennis wrote:Some genius made a log server wich can be used to print debug messages to.
word... i've seen logger script before in some of these apps... but the data doesn't seem to come through until i close live.

I'm also having trouble spawning multiple threads in live using:

Code: Select all

import threading

class MonomeDisplay(threading.Thread):
	def __init__( self, monome_basic):
		threading.Thread.__init__ ( self )
		self.monome_basic = monome_basic
	def run ( self ):
		while 1:
			note = self.monome_basic.get_monome_midi(3, 7)
			
			#on note			
			self.monome_basic.send_midi((NOTE_ON_STATUS, note, 127))
			#off note
			time.sleep(0.05)		
			self.monome_basic.send_midi((NOTE_OFF_STATUS, note, 0))
live seems to stop python processing until it needs to respond to data or send data...mmmmm... thats an idea too...

hydrogen
Posts: 60
Joined: Wed Feb 20, 2008 12:01 am

Post by hydrogen » Sat Jul 05, 2008 6:09 am

oh thats freaking awesome... i just figured out something... i can use live to send data back to the monome... so yussss!!! i'm in progreess..

so if i setup two clips... that legato into each other... i can get events that are timed to the bpm of my track. perfect. now i can make lights blink in sync with my music.

hydrogen
Posts: 60
Joined: Wed Feb 20, 2008 12:01 am

Post by hydrogen » Tue Jul 08, 2008 1:26 pm

DIgiDennis wrote:
hydrogen wrote: The only thing i dislike right now is not being able to debug or print output... any ideas on that?
Took me a while as well. going here: http://svn2.assembla.com/svn/live-api/trunk/src/tools either by svn or manualy download/setup

Some genius made a log server wich can be used to print debug messages to.

Check out the other projects in the trunk to see how it is used.

btw. u need to have python installed to use the log server. It has to be executed in a prompt.
This logger actually works and i'm very thankful that you posted this information.

baseinstinct
Posts: 942
Joined: Sun Feb 24, 2008 3:45 am

Post by baseinstinct » Sat Sep 13, 2008 11:47 pm

Hi guys. I have made several attempts to dig through what this Live API Python based project is about. I wonder how many people have been watching silently trying to figure out. The first part is for the like.

My discoveries:

it uses telnet

it may need a dedicated controller

its fully customizable

accepted by Ableton

may make Live-user integration much deeper than ever

There is not step by step tutorial for beginners, so if you are new to telnet and computer programming you may not know how to even start the investigation.

The latter I am not (c64 basic, some pascal, logo, autohotkeys), but apparently this is not enough.


I have a few questions, the answer to which could help me decide if the project is something to go for.

Is the following possible:
http://www.ableton.com/forum/viewtopic. ... highlight=


Could those functions be triggered by :

-keys of computer keyboard? Maybe Autohotkey (see http://www.autohotkey.com) would help?
-normal MIDI keyboard
-Nocturn Automapped

Surreal
Posts: 560
Joined: Wed May 17, 2006 1:18 am

Post by Surreal » Sat Oct 04, 2008 3:44 pm

Hello,

I am trying to adapt Monome Basic and Hydrogen's Monome Basic PLUS to my vision.

i want to take the quantization buttons from Monome basic and put them in the 7th column of Hydrogen's edit.

i know to replace the second lines in Monome BAsic

"elif q == Live.Song.Quantization.q_bar:
q = Live.Song.Quantization.q_2_bars

and only have the jumps to the options i want.

but i don't know how to paste this into 004 without crashing live

EDIT

If i want to skip the last 2 columns for clip triggering, is this correct?

FROM HYDROGEN's EDIT

#Playback grid for the monome
MONOME_PLAYBACK_GRID_X = (0, 5) #start, stop
MONOME_PLAYBACK_GRID_Y = (0, 7) #start, stop

and what does this variable do?

#set to 1, if the 9th row should be skipped
MONOME_SKIP_EIGHTH_ROW = 1


dunno what to do.

Coupe70
Posts: 1100
Joined: Fri Jul 23, 2004 7:25 am
Location: Mainz / Germany
Contact:

Post by Coupe70 » Sat Oct 04, 2008 6:52 pm

i have some questions about all this API thing.
i am not a programmer, just curious...

is the following possible ?

"ask" live from outside live: "what tracks are there in
the session view and what clips are in these tracks ?
what is the colour of the clips ?"

and if possible can you do this in c# ?
i thought it was only in python, but now i read
something about c++ in this thread...
Phongemeinschaft (Live-ElectroJazz / NuJazz)
Homepage - youtube - Like! :-)
Live 9 (32Bit), HP DV7, i5 2,53GHz, 8 GB RAM, Win7 (64Bit)

hydrogen
Posts: 60
Joined: Wed Feb 20, 2008 12:01 am

Post by hydrogen » Sun Oct 05, 2008 12:46 am

Surreal wrote:Hello,

I am trying to adapt Monome Basic and Hydrogen's Monome Basic PLUS to my vision.

i want to take the quantization buttons from Monome basic and put them in the 7th column of Hydrogen's edit.

i know to replace the second lines in Monome BAsic

"elif q == Live.Song.Quantization.q_bar:
q = Live.Song.Quantization.q_2_bars

and only have the jumps to the options i want.

but i don't know how to paste this into 004 without crashing live

EDIT

If i want to skip the last 2 columns for clip triggering, is this correct?

FROM HYDROGEN's EDIT

#Playback grid for the monome
MONOME_PLAYBACK_GRID_X = (0, 5) #start, stop
MONOME_PLAYBACK_GRID_Y = (0, 7) #start, stop

and what does this variable do?

#set to 1, if the 9th row should be skipped
MONOME_SKIP_EIGHTH_ROW = 1


dunno what to do.
surreal... :) I'd be glad to make the modifications... i'm sorry the code isn't well commented.

MONOME_SKIP_EIGHTH_ROW = sets the monome to actually skip every 9th row... haha...(Great naming). So in your ableton set there will be a blank betweeen each grid of 8 sounds.

I can add the quantiazation functionality in a couple weeks when i have some time. I sent you my email... please email and i can get back to you.

Post Reply