Page 20 of 28
Posted: Mon Feb 04, 2008 10:26 pm
by queglay
thanks for all the good info mdk. ill get into it after work tonight. i really know nothing about that low level stuff, but I know i'll get there somehow.
this is all very exciting stuff. the possiblities just boggle.
Posted: Mon Feb 04, 2008 10:30 pm
by The Phat Conductor
any word on the mac front?
Posted: Mon Feb 04, 2008 11:33 pm
by Clearscreen
WOW! if you guys get this stuff working please post it up for download - i tried geting this to work ages ago but kept having similar problems to what you found, and as i have very little idea about python i eventually gave up on it...
it's strange that so many big statements were made by these guys but it didn't seem to work 'out of the box'. i almost wonder if broken code was posted for download for a reason - is it possible these guys have been co-opted by ableton to implement OSC? or is my conspiracy theory radar on the fritz again?
anyhoo - it's good to see someone getting somewhere with this stuff again!
Posted: Mon Feb 04, 2008 11:45 pm
by queglay
well im pretty sure that this stuff isn't realy being developed anymore, and the mac front is probably a no go unless someone wants to get into it.
when im confident I've fixed the basic functionality ill share my progress.
Posted: Tue Feb 05, 2008 12:01 am
by Clearscreen
queglay wrote:well im pretty sure that this stuff isn't realy being developed anymore, and the mac front is probably a no go unless someone wants to get into it.
when im confident I've fixed the basic functionality ill share my progress.
thanks in advance

Posted: Tue Feb 05, 2008 4:28 am
by queglay
mdk wrote:right, well from a quick look there is a bug in LiveOSCCallbacks.py for requesting a clip name, but it shouldnt stop it sending strings.
on line 258 my version says this :
self.oscServer.sendOSC("/live/name/scene", (trackNumber, clipNumber, LiveUtils.getClip(trackNumber, clipNumber).name))
but should be
self.oscServer.sendOSC("/live/name/clip", (trackNumber, clipNumber, LiveUtils.getClip(trackNumber, clipNumber).name))
your file must be a little out of date maybe. mine says
self.oscServer.sendOSC("/live/name/clip", (trackNumber, clipNumber, clipSlot.clip.name))
now i tried pickle, to dump the clip names to a file to see what the format is-
pickle.dump(clipSlot.clip.name, debuginfo)
i get this garble-
Vsick2
p0
.V1 1-Audio
p0
.
which is only the first 2 clips in track 1. they are called sick2, and 1 1-audio
i dont know what all that other info is.
it seems to stop as soon as it hits an empty clipslot. i should be able to get around that problem, however, i have to figure out how to send those strings via osc properly too.
is there any way to print errors back out to the python shell instead of a text file? even with a text file i can't get definitions of the errors, only output variables and strings.
Posted: Tue Feb 05, 2008 6:59 am
by queglay
well i managed to convert it to a string using str(), and the string succesfully goes out via osc.
however, it gets to a point where there is an empty value. looking at the pickle output you can see again here-
Vsick2
p0
.Vclipb
p0
.Vblah
p0
.
it gets a 3 variables successfully. at the fourth one (which is supposed to be a blank slot) instead of continuing the loop just ceases.
i tried the following to check the variable -
Code: Select all
if clipSlot.clip.name:
outstring = str(clipSlot.clip.name)
else:
outstring = "empty"
pickle.dump(outstring, debuginfo)
but it didn't seem to work and the loop still gets broken.
Posted: Tue Feb 05, 2008 8:19 am
by queglay
well its working!
I can now get all clip slot names through to max msp via osc. empty clip slots are returned as "empty", so it shouldn't be too hard for people to get going and create representations of what clips are filled in live.
im using live 6.0.10. Haven't tried live 7, but i heard that it was ok.
some of the osc functions that were originally in there dont work because any text variable sent out needs to be converted to a string using the str() method.
im sure if you delve into more functionality then just getting clip and scene names you will have to do some more python debugging.
I'm not really going to be able to help out too much on this one once its up. to be honest its probably going to be a nightmare to get working, but I've tried to keep the documentation as simple as pissible.
just be warned, its not for the faint hearted!
I'm trying to get a hold of nathan to see if i can upload my modified files in place of the ones alread on the google forum.
Posted: Tue Feb 05, 2008 2:13 pm
by julienb
Hello everybody..
it seems to work on my 7.0.1
just several problems yet..
BUT, I would like to know if python is the way to send "position in a clip" to another app (max for example)
by "position in a clip", I mean : I'd like to have a feedback from live when the clip will finish... like the blinking arrows on the live set ; just before the clip finishes, a message/data is sent to max
Is Python the way to do that??
Posted: Tue Feb 05, 2008 2:40 pm
by mdk
i dont think you cant do that directly because the API only exposes 'is_playing' and 'is_triggered'. So you could get an event when it actually starts and stops, but not somewhere inbetween.
BUT
You also have access to the length of a clip and its loop settings so if you know
A: when it starts
B: its length
C: the tempo
you can calculate when it will finish.
sounds like fun

Posted: Tue Feb 05, 2008 2:48 pm
by julienb
great ...!
I have some problem.
with LiveTelnet, I tried the "say hello" tips ... in order to test the link between Live & outside world and I get that :
Welcome to the Ableton Live Python Interpreter (Python 2.2.1)
Brought to by LiveAPI.org
>>> doc=Live.Application().get_application().get_document()
>>> doc.tempo = 80
Traceback (most recent call last):
File "<console>", line 1, in ?
NameError: name 'doc' is not defined
any ideas?
I already did the modification written on
http://code.google.com/p/liveapi/issues/detail?id=1
another path problem?
Posted: Tue Feb 05, 2008 2:53 pm
by mdk
oh there's another thing i just thought of, the message pump only runs every 100ms. (the update_display handler)
You can add a listener for the current_song_time and that gets you updates every 60ms, which is a slight improvement.
So we had an idea and built a small proof-of-concept prototype which seemed to work.
If you send in midi events to the device associated with the remote script you can use those to trigger your processing. So nate built a small app in synthmaker to pump out midi cc's at any frequency we wanted, this was then connected to a Midi Yoke virtual port which was connected in live to that remote script.
Then in the script I did this :
Code: Select all
# when midi is received, see if its a CC message
def receive_midi(self, midi_bytes):
if ((midi_bytes[0] & 240) == CC_STATUS):
channel = (midi_bytes[0] & 15)
cc_no = midi_bytes[1]
cc_value = midi_bytes[2]
self.handle_midi_cc(cc_no,cc_value)
# use a midi CC to process the incoming command buffer
def handle_midi_cc(self,cc_no,cc_value):
if self.clientConnection:
self.processBuffer()
so, you could do something with max to pump out midi cc's to a virtual midi port which triggers the remote script handler and get updates when you want.
like i said, it seemed to work but i didnt have much time to work with it to see what the actual rate was, but you would expect it to be able to run pretty accurately as its part of the midi handling thread which runs at a much higher resolution than the display handler.
Posted: Tue Feb 05, 2008 3:33 pm
by julienb
I created another post about "clip playing information w/ Live & Max/MSP" :
http://www.ableton.com/forum/viewtopic. ... 918#632918
I'd like to report the blinking state of the arrow (=the playing state of the clip) on the monome...
if you have any ideas, go there
http://www.ableton.com/forum/viewtopic. ... 918#632918
I didn't want to polluate this thread with that

Posted: Tue Feb 05, 2008 4:37 pm
by morerecords
I truly apologize for a naive question, while I am a musician, I am not a computer guy, I have read these threads, I have a good idea of what is being discussed, but could someone break it down for a guy? WHat exactly is Pynthon/API and what applications could be applied using OSC?
It seems it is similar in concept to MIDI, but modernized and with more effiiency.
Posted: Tue Feb 05, 2008 5:29 pm
by Angstrom
there's a number of things you can do, but it's not really ready for prime-time. Most of us dabblers are experimenting with stuff that is not supported.
That said - you can get and set most of the properties that a Live set holds.
That means you could make a display in a 3rd party application (such as Flash) which only showed the information you need ... and big!
So a laptop screen might show the names of the current clips playing and what position they are at - and nothing more!
Another option -
You could get the length of the first recorded clip, do a little calculation to find out how that relates to the current set BPM and make the set be at the BPM of that first clip
If you have a device that uses OSC you could get a much better tie-in with Live (EG - a Lemur)
but for now just consider it wild experimentation by nosy tech types. If Ableton ever do release a method of interacting via OSC, or creating your own interfaces - it's unlikely to rely on installing an old version of Python and more likely to be a bit more user friendly
