tago

.NGR Scripts - Workaround for custom variables?

7 posts in this topic

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Very nice, thanks again.

Will give it a try.

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