When to use slot local variables?

Post topics about HALion scripting.
Post Reply
User avatar
abject39
Member
Posts: 303
Joined: Sat Jan 17, 2015 8:20 pm
Location: Ventura, Ca
Contact:

When to use slot local variables?

Post by abject39 » Mon Feb 05, 2018 9:32 pm

One thing that has alluded me is slot local variables. I do not quite understand when to declare them. The example used in the developers manual is MIDI but when I looked at the code for the stock libraries it was used all over the place. Exactly how can you tell what parameters need to be declared as a slot local variable?
My vision is uncompromising: to transcend my clients dreams by mesmerizing their audience with the world's finest audio arrangements and products.

pauljohnleonard
New Member
Posts: 2
Joined: Tue Apr 10, 2018 12:41 am
Contact:

Re: When to use slot local variables?

Post by pauljohnleonard » Tue Apr 10, 2018 12:55 am

According to

https://developer.steinberg.help/displa ... +Variables


"If some functions in your script depend on global variables that store the state of MIDI events, the automatic synchronization of global variables is usually a hindrance, because the global variables will be overwritten by the slot that received the latest MIDI events. To attain global variables that operate independently per slot, use defineSlotLocal."

So in other words it is used if you have the same lua program in 2 or more slots and want them to independent global variables.

Post Reply

Return to “Halion Scripting”

Who is online

Users browsing this forum: No registered users and 1 guest