When to use slot local variables?

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

When to use slot local variables?

Post by abject39 »

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.

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

Re: When to use slot local variables?

Post by pauljohnleonard »

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 0 guests