Ableton Framework counting slots within tracks

Share your favorite Ableton Live tips, tricks, and techniques.
Post Reply
MrCoffee
Posts: 1
Joined: Sun Jan 24, 2016 10:10 pm

Ableton Framework counting slots within tracks

Post by MrCoffee » Sat Mar 12, 2016 10:33 pm

Hello There :)

I started writing Ableton Scripts in python and now I am at a point where I´m stuck. I try to count the number of slots which one track in Live can have. I thought of handling a track as a list and therefor tried the following:

song = self.song()
len(song.Tracks[0]) #[0] stands for the first track

but that doesn´t work. Is there any other method (a working one :)) to get the number of slots inside a track?

Much greetings
MrCoffee

NSU_Spray
Posts: 47
Joined: Wed Mar 02, 2011 11:24 am
Location: Russia
Contact:

Re: Ableton Framework counting slots within tracks

Post by NSU_Spray » Tue Mar 15, 2016 9:39 am

What do you mean by “slot”? If you want to get length of all track-object sub elements, write something like this:

Code: Select all

track_dir = dir(song.tracks[0]) # get list of names
track_dir_len = len(track_dir)
P. S. “Tracks” should be write with a lowercase letter.

Post Reply