Jump to content

Use encoder to set a button's event value


Marxon
 Share

Recommended Posts

Hi all!

I want to make a button which sends a NRPN event.
The value of this event should, however be set with another encoder.
Because using ngr scripts was a good choice in the past, i tried this:
 

 

EVENT_ENC    id=116 hw_id= 14 type=Meta meta=runsection:206 range=map1 no_dump=1 enc_mode=Absolute  label="^std_enc"
EVENT_BUTTON id=123 hw_id=123 type=NRPN nrpn= 45 nrpn_format=MsbOnly   no_dump=1 button_mode=OnOnly label="^std_btn"
if ^section == 206
    set Button:123 ^value
endif


But somehow it does not work like suspected.

 

1) Turning the encoder also triggers the button event but
it was intended that it set the button's value only.
Maybe i misunderstood the SET and TRIGGER commands?
 
2) Although MiosStudio reports ("show id button:123") a correct value after turning the encoder,

the button always sends value 127 and not the value of the encoder.
 

Thanks for any advice!

Best reragds
Marxon

Edited by Marxon
Link to comment
Share on other sites

to 1)

 

I added the following to the wishlist:

- "silent set value" (don't send MIDI event when value is changed)

 

to 2)

 

you've specified "nrpn_format=MsbOnly" - could this be the reason?

 

Best Regards, Thorsten.

Link to comment
Share on other sites

Please try this version: http://www.ucapps.de/mios32/midibox_ng_v1_030_pre2.zip

 

The "silent set" can now be done with:

    change Button:123 ^value

and the reason for 2) was, that the button will always send the "max" value of the specified range (0:127 by default).

 

The new:

    set_max Button:123 ^value

command will allow you to change the range

 

Best Regards, Thorsten.

Link to comment
Share on other sites

Like always, great work Thorsten :thumbsup:

Silently set a button´s value via an encoder works like expected.

I use the ngc code from my first post together with this ngr script:

if ^section == 206
	set_max Button:123 ^value
	change Button:123 ^value
endif

 

Thank you!

 

 

Best regards

Marxon

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...