This seems almost too basic inquire about, but I just can’t get my head around how the switching of a dummy button’s state back to zero can be done after it has been triggered for the first time to switch from zero to one. The code below is my basic approach, which works up to the point that button 1 has been toggled from 0 to 1. Only then does the 2nd receiver react etc. I think this is clear. But the push of the hardware encoder identified by receiver 1 should obviously also be able to toggle the button back to state 0. How do you guys do this?
#receiver to accept mackie knob push
EVENT_RECEIVER id= 1 fwd_id=SENDER:1 type=NoteOn chn=1 key= 45 range= 0:127
#letting through only 127 to prevent a double triggering by the note off (vel 0) event
EVENT_SENDER id= 1 hw_id= 1 type=Meta if_equal=RECEIVER:1:127 meta=SendEvent:BUTTON:1:0:1
EVENT_BUTTON id= 1 type=CC button_mode=Toggle range= 0:1
#this receiver will only work after button 1 has been triggered
EVENT_RECEIVER id= 2 fwd_id=SENDER:2 type=NoteOn chn=1 if_equal=BUTTON:1:1 key= 44 range= 127:127
EVENT_SENDER id= 2 type=CC range=0:127
It can not be that complicated I’m probably missing something syntax-wise. And I know this could also be handled by an NGR script, but I have a feeling that I am thinking too complicated. Could anyone maybe show an example of how he/she used a dummy button to enable/disable a functionality in his/her project? Any excerpts would be highly appreciated!
EDIT: Ok, so I think this example is a bit more tidied up..
#receiver to accept mackie knob push
EVENT_RECEIVER id= 1 bank= 0 fwd_id=SENDER:1 type=NoteOn chn=1 key= 45 range= 0:1
EVENT_SENDER id= 1 hw_id= 1 bank= 0 fwd_id=BUTTON:1 if_equal=RECEIVER:1:1
dummy button
EVENT_BUTTON id= 1 bank= 0 type=CC button_mode=Toggle range= 0:1
#if the dummy is not highlighted (value=0) select it and set its value to 1
EVENT_SENDER id= 4 hw_id= 2 type=Meta meta=SendEvent:BUTTON:1:1:1
#if the dummy is highlighted (value=1) select it and set its value to 0
EVENT_SENDER id= 5 hw_id= 2 type=Meta meta=SendEvent:BUTTON:1:0:0
EVENT_RECEIVER id= 10 fwd_id=SENDER:10 type=NoteOn chn=1 if_equal=BUTTON:1:1 key= 44 range= 0:127
EVENT_SENDER id= 10 type=CC range=0:127
EVENT_RECEIVER id= 11 fwd_id=SENDER:11 type=NoteOn chn=1 if_equal=BUTTON:1:0 key= 46 range= 0:127
EVENT_SENDER id= 11 type=CC range=0:127
On program startup the Button’s value is 0, so key 46 can be triggered (44 is disabled) and after triggering key 45 the button’s value is set to 1, as intended.Thus, key 46 is disabled and key 44 now triggerable. But another push on key 45 does not revert the effect! The problem has to lie somewhere in the SENDERs 4&5, but I still do not get how else it should be done.
