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

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