6
Quote:
Originally Posted by souk21
JSFX docs mention that certain variables are meant to be used in certain contexts, but lots of JSFX don't follow those rules, even some official ones.
For example in super8, "tempo", "ts_num" and "play_state" are read from @gfx, but are supposed to only be allowed in @block and @sample.
Another example is sequencer_megababy setting "gfx_clear" in @init when docs say "These functions and variables must only be used from the @gfx section"
How strict are these restrictions ?
Are the docs incomplete or are these JSFX relying on UB ?
Thank you
|
I think the base rule is that audio/midi variables should be used (read/write)
Only from block/sample sections
and functions that are called from.
All other can be used (read/write)
everywhere except block/sample sections
For reading ONLY there is no restriction
Every variable can be read everywhere
But its validation is guarantee
Only in its context
Functions can be called ONLY from their context
The reason for this is that
Block/sample sections run in the same thread sequentially
Separately from other sections thread