Forums > Max For Live

js observe clip added using "name" property

September 25, 2013 | 7:22 am

Hi,

In JS Im observing the "name" property of all clips in a track, but if a new clip is added there is no notification of this in JS. However, when using the live.observer object in max it at least outputs "empty".

Im wondering why this is? and if there is any way around it?

As a workaround im trying to observe the "has_clip" property of the clip_slot. However, I cannot observe both "has_clip" and "name" in the same function. Is there any way to share arguments across callback functions?

Cheers


September 25, 2013 | 7:58 am

Here is a demo of the problem. The JS version observes clip_slot 1 on track 1. Im expecting for something to be printed in the max window when I add a clip to clip_slot 0, or 1. The live.object is observing clip_slot 0 and it outputs "empty" , but with JS clip_slot 1, nothing gets printed.

<code>

– Pasted Max Patch, click to expand. –

</code>

And the JS

autowatch = 1;
outlets = 1;

names = [];

function bang() {

loadclips();

}

function loadclips() {

names = new LiveAPI(this.patcher, 1, clipname, "live_set tracks 0 clip_slots 1 clip");
names.property = "name";

}

function clipname(args) {
post(args);
}


September 25, 2013 | 1:02 pm

Anyone?

Its also frustrating/confusing that html tags cannot be included in a post, since these are used to denote an empty clip in maxforlive

Is there any way to share data across different callback functions, that are observing properties?


Viewing 3 posts - 1 through 3 (of 3 total)