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!
Possible to grab index of pad on release?
-
- Liine Staff
- Posts: 126
- Joined: 14 Dec 2011 12:12
Re: Possible to grab index of pad on release?
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.
Try the module attached.
- Attachments
-
- ReleaseDetection.jzlib.zip
- (969 Bytes) Downloaded 110 times
-
- Newbie
- Posts: 4
- Joined: 26 Jan 2012 21:20
Re: Possible to grab index of pad on release?
Excellent! This is very helpful. Thank you.
Re: Possible to grab index of pad on release?
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?
Re: Possible to grab index of pad on release?
Hi
Think of it as logic not comparison
psuedo-code
released = 1 if x lessthan last_state 0 otherwise
Cheers
MM
Think of it as logic not comparison
psuedo-code
released = 1 if x lessthan last_state 0 otherwise
Cheers
MM
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
-
- Liine Staff
- Posts: 126
- Joined: 14 Dec 2011 12:12
Re: Possible to grab index of pad on release?
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).
Re: Possible to grab index of pad on release?
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.