General
Possible to grab index of pad on release?
Started by malkomalko on .
Sign in or create an account to join the conversation.
Hi there,
I know you can get the index value of a pad by firstof(SynthPad1.x), but this only seems to work when ascending x (key down) and it always returns the same value on descending x (key up).
Thanks!
I know you can get the index value of a pad by firstof(SynthPad1.x), but this only seems to work when ascending x (key down) and it always returns the same value on descending x (key up).
Thanks!
You could use a script that saves the last known state of a Pads object to a variable. The last known state can be compared to the new state whenever Pads.x change.
Try the module attached.
ReleaseDetection.jzlib.zip
Try the module attached.
ReleaseDetection.jzlib.zip
Excellent! This is very helpful. Thank you.
Could you please explain the follwing line in your code:axel_liine wrote:You could use a script that saves the last known state of a Pads object to a variable. The last known state can be compared to the new state whenever Pads.x change.
Try the module attached.
released = x < last_state;
How does this declaration/comparison works?
Hi
Think of it as logic not comparison
[size=85]psuedo-code[/size]
released = 1 if x lessthan last_state 0 otherwise
Cheers
MM
Think of it as logic not comparison
[size=85]psuedo-code[/size]
released = 1 if x lessthan last_state 0 otherwise
Cheers
MM
Anytime you use a comparison operator, the returned value is '1' id the comparison is true, and '0' otherwise. When comparing two arrays of the same length, the returned value is an array itself, containing the result of the comparison item by item.kraftf wrote:Could you please explain the follwing line in your code:axel_liine wrote:You could use a script that saves the last known state of a Pads object to a variable. The last known state can be compared to the new state whenever Pads.x change.
Try the module attached.
released = x < last_state;
How does this declaration/comparison works?
So here, 'released' will contain ones for each pad whose new 'x' value is inferior than the last (i.e released), and zeroes otherwise (i.e unchanged or pressed).
Thanks for the reply Axel, you've been really helpful.
I have to get to work to clarify some logics of Lemur.
Some things are not so imminent how they work.
I have to get to work to clarify some logics of Lemur.
Some things are not so imminent how they work.