My code basically runs off of function list() which receives the output of midiparse. When a certain note is played, the following code runs:
Code: Select all
function loop(trackNum){
var clipSlot = new LiveAPI("live_set tracks " + trackNum + " clip_slots 0");
if(clipSlot.get("is_recording") == 1){
clipSlot.call("stop")
var clip = new LiveAPI(clipSlot.get("clip"))
var observer = new LiveAPI(playingStatusChange)
observer.path = "live_set tracks " + trackNum + " clip_slots 0 clip"
observer.property = "playing_status"
} else {
if(clipSlot.get("has_clip") == 1){
clipSlot.call("delete_clip")
}
clipSlot.call("fire")
}
}Code: Select all
function playingStatusChange(data){
if(this.get("is_recording") == 0 && this.get("is_playing") == 0 && this.get("is_triggered") == 0) {
if(this.get("length") > 4){
var loopStart = this.get("length") - 4;
this.set("loop_start", loopStart)
this.set("start_marker", loopStart)
}
this.call("fire")
}
}This is where I'm sometimes getting the above mentioned error. The clip always starts playing, so the "fire" call is working, but it'll occasionally skip setting the markers.
So, my question is, is "deferlow" a keyword that I need to add before the .set() calls? I've only found info about the "deferlow" object, but nothing about using it in Javascript. The script has the default outlet but I'm not using it. Should I remove that? Or should I just wire up the outlet to a deferlow object regardless?
Any hints are much appreciated!

