example of m4l with javascript
The code supplied in the documentation isn't working for me. Could somebody please point me to a completed device that uses the JavaScript liveapi Object?
can you give me some what kind or what your device expect to do in Live?
I need to access all the clips in the set, the current clip,and the current position.
Frankly anything that uses the liveapi onject would be fine; I could probably navigate from there.
would love this as well.. if anyone has links or sources to basic javascript functions for basic tasks in m4l, that would be way easier than trying to find abstractions imo! Would love to see a tools or code base for this kind of thing. I'm trying to get a count of available clips on a track for starters. But would also love to see things like, get selected track ID, get selected track index, etc. Here's an example of a function to get the track count:
outlets=1;
function getTrackCount() {
var live_set_path = "live_set";
var live_set = new LiveAPI(null, live_set_path);
var trackCount= live_set.getcount("tracks");
for (var i=0 ; i<trackCount ; i++) {
var track_path = live_set_path+" tracks "+i;
var track = new LiveAPI(track_path);
track.property = "playing_slot_index";
}
outlet(0, trackCount);
}