Fire multiple clips at once using LiveAPI

Learn about building and using Max for Live devices.
Post Reply
yannxou
Posts: 148
Joined: Fri Feb 27, 2004 8:39 pm
Location: Barcelona

Fire multiple clips at once using LiveAPI

Post by yannxou » Tue Jul 02, 2013 9:01 pm

Is there a way to fire multiple clips at the same time using Javascript with the LiveAPI?

I've tried firing some clips inside a 'for' iterator but sometimes they fire separately. For example, the following code:
var api = new LiveAPI();
for (var i = 0; i < 5; i++) {
api.path = "live_set tracks " + i + " clip_slots " + 0;
api.call("fire"); // Sometimes this is slow and clips are not fired at once. Find another way!
}

This happens specially when transport is stopped. I guess that in the first iteration, when the first clip is fired, it causes the transport to start playing and after that, the next iterations fire the clips and wait for the next quantization.

Is there any way to call the 'fire' method and passing a list of clips in a single call?

Anyone knows a workaround for this?
Live 9 Suite / MaxForLive / MacBook Black 2.4Ghz / 4Gb RAM / OSX 10.7.5 / Motu828 mk1 / MicroKONTROL / Midisport 4x4 / Korg Kaoss Pad II / Nocturn / Wiimote.

Machinate
Posts: 11648
Joined: Thu Jun 24, 2004 2:15 pm
Location: Denmark

Re: Fire multiple clips at once using LiveAPI

Post by Machinate » Tue Jul 02, 2013 10:31 pm

workaround would be to not stop the transport, but stop the clips instead.

then when you need to trigger the clips you trigger them sequentially, then set the transport to the beginning and you'll have the sync.
mbp 2.66, osx 10.6.8, 8GB ram.

yannxou
Posts: 148
Joined: Fri Feb 27, 2004 8:39 pm
Location: Barcelona

Re: Fire multiple clips at once using LiveAPI

Post by yannxou » Wed Jul 03, 2013 8:17 am

Machinate wrote:workaround would be to not stop the transport, but stop the clips instead.

then when you need to trigger the clips you trigger them sequentially, then set the transport to the beginning and you'll have the sync.
mmh, thanks for your idea but cannot use in my case because I want to trigger the clips to start a recording..
Live 9 Suite / MaxForLive / MacBook Black 2.4Ghz / 4Gb RAM / OSX 10.7.5 / Motu828 mk1 / MicroKONTROL / Midisport 4x4 / Korg Kaoss Pad II / Nocturn / Wiimote.

broc
Posts: 1151
Joined: Mon Jul 26, 2004 8:37 am

Re: Fire multiple clips at once using LiveAPI

Post by broc » Wed Jul 03, 2013 9:47 am

You could start transport with an API call and afterwards trigger the clips sequentially.
Then all clips will start in sync at the next quantization point.

yannxou
Posts: 148
Joined: Fri Feb 27, 2004 8:39 pm
Location: Barcelona

Re: Fire multiple clips at once using LiveAPI

Post by yannxou » Wed Jul 03, 2013 3:19 pm

broc wrote:You could start transport with an API call and afterwards trigger the clips sequentially.
Then all clips will start in sync at the next quantization point.
That would be a workaround but then clips would be recorded with a 1-bar offset (or the quantization setting) in relation to the other clips that started playing along with the transport.
Live 9 Suite / MaxForLive / MacBook Black 2.4Ghz / 4Gb RAM / OSX 10.7.5 / Motu828 mk1 / MicroKONTROL / Midisport 4x4 / Korg Kaoss Pad II / Nocturn / Wiimote.

yannxou
Posts: 148
Joined: Fri Feb 27, 2004 8:39 pm
Location: Barcelona

Re: Fire multiple clips at once using LiveAPI

Post by yannxou » Sun Sep 15, 2013 9:02 am

Any hope for improvements in LiveAPI for the upcoming 9.1?
Live 9 Suite / MaxForLive / MacBook Black 2.4Ghz / 4Gb RAM / OSX 10.7.5 / Motu828 mk1 / MicroKONTROL / Midisport 4x4 / Korg Kaoss Pad II / Nocturn / Wiimote.

Post Reply