looping without max4live
Posted: 26 May 2012 00:32
I am trying to set up a pad to trigger a four bar loop from the lemur, I have setup a observer in Max for Live of the float value "playingpos' property which is streaming to a global variable. (Is this actually possible ?)
I believe these are the steps I need to make this loop work? For some reason no MIDI is triggered.
1. set variable 'loopoutpos' to +4 beats of rounded global variable 'playingpos' value when pad is triggered (the point in time where Lemur should send the MIDI message to trigger loop out command in ABLETON)
2. loop performs nothing until 'playingpos' value becomes greater then 'loopoutpos' (instructed by a 'do' and 'while' commands) <---- not sure about this?
3. when playingpos>loopoutpos output midi to trigger loop out in Ableton.
This is what i have so far:
decl loopoutpos=round(playingpos) +4;
do;
while (playingpos<loopoutpos);
noteout(03,01,27,1);
I have read in the manual endless loops are terminated, which could be present here?
I don't know how long it takes for an endless loop to be noticed, in this case maybe before 4bars?
So I tried using User-Defined variables instead...
When button is pressed =
1. Set User-Defined Variable 'loopoutpos' to +4 beats of rounded global variable 'playingpos' value
2. Set User-Defined Variable 'switch' to 1
{
loopoutpos=round(playingpos) +4;
switch=1;
}
Script Executed whenever user-defined variable 'playingpos' increments.
When variable 'playingpos' is greater (or equal) to variable 'loopoutpos', and variable 'switch' = 1 it sets the switch to 0 (to stop Lemur sending MIDI constantly).
Then sends a midi message to trigger looop-out in ableton.
if (playingpos>=loopoutpos && switch==1);
switch=0;
noteout(0,01,27,1);
With this method it sends MIDI all the time, and sets variable 'switch' to 0 all the time. I am new to Lemur, please keep condescension to yourself ! Thankyou
I believe these are the steps I need to make this loop work? For some reason no MIDI is triggered.
1. set variable 'loopoutpos' to +4 beats of rounded global variable 'playingpos' value when pad is triggered (the point in time where Lemur should send the MIDI message to trigger loop out command in ABLETON)
2. loop performs nothing until 'playingpos' value becomes greater then 'loopoutpos' (instructed by a 'do' and 'while' commands) <---- not sure about this?
3. when playingpos>loopoutpos output midi to trigger loop out in Ableton.
This is what i have so far:
decl loopoutpos=round(playingpos) +4;
do;
while (playingpos<loopoutpos);
noteout(03,01,27,1);
I have read in the manual endless loops are terminated, which could be present here?
I don't know how long it takes for an endless loop to be noticed, in this case maybe before 4bars?
So I tried using User-Defined variables instead...
When button is pressed =
1. Set User-Defined Variable 'loopoutpos' to +4 beats of rounded global variable 'playingpos' value
2. Set User-Defined Variable 'switch' to 1
{
loopoutpos=round(playingpos) +4;
switch=1;
}
Script Executed whenever user-defined variable 'playingpos' increments.
When variable 'playingpos' is greater (or equal) to variable 'loopoutpos', and variable 'switch' = 1 it sets the switch to 0 (to stop Lemur sending MIDI constantly).
Then sends a midi message to trigger looop-out in ableton.
if (playingpos>=loopoutpos && switch==1);
switch=0;
noteout(0,01,27,1);
With this method it sends MIDI all the time, and sets variable 'switch' to 0 all the time. I am new to Lemur, please keep condescension to yourself ! Thankyou