stretching midi clip with live API ?

schlam's icon

Hello
I don't find a way to stretch a midi clip in the LOM...
Is there a way to set the position and move the "stretch cursor" of a midi clip with Live API ?

The goal should be to be able to :
1- change a clip's lenght (in Beat_Bars_Units) of, for example, 0.4.234 to a lenght of 0.4.0.
2- moving all notes in this clip proportionaly (like the manual stretch marker of a clip)
3- find the new tempo to set to Live that make the new clip sounding exactly as the first one but "fitted" in a regular number of bars.

1 and 3 are done..
My problem is the 2...

Do i have to collect all notes informations of the clip and calculate for each one the new position and duration ?
..The "stretch marker" does that so simply...

Any advice ?

Thank you !

Julien

chapelier fou's icon

I'm have the same kind of issues around [dict] and the new "get_notes_extended" method and trying to process one of the note data for all notes. But struggling with the [dict] concept a lot.
It's maybe not the approach you're trying but I'm interested in your solutions if you find any.

chapelier fou's icon

I guess all the knowledge can be found here : https://cycling74.com/articles/what's-new-in-live-11-part-2
But it's a bit overwhelming for me.

schlam's icon

Ooooh que oui..
a (set stretch_end_marker) would be so simple..
But I will look (again...) this heavy article =)

schlam's icon

..this really amazing device manages (with javascript...pff=) to move this marker..
I really don't know if this possibility in Js means that, so, it's possible with the API.

Take a look at it, it's interesting ..

https://github.com/adamjmurray/ableton-midi-sculptor
(you will have to download the L11 version and replace the amxd in the downloaded folder..)

A la tienne !


schlam's icon

...in fact it seems that it is not the "stretch marker" which is directly moving here.
the device stretchs all the notes and Live moves the marker accordingly..

chapelier fou's icon

The hard way.

schlam's icon

I tried with "the hard way"and it's working quite good...
...but of course I have some issues..
If some one can have a quick look it would be great =)

Settings:
--put the device in a midi track
--arm one track with an instrument (can be another track)
--press the button and start to play in the same time (the device auto set global quantization to none at startup)
--press the button again...

--->now the clip length will be a multiple of 8 beats whatever the length of the recording (can be less if the clip is really too short but always 2, 4 or 8.)
--->the notes are stretched to this new length (start time and duration)
--->the global tempo is set accordingly so the new "fitted" clip sounds the same but is now in a regular number of bars.
---->another clip can be recorded again but if there is always only one armed track, they can have a totally different initial length

Ok..
...now the problems :

- if you play too quickly, some note on and/or note off are not recorded :/

- in some rare conditions (I don't really understand..) the 2nd note of the clip is not in time during the 1st loop but is good on the second loop..:/

- if you record more than one clip in the same time, the clips are not in time...
--->but once the recording of several clips in the same time is done, selecting the last of them will performs the trick and all will be good but the global tempo won't be good anymore

- the global tempo can be heavily changed and can be out of range after a lot of recordingd of too different lengths

- I would like to make the button mappable but of course its automation is recorded so it creates a lot of mess when the loop begins..For now I have to disable the mapping possibility of the button :/
[EDIT: moving the device in a midi track not armed allows to map the button]
....rfff...device doesn't work anymore if it's not in the track which is recording...weird:///

- sometimes when the device is load for the 1st time in a set, hitting the button will make the global play button of Live blinking and the recording is a mess. You have to click the button again, switch off live session record button and try again..It seems to be a problem related to the metronome settings (even if it's off..)

Any advice will be very welcomed !

thank you !

cLiP 4-4_0.2.amxd
application/octet-stream 174.00 KB


Forrest Edwards's icon

So did you finish your device? I was looking at it and it seems to be on the right track. I have started developing something similar. I am focusing on controlling Live's tempo through the scene trigger. I find that controlling Ableton's transport is really glitchy, but if I set the tempo and Meter into a scene and then fire the scene, it works dependably.