Jump to content

.NGR Scripts - Workaround for custom variables?


Recommended Posts

Posted

Hi.

I want to implement octave up/down buttons as found on many midi keyboards.

I've read the NGR documentation and can't find a way to either read the value of kb_transpose or declare a global custom variable instead. The custom var would be used to store the current transpose value and in if-else statements inside the NGR script.

Do i have to setup a dummy element and use its value as my custom variable? If yes, how do i do this?

Or is there a better way of doing this?

Posted

Hi,

there is currently no way to declare custom variables, but you can use the storage of any unused event instead.

E.g. let's say you don't use LED:1000, then just use it to store your value.

Best Regards, Thorsten.

Posted (edited)

Thank you Thorsten!

May i ask how i can call another section from inside a section.

if ^section == 1
    RunSection:2
endif

if ^section == 2
endif

 

Edit: Sorry, just found it myself. exec_meta does the trick

Edited by tago
Posted

In this particular case you could also "set ^section 2", it should do the same (because ^section 2 follows ^section 1, no jump required)

Best Regards, Thorsten.

 

Posted (edited)

Works too, thanks.

I've a question regarding the range of kb_transpose. I'm planning to have a transposition range of +/- 2 octaves. I assume kb_transpose stepping is laid out in half tones, so it would look like -24, -12, 0, 12, 24. But this will not work as negative values seem to be forbidden. Any idea how to achieve this?

Edited by tago

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...
×
×
  • Create New...