ssp

understanding the .ngc code

113 posts in this topic

happy face this evening, needed to test some controls on a plugin and i just sat and wrote the code straight in and it worked first time, really happy guy!

Share this post


Link to post
Share on other sites

I have had to admit defeat on the NRPN's tonight and have msg'd Thorsten for some advice/help.  the latest rev is great for the negatives etc, but its the dual commands i am stuck with and working out the values for nrpn and lsb msb etc. Crazy math frying my brain.

Share this post


Link to post
Share on other sites

Just sat working on a conditional label test and something wierd is happening.

I made two files test.ngc and test.ngl with one encoder attached

in the .ngc

RESET_HW

# this command is part of a .NGC file:

ENC n=  1   sr=1 pins=0:1   type=detented3

EVENT_ENC    id=  1  type=CC  cc=16 range= 0:127 lcd_pos=1:1:1 label="^Destpanel "

in the .ngl

COND_LABEL   Destpanel
COND =0    "VCO1 FREQ"
COND =1    "VCO1 PW  "
COND =2    "VCO1 VOL "
COND =3    "VCO2 FREQ"
COND =4    "VCO2 PW  "
COND =5    "VCO2 VOL "
COND_ELSE  "--------"

 

On the 2x40 display all i get in the first line character is the "l" nothing else however, If i change ^Destpanel  to just ^Dest then it shows VCO1 FREQ on the lcd.  Why if i put the full ^destpanel am i getting the leter L instead?

 

It seems it only likes 8 characters, by removing 1 letter on each ^Destpanel to ^Destpane it works.

Is there an 8 character limit on the "Cond_Label" title name? if so can this be changed anywhere?

 

 

Edited by ssp

Share this post


Link to post
Share on other sites

^Destpane is a variable, not a string. It's likely that there is a character limit on those.

Share this post


Link to post
Share on other sites

I ran into this a while ago. From the docs for NGL:

Quote

The size of a label is limited to 8 characters to avoid unnecessary compute overhead while searching for matching strings.

 

Share this post


Link to post
Share on other sites
2 hours ago, jjonas said:

I ran into this a while ago. From the docs for NGL:

 

I didnt see this, thanks for the heads up on this jjonas, most appreciated!!  it would be nice though as its a 2x40 and im using 8 encoders to be able to balance this out to 10 max characters per label. because you can then reduce it per your needs.

 

I wonder if this is something that Thorsten could implement ? where you can set your max characters in the .ngl file

Share this post


Link to post
Share on other sites

I think what's limited to 8 characters is the label variable (like ^destpane), not the actual string that's displayed on the LCD. In your example above you have strings that are more than 8 characters ("VCO1 FREQ" has 9 characters), and in fact you're not limited to 8 characters with the "VCO1 FREQ" style texts you want to show on the LCD. The variable length in characters (^destpane) and the string length in characters ("VCO1 frequency") are not related, so you can have short variable names and long strings for them.

Edited by jjonas
typo + clarification

Share this post


Link to post
Share on other sites
Just now, jjonas said:

I think what's limited to 8 characters is the label variable (like ^destpane), not the actual string that's displayed on the LCD. In your example above you have strings that are more than 8 characters ("VCO1 FREQ" has 9 characters), and in fact you're not limited to 8 characters with the "VCO1 FREQ" style texts you want to show on the LCD. The variable length in characters (^destpane) and the string length in characters ("VCO1 frequency") are not related, so you can have short variable names and long strings for them.

Ah got it. i will change the the label variable to a abbreviated syntax instead, i can define my own syntax list then in the .ngl file and reference that.

 

Thanks again.

Share this post


Link to post
Share on other sites

Had a little fun checking this out tonight, all working fine, I applied 8 enocders to various functions and then gave each label 10 characters on the lcd top and bottom row.

1. you define the amount of max characters by the spaces between the ".........." commas. For example if i put "VCO1 FILT " there are 9 characters and a single blank space. The next free character is 11

The spacing is then on a 40x2 display:

pos 1= 1:1:1   pos 2= 1:11:1   pos 3=1:21:1  pos 4=1:31:1
pos 5= 1:1:2   pos 6= 1:11:2   pos 7=1:21:2  pos 8=1:31:2

For the COND_LABEL  is used Dp1

so I wrote this to test

RESET_HW

# 40x2 10 character per 8 encoder test

ENC n=  1   sr=1 pins=0:1   type=detented3
EVENT_ENC    id=  1 fwd_to_lcd=1  type=CC  cc=16 range= 0:127 lcd_pos=1:1:1 label="^Dp1"
ENC n=  2   sr=1 pins=2:3   type=detented3
EVENT_ENC    id=  2 fwd_to_lcd=1  type=CC  cc=17 range= 0:127 lcd_pos=1:11:1 label="^Dp2"
ENC n=  3   sr=1 pins=4:5   type=detented3
EVENT_ENC    id=  3 fwd_to_lcd=1  type=CC  cc=18 range= 0:127 lcd_pos=1:21:1 label="^Dp3"
ENC n=  4   sr=1 pins=6:7   type=detented3
EVENT_ENC    id=  4 fwd_to_lcd=1  type=CC  cc=19 range= 0:127 lcd_pos=1:31:1 label="^Dp4"
ENC n=  5   sr=1 pins=0:1   type=detented3
EVENT_ENC    id=  5 fwd_to_lcd=1  type=CC  cc=20 range= 0:127 lcd_pos=1:1:2 label="^Dp5"
ENC n=  6   sr=1 pins=2:3   type=detented3
EVENT_ENC    id=  6 fwd_to_lcd=1  type=CC  cc=21 range= 0:127 lcd_pos=1:11:2 label="^Dp6"
ENC n=  7   sr=1 pins=4:5   type=detented3
EVENT_ENC    id=  7 fwd_to_lcd=1  type=CC  cc=22 range= 0:127 lcd_pos=1:21:2 label="^Dp7"
ENC n=  8   sr=1 pins=6:7   type=detented3
EVENT_ENC    id=  8 fwd_to_lcd=1  type=CC  cc=23 range= 0:127 lcd_pos=1:31:2 label="^Dp8"

then there were the .NGL conditional labels in thier own tables from Dp1 to Dp8, I was really pleased it all worked first time and did what I wanted it to.

Going to play with banks again tomorrow and see if how i can implement that in as well.

IMG_20200209_215940_resized_20200209_103159675.jpg

Edited by ssp

Share this post


Link to post
Share on other sites

I have been playing with banks and cond labels again today all went well.  I was pondering something though.

If i have a series of values i want to control from 3 knobs, so there are two lines of values, and 8 on each line, what i want to do to reduce the amount of encoders is have one for moving in the y direction between line 1 and line 2, then one to move in the "x" direction to step between 1 to 8 in the line, then a final encoder to change the value of the selcted cc#.

in a basic explanation (not real code!!)

Y= enc_1  if<64 line=1
Y= enc_1  if<127 line=2

X= enc_2  if<10 cc16  
X= enc_2  if<20 cc17
X= enc_2  if<30 cc18
X= enc_2  if<40 cc18

Value= enc_3 type=CC ......... this encoder would have to change its code on each movement over x&y so cc=16, cc=17,cc=18 etc.

Is it possible to do this in the .ngc?

 

5e47d6ae2894d_selmtrx.thumb.png.e56ba33d

 

Share this post


Link to post
Share on other sites

panel test day, checking fitment on led's and tact switches, then the pcb.

sem.thumb.jpg.f81ba7729755dfa3d8d7deb32e

Share this post


Link to post
Share on other sites

Hello

 

1 hour ago, ssp said:

If i have a series of values i want to control from 3 knobs, so there are two lines of values, and 8 on each line, what i want to do to reduce the amount of encoders is have one for moving in the y direction between line 1 and line 2, then one to move in the "x" direction to step between 1 to 8 in the line, then a final encoder to change the value of the selcted cc#.

Is it possible to do this in the .ngc?

Don't know if you can do this without a script (NGR) to handle the 8 possible two CC toggle (equivalent to Y axis in a 2x8 pattern)

You can maybe simply with toggle scan X(16,17...23,24, 31,16....) and Y (16,24,17,25....31,16...) with 2 MAP

But in a strict "user friendly" interface I personally won't use two encoder to select data in a 2x8 matrix display (for a 8x8 OK...)

A single continuous scan will be as fast for only 16 slot (assuming you can go both direction, most distant data is only at 8 encoder tick) , OR you can use the encoder button to switch X/Y scan axis

Only two encoder, data and value

Best

Zam

Share this post


Link to post
Share on other sites
2 hours ago, Zam said:

Hello

 

Don't know if you can do this without a script (NGR) to handle the 8 possible two CC toggle (equivalent to Y axis in a 2x8 pattern)

You can maybe simply with toggle scan X(16,17...23,24, 31,16....) and Y (16,24,17,25....31,16...) with 2 MAP

But in a strict "user friendly" interface I personally won't use two encoder to select data in a 2x8 matrix display (for a 8x8 OK...)

A single continuous scan will be as fast for only 16 slot (assuming you can go both direction, most distant data is only at 8 encoder tick) , OR you can use the encoder button to switch X/Y scan axis

Only two encoder, data and value

Best

Zam

it is actually 5 rows of 8 but i used 2 rows as an example before i start trying this. I am just curious if it is possible, I will have a play this evening and see where i get to.

I know that in thorstens blofeld files that there is the meta , bank and cond label used. i could alter this slightly but its the #cc as well.

will see what happens tonight

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now