Hi everyone,
I'm fairly new to Lemur, and I'm having trouble with a particular script. I want to have three buttons, and have each button output different midi note on/off messages based on the current status of the other two buttons.
So, in other words, when the #1 button is pressed, I want it to query the #2 button and the #3 button and output accordingly based on the status of buttons #2 and #3. So there would be 7 different possible midi notes sent, as there are 7 different possible combinations of off/on that the three buttons could be in at any given time. I also want the same thing to occur whenever a button is turned off as well.
I've successfully done this with two buttons, which I've attached below, but adding a third button seems to complicate things. I think if I could see the proper way to script "when I press button 1, if button 2 and 3 are off then output C1, but if button 2 is on but 3 is off then output D1 etc" then I could probably figure out the rest. I hope I'm explaining this sufficiently. I've searched and searched and my brain is numb. Any help would be much appreciated. Thanks so much!
-craig
3 Interacting Buttons Script. Help!
3 Interacting Buttons Script. Help!
- Attachments
-
- switcher attempt.jzml
- (3.01 KiB) Downloaded 45 times
Re: 3 Interacting Buttons Script. Help!
In a fast thinking of it (there might be a more elegant script to pull it off)....
For button 1, if button 2 is off -> if button 3 is on do this, if button 3 is off do that
else (so that means if button 2 is on)
-> if button 3 is on do this, if button 3 is off do that
For example lets say for the button HH, noteOn()
hereis my example above with a third button called CL at button HH noteOn() (didnt do the rest)
For button 1, if button 2 is off -> if button 3 is on do this, if button 3 is off do that
else (so that means if button 2 is on)
-> if button 3 is on do this, if button 3 is off do that
For example lets say for the button HH, noteOn()
Code: Select all
if (Snr.x==0){
if (Cl.x==0){
noteout(0,12,127,1);
}
else noteout(0,14,0,1);
}
else
{
if (Cl.x==0){
noteout(0,12,127,1);
}
else noteout(0,14,0,1);
}
hereis my example above with a third button called CL at button HH noteOn() (didnt do the rest)
- Attachments
-
- switcher.jzml
- (4.5 KiB) Downloaded 48 times
Re: 3 Interacting Buttons Script. Help!
That's a big help, thanks!