Alright, this is REALLY screwed up...
Posted: 23 Feb 2017 19:35
Sorry for the subject, but try this and see if you don't agree,
Overview: a script which randomizes a monitor's value, attached to a pad's OnExpression x Up Trigger Mode. Tha Pad is named Pad:
Another script, attached to a second pad's OnExpression x Up Trigger Mode, which sets the first pad's x expression to 1, then back to 0. The pad is named OnOffBtn:
Pressing Pad works as expected. Pressing OnOfBtn does nothing. WHY?????? So, further investigation:
changing the script to:
results in a new random number, and the pad stays lit, as expected. Changing it to:
turns the pad off, as expected. So:
The trap is sprung. Pad.x IS going to 1, but its script triggered on x up is still NOT executing.
I'm thinking maybe Lemur is tripping over itself? Lets add a little loop to delay the Pad.x=0:
Here's where it gets even weirder. The astute among you are wondering, no doubt, "Why 9997???" I'm glad you asked that. Because, friends, for any value <=9997, the loop makes NO DIFFERENCE. But at >=9998, Pad.x=0 IS NEVER EXECUTED. This is where I throw my arms up and say:
WTF???????!!!!!
Attached is a small test template demonstrating this, for your listening pleasure
Overview: a script which randomizes a monitor's value, attached to a pad's OnExpression x Up Trigger Mode. Tha Pad is named Pad:
Code: Select all
Monitor.value = rand();
Code: Select all
Pad.x = 1;
Pad.x = 0;
changing the script to:
Code: Select all
Pad.x = 1;
//Pad.x = 0;
Code: Select all
//Pad.x = 1;
Pad.x = 0;
Code: Select all
Pad.x = 1;
if (Pad.x==1){ // read the value right from the pad itself
TrapPadXVal.value = Pad.x; // add another monitor to read and trap the value of Pad.x if it goes to 1 even for an instant
Pad.x = 0; // turn it off ONLY if it's already on
}
I'm thinking maybe Lemur is tripping over itself? Lets add a little loop to delay the Pad.x=0:
Code: Select all
Pad.x = 1;
if (Pad.x==1){ // read the value right from the pad itself
TrapPadXVal.value = Pad.x; // add another monitor to read and trap the value of Pad.x if it goes to 1 even for an instant
decl i;
for(i=0;i<9997;i++){ // loop to add a little delay
}
Pad.x = 0; // turn it off ONLY if it's already on
}
WTF???????!!!!!
Attached is a small test template demonstrating this, for your listening pleasure