TK. Posted September 30, 2015 Report Share Posted September 30, 2015 Hi,in the last months multiple users requested faster execution of .NGR run scripts to cover their use cases. The only way to achieve this is the execution from RAM, and in order to ensure that even the execution of long and complex scripts is possible, the NGR commands have to be compressed (resp. I call it "tokenized")In the last two days I developed a solution for this request - it was a nice programming challenge (although I hate the immense amount of required spaghetti code to cover all options - next time I will use a code generator... ;-)Typically scripts are now executed in much less than 1 mS, which means that it's finally possible to use them for timing critical operations!Only drawback: this feature is only supported for MBHP_CORE_STM32F4, because the other cores don't have enough RAM available - they are executing the script directly from SD Card like before.Here the current version:http://www.ucapps.de/mios32/midibox_ng_v1_033_pre14.zipIt would be helpful if users could help me with the testing by running their existing .NGR files, and maybe also enhancing the files for realtime processing.Any feedback is welcome! :)Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
FantomXR Posted September 30, 2015 Report Share Posted September 30, 2015 Hey Thorsten,do you have any usecase-examples for inspiration? :) Quote Link to comment Share on other sites More sharing options...
TK. Posted October 1, 2015 Author Report Share Posted October 1, 2015 Potential use cases which didn't work properly in the past, but should be possible now:flexible MIDI event converter/router: reacting on incoming MIDI events, e.g. with SEND commands selected via IF/ELSE conditionsfully customized bank handling via SET_ACTIVE command, interactively switched from a fast turned rotary encoderfast keypad entry (you know the example: http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftests%2Frunscr5.ngrAlso this issue should be solved now: http://midibox.org/forums/topic/19477-problem-with-keys-and-runsection-command/Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
FantomXR Posted October 1, 2015 Report Share Posted October 1, 2015 Dear TK,awesome! But the keypad was working flawlessly before anyway :-) Quote Link to comment Share on other sites More sharing options...
Zam Posted October 1, 2015 Report Share Posted October 1, 2015 HiI will try .ngr again for some cascade note command to active and flip automation mode with MCU protocole, I think it will save me lot of sender/receiver event and fwd command in my actual .ngcquestion: is it possible with ram .ngr to write something to scale data in efficient way?like "if Ain=x send midi pitchbend=y" in one direction and "if pitchbend=y send Aout=x" in other directionshould be 1024 (9bit) x2 (in and out) x 8 (pitchbend fader) =16384 line of code for my usecase...doable ?BestZam Quote Link to comment Share on other sites More sharing options...
mumblecake Posted October 1, 2015 Report Share Posted October 1, 2015 Awesome! I will install the version the weekendThanksMathis Quote Link to comment Share on other sites More sharing options...
TK. Posted October 1, 2015 Author Report Share Posted October 1, 2015 question: is it possible with ram .ngr to write something to scale data in efficient way?like "if Ain=x send midi pitchbend=y" in one direction and "if pitchbend=y send Aout=x" in other directionshould be 1024 (9bit) x2 (in and out) x 8 (pitchbend fader) =16384 line of code for my usecase...doable no, IF/ELSE is the wrong approach for this purpose, and the RAM is limited to 16k ;-)But in future I could provide a special command which allows to scale during runtime based on an interpolated curve with n number of nodes. This would consume some additional execution time, but it should be fast enough on a STM32F4 - the memory consumption is then dramatically reduced.In general it's an advantage of the .NGR approach that special commands and mechanisms could be provided in future.Sooner or later I will clean-up the source code to simplify the integration of new commands (I've to improve it anyhow, because currently we've too much quick&dirty spaghetti code)Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Zam Posted October 2, 2015 Report Share Posted October 2, 2015 Hi TKOk I forget my scale table with NRGSo you think real time scaling is better than hard table like the last MF_NG update. memory space VS cpu speed :) To come back with this new version, there is something strange about MAP.let say MAP 1 2 3I have a button pattern command that involve to set button B to the last status (3) if button A is pressed, to ensure next time I press button B it send status 1 whatever status 1 2 or 3 he have before pressing button AButton A and B have the same "system" to ensure each other reset the other to 1It worked well with sender/receiver at NGC. Yesterday with the update I try to "simplify" this with run section and conditional NGR, I try "change" command to do the same function, the button B status change to the respective value forced by button A (debug view) BUT if i press the button B it go cycle to it's own previous value (MAP 1 2 3) without considering what button A just set to him.I reload my previous NGC, it don't work any more ?!?Any idea?BestZam Quote Link to comment Share on other sites More sharing options...
Zam Posted October 2, 2015 Report Share Posted October 2, 2015 To be sure I just checkI load again 1_033 pre6, it work.Something go wrong between pre6 and pre14 regarding toggeling button value with a map:( Quote Link to comment Share on other sites More sharing options...
TK. Posted October 3, 2015 Author Report Share Posted October 3, 2015 In pre7 I added a bugfix for MAPs with duplicated values to cover Bartosz' use case; see also http://midibox.org/forums/topic/19535-encoder-and-maps-problem-bug and http://svnmios.midibox.org/comp.php?repname=svn.mios32&compare[]=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2F%402174&compare[]=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2F%402153Could you please give me a downstripped .NGC file (and/or .NGR in addition) which demonstrates your intention? It could be that due to the changes a new way has to be found.Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Zam Posted October 3, 2015 Report Share Posted October 3, 2015 (edited) Hi TKHere is the .NGC section, it's "beta", and it work with my actual DAW (not bidirectional for led unfortunately),It's under MCU protocol, it allow to switch between read and rec automation with 3 rec mod.One button select read or write, second is write mode (touch, latch, overwrite). Two led (green/red) follow the pattern to light in specific order.The specific "reset" function is red highlighted below. It force last MAP value to ensure first MAP value at next press. Work well with pre6 not with pre14 (I don't try other version).I also have a NGC+NGR allowing bidirectional operation, but it don't work well for the moment at LED side (button patter work fine with less code...). The only DAW return data for read touch or latch (for my led pattern) is a sysex for the mackie LCD update... I don't think it's relevant for the MAP problem we talk now.BestZam ################################################################################# automation mode (work with DP4.6)#########################################################################################################fader 1 button patern########################EVENT_LED id=6 hw_id=6 value=0 EVENT_LED id=3 hw_id=3 value=0MAP10 1 2 3EVENT_BUTTON id=2 hw_id=2 fwd_id=sender:20 range=map10 button_mode=Toggle#touchEVENT_SENDER id=200 hw_id=20 fwd_id=sender:21:127 if_equal=1EVENT_SENDER id=201 hw_id=21 type=NoteOn chn=1 key=0x4b EVENT_SENDER id=202 hw_id=21 type=NoteOn chn=1 key=0x18EVENT_SENDER id=203 hw_id=20 fwd_id=sender:22:0 if_equal=1EVENT_SENDER id=204 hw_id=22 type=NoteOn chn=1 key=0x4b EVENT_SENDER id=205 hw_id=22 type=NoteOn chn=1 key=0x18EVENT_SENDER id=206 hw_id=21 fwd_id=led:6:127EVENT_SENDER id=207 hw_id=21 fwd_id=led:3:127#latchEVENT_SENDER id=210 hw_id=20 fwd_id=sender:23:127 if_equal=2EVENT_SENDER id=211 hw_id=23 type=NoteOn chn=1 key=0x4eEVENT_SENDER id=212 hw_id=23 type=NoteOn chn=1 key=0x18EVENT_SENDER id=213 hw_id=20 fwd_id=sender:24:0 if_equal=2EVENT_SENDER id=214 hw_id=24 type=NoteOn chn=1 key=0x4eEVENT_SENDER id=215 hw_id=24 type=NoteOn chn=1 key=0x18EVENT_SENDER id=216 hw_id=23 fwd_id=led:6:0EVENT_SENDER id=217 hw_id=23 fwd_id=led:3:127#writeEVENT_SENDER id=220 hw_id=20 fwd_id=sender:25:127 if_equal=3EVENT_SENDER id=221 hw_id=25 type=NoteOn chn=1 key=0x4dEVENT_SENDER id=222 hw_id=25 type=NoteOn chn=1 key=0x18EVENT_SENDER id=223 hw_id=20 fwd_id=sender:26:0 if_equal=3EVENT_SENDER id=224 hw_id=26 type=NoteOn chn=1 key=0x4dEVENT_SENDER id=225 hw_id=26 type=NoteOn chn=1 key=0x18EVENT_SENDER id=226 hw_id=25 fwd_id=led:6:0EVENT_SENDER id=227 hw_id=25 fwd_id=led:3:127#reset automation to "read" if button "mode" is activatedEVENT_SENDER id=230 hw_id=20 fwd_id=button:7:1MAP11 1 2EVENT_BUTTON id=7 hw_id=7 fwd_id=sender:70 range=map11 button_mode=toggle#OffEVENT_SENDER id=700 hw_id=70 fwd_id=sender:71:127 if_equal=1EVENT_SENDER id=701 hw_id=71 type=NoteOn chn=1 key=0x4a EVENT_SENDER id=702 hw_id=71 type=NoteOn chn=1 key=0x18EVENT_SENDER id=703 hw_id=70 fwd_id=sender:72:0 if_equal=1EVENT_SENDER id=704 hw_id=72 type=NoteOn chn=1 key=0x4a EVENT_SENDER id=705 hw_id=72 type=NoteOn chn=1 key=0x18EVENT_SENDER id=706 hw_id=71 fwd_id=led:6:0EVENT_SENDER id=707 hw_id=71 fwd_id=led:3:0#readEVENT_SENDER id=710 hw_id=70 fwd_id=sender:73:127 if_equal=2EVENT_SENDER id=711 hw_id=73 type=NoteOn chn=1 key=0x4a EVENT_SENDER id=712 hw_id=73 type=NoteOn chn=1 key=0x18EVENT_SENDER id=713 hw_id=70 fwd_id=sender:74:0 if_equal=2EVENT_SENDER id=714 hw_id=74 type=NoteOn chn=1 key=0x4a EVENT_SENDER id=715 hw_id=74 type=NoteOn chn=1 key=0x18EVENT_SENDER id=716 hw_id=73 fwd_id=led:6:127EVENT_SENDER id=717 hw_id=73 fwd_id=led:3:0#reset automation mode to "touch" if activatedEVENT_SENDER id=720 hw_id=70 fwd_id=button:2:3 Edited October 4, 2015 by Zam Quote Link to comment Share on other sites More sharing options...
TK. Posted October 4, 2015 Author Report Share Posted October 4, 2015 Ok, I tried following minimized configuration:MAP1 1 2 3 EVENT_BUTTON id=1 fwd_id=SENDER:1 range=map1 button_mode=Toggle EVENT_SENDER id=1 type=NoteOn chn=1 key=0x4b EVENT_BUTTON id=2 fwd_id=SENDER:2 button_mode=OnOnly EVENT_SENDER id=2 fwd_id=BUTTON:1:1and found a way to handle your use case.Please try this version: http://www.ucapps.de/mios32/midibox_ng_v1_033_pre15.zipBest Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Zam Posted October 4, 2015 Report Share Posted October 4, 2015 Hi TKJust load it, work again with this pre15 ! Thanks :)I only test my .NGC.Will test with my NGR alternative using change command.BestZam 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.