Duggle Posted April 21, 2013 Report Share Posted April 21, 2013 For my RGB LEDs, I'm changing their colour with a change of bank: EVENT_LED value=127 id=1035 bank=1 rgb=7:15:0 EVENT_LED value=127 id=1035 bank=2 rgb=7:0:15 If I wish to have an LCD text field that similarly changes with the currently selected bank, what is the recommended method? Quote Link to comment Share on other sites More sharing options...
TK. Posted April 21, 2013 Report Share Posted April 21, 2013 Usually it's set with the source which causes the bank change, e.g.: EVENT_BUTTON id=2000 type=Meta meta=SetBank button_mode=OnOnly range=1:1 lcd_pos=1:17:1 label="Bnk%q" Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Duggle Posted April 22, 2013 Author Report Share Posted April 22, 2013 (edited) I'm noticing that the message for the default bank (=1, in this case) is not printed on startup, but only appears when the bank is re-selected. EVENT_BUTTON id=8 fwd_id=LED:33 type=Meta meta=SetBank button_mode=OnOnly range=1:1 radio_group=1 lcd_pos=1:1:1 label="^HdBank1" value=1 EVENT_BUTTON id=7 fwd_id=LED:34 type=Meta meta=SetBank button_mode=OnOnly range=2:2 radio_group=1 lcd_pos=1:1:1 label="^HdBank2" Also is there a limit on the content of the LABEL HdBank in this situation? "^HdBank" is 238 chars long and contains about 16 "@(x:y:z)" cursor movements. [edit] I've noticed a statement like LABEL Abc "" causes the whole LCD array to go blank. This is confusing and seemingly unnecessary (at least a warning would be nice). Edited April 22, 2013 by Duggle Quote Link to comment Share on other sites More sharing options...
Duggle Posted April 22, 2013 Author Report Share Posted April 22, 2013 The problem of these LCD strings not displaying at startup is still a problem. Apart from this, it's now working as expected except: LABEL HdBank1 "@(1:1:1) OSCILLATOR 1 @(2:1:1) OSCILLATOR 2 @(3:1:1)FILTER1 @(3:9:1) FILTER2@(4:1:1)FILTER*ADSR**AMP@(17:1:2)OSC3 SUB @(18:1:2)MIXER @(18:9:2)VELOCITY@(19:1:2) VELOCITY @(20:1:2) OSC @(20:9:2) MISC " the last 2 headings are missing i.e "OSC" and "MISC". The LCD 20 is working fine. Is there a reason the string may be truncated? Quote Link to comment Share on other sites More sharing options...
TK. Posted April 22, 2013 Report Share Posted April 22, 2013 Ok, I see your points. So, the new recommended method is to use a dummy LED event, which will be triggered after startup, and on any bank change. Such as: # This is a dummy LED without assigned hardware (hw_id=2000 not used anywhere else) and without MIDI event. # the purpose of this EVENT item is to print the bank whenever the LCD is refreshed (e.g. after startup or bank change) EVENT_LED id=2000 fwd_to_lcd=1 lcd_pos=1:1:1 label="Bnk%q" Complete example: http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_ng_v1%2Fcfg%2Ftemplates%2Flre8x2.ngc As you can see, this method will also allow you to define multiple dummy events to display strings at different positions. Btw.: the same method can be used to print static strings as well. Also is there a limit on the content of the LABEL HdBank in this situation? yes, the limitation is 200 characters for the whole command line... but I think that I could use the same code like for .NGC file meanwhile (since it seems to work stable), which would allow to parse up to 1024 characters. There is another limitation: the max. label length is 248 characters - due to the current 200 char limitation of the parser you haven't got the related error message. So - this will be fixed with the next release. /edit: the fix is already in the repository. I've noticed a statement like LABEL Abc "" causes the whole LCD array to go blank. This is confusing and seemingly unnecessary (at least a warning would be nice). I can't reproduce this, please provide a downstripped example. Of course, an empty label string shouldn't clear the screen... Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Duggle Posted April 23, 2013 Author Report Share Posted April 23, 2013 So, the new recommended method is to use a dummy LED event, which will be triggered after startup, and on any bank change. As you can see, this method will also allow you to define multiple dummy events to display strings at different positions. Btw.: the same method can be used to print static strings as well. Nice, simple! My Headings string has a lot of embedded " " (space) in that makes it longer, the purpose of which is to align the headings, but also to erase what was there before. There is no "clear all" similar to "%C" that would clear the entire array? (I guess the problem with that idea is that it would need to happen before anything else, otherwise new content might get erased... Anyhow, I'll try the new build and the new method to display the headings. Thanks! I can't reproduce this, please provide a downstripped example. Of course, an empty label string shouldn't clear the screen... In my NGL: LABEL HdBank1 "..." LABEL HdBank2 "" LABEL HdBank3 "" LABEL HdBank4 "" was enough to cause this, so I make sure the unused strings contain at least a space. Also in the example above, only HdBank1 was being referenced by a "label=^HdBank1" Quote Link to comment Share on other sites More sharing options...
Duggle Posted April 23, 2013 Author Report Share Posted April 23, 2013 The default bank LCD strings are showing at startup using the EVENT_LED technique. The string (which is 216 chars) is now displaying in full Thanks! Quote Link to comment Share on other sites More sharing options...
TK. Posted April 23, 2013 Report Share Posted April 23, 2013 Ok, now I understand the problem: the empty labels caused an error message. Accordingly no new .bin file was generated (by intention), and therefore your labels haven't been updated. Probably you cleared the screen in the previous definitions (which were valid), right? I changed the error message into a warning. But since you overlooked the error message, it's very likely that the warning could confusion in future as well... ;-) Best Regards, Thorsten. 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.