Setting Locator Names

rivers cuomo's icon

We have an ableton set with about 100 songs in it. We want to automatically calculate the length of each song (between locators) and then update the locator names to include the song lengths. Does that sound like something that would be possible?

tyler mazaika's icon

Sadly, no. The Live Object Model doesn't have a way to set the name of Locators (aka CuePoint). You can only GET their name / position.

As a kinda-like-that hack it is possible to make a MIDI track and automatically put clips in place that have the song name / duration you want. But that's not the same...

FP's icon

It seems possible to pass clips name to locators name.

If somebody knows how to do it, it would be great to share the trick. I'm stuck on this...

tyler mazaika's icon

Yes, you can now (Live 12) set the names in the CuePoint using "set <name>". 🥳 This ought to work:

I've got a Dungeon Master's Guide...?

Regarding the original question about calculation of time between locators, I'm not sure the SMTPE timecode output (Song > Functions > get_current_smpte_song_time) works well with tempo changes like you would have between songs. But if you have audio clips that run the length of each song it should be fairly straightforward to obtain the duration from there.

FP's icon

Yes great. Naming cuepoints seems not yet documented. But it works smoothly.

Thx.

Nodanoma's icon

One thing to be weary of when working with Locators, and especially SMPTE-time in Albeton is this: The API does not register tempo changes until they occur, this means, if you have tempo changes in your set the calculcations for song lengths, for example, will be mostly incorrect and only work with the tempo currently set in the transport. Yes, confusing, and very, very silly.

So, in another nutshell and for example: if you call get_smpte_song_time this is always calculated based on the song position and the tempo your Set is currently operating in. If this behaviour hasn't got addressed meanwhile the API will neither know nor care about it. Whether in recent versions this has been improved or compeltely upgraded I don't know but do doubt it. You can check this behaviour by automating your tempo from very low to very high at a specific locator, then check the smpte just before and then just after the tempo change. You will see that the earlier one is supposed to be 'later' which is not correct.

Basically, if you have all your songs in the set without warping and tempo changes, you can measure the song lengths, otherwise: triple check your results and don't expect joy!