button_mode=cycle ?

Hi all,

 

I have a situation in which I would like to cycle between different cc values (say, B0 14 xx) by pressing a single button various times:

  1. Whenever I press “Direction”, the cc value should be increased, i.e. first sending a value of say xx=2 for “up”, then xx=20 for “down”, xx=38 for “up & down”, and so forth, and finally something like xx=120 for “chord”. The next button press should get me back to xx=2 for “up”. How could this be done? Using a meta event?

  2. Because of space constraints on the frontpanel, I’d like to save the LED for the “up & down” value, and instead have both the “up” and the “down” LED lit for cc value xx=38 (as per the example above). How could I realize this exception?

Thanks for your help, ilmenator

Hi

Using map and toggle mode should work, as fwd to sender and meta should work for led

 

at NGC

MAP1 2 20 38 …120

EVENT_BUTTON …fwd_id=sender:1 … range=MAP1 button_mode=toggle

EVENT_SENDER…type=meta meta=runsection:1

at NGR

section1

if button == 2

 set led:(up):127

set led:(down):0

set led:(random):0

set led:(played):0

set led:(chord):0

endif

if button == 20

 set led:(up):0

set led:(down):127

set led:(random):0

set led:(played):0

set led:(chord):0

endif

if button == 38

 set led:(up):127

set led:(down):127

set led:(random):0

set led:(played):0

set led:(chord):0

endif

etc…

 

Best

Zam

Ha! Tricky… ;-) 

I just have another idea without NGR but radio_group for led

not sure it will work but it deserve a try

 

at NGC

MAP1 2 20 38 …120

EVENT_BUTTON hw_id=(direction) fwd_id=sender:1 range=MAP1 button_mode=toggle

EVENT_SENDER hw_id=1 id=100 type=CC CC=xx #to send out the CC

EVENT_SENDER hw_id=1 id=101 fwd_id=led:(up):127 if_equal=2 radio_group=1 #UP

EVENT_SENDER hw_id=1 id=102 fwd_id=led:(down):127  if_equal=20 radio_group=1 #DOWN

EVENT_SENDER hw_id=1 id=103 fwd_id=sender:2:127 if_equal=38 radio_group=1 #UP&DOWN

EVENT_SENDER hw_id=2 id=201 fwd_id=led:(up)

EVENT_SENDER hw_id=2 id=202 fwd_id=led:(down)

EVENT_SENDER hw_id=1 id=104 fwd_id=led:(random):127 if_equal=64 radio_group=1 #RANDOM

etc…

If it work, it’s also an easy way to lit led from incoming CC with

EVENT_RECEIVER …fwd_id=sender:1

 

Best

Zam

 

 

 

10 hours ago, Zam said:

I just have another idea without NGR but radio_group for led

not sure it will work but it deserve a try

Hi Zam,

thanks a lot for this hint - it actually works quite nicely, here is the complete code in case anyone wants to adopt this:

MAP1 2 26 52 76 102 125 # EVENTs EVENT\_BUTTON hw\_id=25 fwd\_id=sender:1 range=MAP1 value=2 button\_mode=toggle EVENT\_SENDER hw\_id=1 id=100 type=CC CC=103 ports=10000100000000000000 #to send out the CC EVENT\_SENDER hw\_id=1 id=101 fwd\_id=sender:3 if\_equal=2 radio\_group=1 #UP EVENT\_SENDER hw\_id=3 id=301 fwd\_id=led:17:127 EVENT\_SENDER hw\_id=3 id=302 fwd\_id=led:18:0 EVENT\_SENDER hw\_id=3 id=303 fwd\_id=led:19:0 EVENT\_SENDER hw\_id=3 id=304 fwd\_id=led:20:0 EVENT\_SENDER hw\_id=3 id=303 fwd\_id=led:21:0 EVENT\_SENDER hw\_id=1 id=102 fwd\_id=sender:4 if\_equal=26 radio\_group=1 #DOWN EVENT\_SENDER hw\_id=4 id=401 fwd\_id=led:17:0 EVENT\_SENDER hw\_id=4 id=402 fwd\_id=led:18:127 EVENT\_SENDER hw\_id=4 id=403 fwd\_id=led:19:0 EVENT\_SENDER hw\_id=4 id=404 fwd\_id=led:20:0 EVENT\_SENDER hw\_id=4 id=405 fwd\_id=led:21:0 EVENT\_SENDER hw\_id=1 id=103 fwd\_id=sender:2 if\_equal=52 radio\_group=1 #UP&DOWN EVENT\_SENDER hw\_id=2 id=201 fwd\_id=led:17:127 EVENT\_SENDER hw\_id=2 id=202 fwd\_id=led:18:127 EVENT\_SENDER hw\_id=2 id=203 fwd\_id=led:19:0 EVENT\_SENDER hw\_id=2 id=204 fwd\_id=led:20:0 EVENT\_SENDER hw\_id=2 id=205 fwd\_id=led:21:0 EVENT\_SENDER hw\_id=1 id=104 fwd\_id=sender:5 if\_equal=76 radio\_group=1 #RANDOM EVENT\_SENDER hw\_id=5 id=501 fwd\_id=led:17:0 EVENT\_SENDER hw\_id=5 id=502 fwd\_id=led:18:0 EVENT\_SENDER hw\_id=5 id=503 fwd\_id=led:19:127 EVENT\_SENDER hw\_id=5 id=504 fwd\_id=led:20:0 EVENT\_SENDER hw\_id=5 id=505 fwd\_id=led:21:0 EVENT\_SENDER hw\_id=1 id=105 fwd\_id=sender:6 if\_equal=102 radio\_group=1 #PLAYED EVENT\_SENDER hw\_id=6 id=601 fwd\_id=led:17:0 EVENT\_SENDER hw\_id=6 id=602 fwd\_id=led:18:0 EVENT\_SENDER hw\_id=6 id=603 fwd\_id=led:19:0 EVENT\_SENDER hw\_id=6 id=604 fwd\_id=led:20:127 EVENT\_SENDER hw\_id=6 id=605 fwd\_id=led:21:0 EVENT\_SENDER hw\_id=1 id=106 fwd\_id=sender:7 if\_equal=125 radio\_group=1 #CHORD EVENT\_SENDER hw\_id=7 id=701 fwd\_id=led:17:0 EVENT\_SENDER hw\_id=7 id=702 fwd\_id=led:18:0 EVENT\_SENDER hw\_id=7 id=703 fwd\_id=led:19:0 EVENT\_SENDER hw\_id=7 id=704 fwd\_id=led:20:0 EVENT\_SENDER hw\_id=7 id=705 fwd\_id=led:21:127

 

Thanks again, ilmenator

Hello ilmenator

Your welcome !

You already fix my mistake and missing sytax.

One last point, I don’t know if you need to also control this from external.

In case, it will work with an event receiver fwd to sender 1 as I previously say, but you will have a loop with your sender 100 (hw1), I think you can remove this event and just use directly the button to send CC.

Also you need a mechanism to update button value from external CC otherwise you will have offset and jump at toggle function

something like this:

 

event_receiver id=1   fwd_id=sender:1000  type=CC CC=103 range=MAP1 ports=10000100000000000000

event_sender hw_id=1000 id=1000 fwd_id=sender:1

event_sender hw_id=1000 id=1001 fwd_id=button:25:2  if_equal=2

event_sender hw_id=1000 id=1002 fwd_id=button:25:26  if_equal=26

event_sender hw_id=1000 id=1003 fwd_id=button:25:52  if_equal=52

event_sender hw_id=1000 id=1004 fwd_id=button:25:76  if_equal=76

event_sender hw_id=1000 id=1005 fwd_id=button:25:102  if_equal=102

event_sender hw_id=1000 id=1006 fwd_id=button:25:125  if_equal=125

 

 

Best

Zam

 

Yes, this will be the next step, but it is getting more complex than just that: the external messages are different, i.e. the machine I am trying to control is accepting the CCs as above, but is sending out NRPNs and Data (CC#6, CC#38) messages instead… and, these are not spanning the whole range from 0 to 127. I’ll see if I can also just send back the same messages (NRPN and DATA) to control it.

One more thing I would like to fix is that upon a power cycle, the initial value is set correctly to 2, but the corresponding LED is not lit (none of the LEDs shines). Also, after the upload of a new .NGC file version, the LED status remains, even though the value has been reset to 2. It takes a button press first to “synchronize” the LEDs. How could I get the LEDs right from the start?

Best, ilmenator

Hi

You have to set initial value for LEDs too ?

EVENT\_LED id=17 value=127 EVENT\_LED id=18 value=0 EVENT\_LED id=19 value=0 EVENT\_LED id=20 value=0 EVENT\_LED id=21 value=0

Also IIRC I have same kind of issue you describe here, try to put led event definition before or after (don’t remember) the other button/sender definition.

Best

Zam

Hi Zam,

thanks, that actually does the trick after uploading the new .NGC: then, the LEDs are lit correctly. However, after power cycling the box or sending a reset command via the command line, this is not the case and all LEDs are off, no matter whether the LED event definition is coming before or after the corresponding button or sender definition(s). Have you solved this for your box, or are you still working on this problem?

Best, ilmenator

Hi

My box don’t require (for now) lit LED at startup so I don’t go further.

I see two option right now:

-NGR with : set/change led at section 0

-a snapshot

Best

Zam

 

Well thanks anyways! I might as well need to analyse the current patch status and interpret a SysEx stream from the target machine, so I’ll probably have to set the LED status manually in any case at a later time.