ilmenator Posted January 20, 2017 Report Share Posted January 20, 2017 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 Quote Link to comment Share on other sites More sharing options...
Zam Posted January 21, 2017 Report Share Posted January 21, 2017 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 Quote Link to comment Share on other sites More sharing options...
FantomXR Posted January 21, 2017 Report Share Posted January 21, 2017 Ha! Tricky..... ;-) Quote Link to comment Share on other sites More sharing options...
Zam Posted January 21, 2017 Report Share Posted January 21, 2017 (edited) 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 Edited January 21, 2017 by Zam Quote Link to comment Share on other sites More sharing options...
ilmenator Posted January 21, 2017 Author Report Share Posted January 21, 2017 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 Quote Link to comment Share on other sites More sharing options...
Zam Posted January 22, 2017 Report Share Posted January 22, 2017 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 Quote Link to comment Share on other sites More sharing options...
ilmenator Posted January 22, 2017 Author Report Share Posted January 22, 2017 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 Quote Link to comment Share on other sites More sharing options...
Zam Posted January 22, 2017 Report Share Posted January 22, 2017 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 Quote Link to comment Share on other sites More sharing options...
ilmenator Posted January 22, 2017 Author Report Share Posted January 22, 2017 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 Quote Link to comment Share on other sites More sharing options...
Zam Posted January 22, 2017 Report Share Posted January 22, 2017 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 Quote Link to comment Share on other sites More sharing options...
ilmenator Posted January 22, 2017 Author Report Share Posted January 22, 2017 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.