OSC only work in main patch, not in usercode
sorenpeter opened this issue · comments
I tried to put my definition of OSC-input in the usercode directory and load it via the config file, but then i does not seem to work. Can it be because the usercode is loaded before the OSC?
so the usercode directory does get loaded before any OSC messages will have been read, though it should still be possible to use the ext
function in user code. It's worth pointing out that you'll need to use it inside a function though as otherwise the code won't get re-evaluated.
for example if you have the following
s = ext(:oscshape, :cube)
loaded from a file in the usercode directory (or the stdlib directory actually, there's not really a difference) then s will be set to :cube
when improviz starts up but then it won't change.
Something like this
func myshape()
s = ext(:oscshape, :cube)
shape(s, 1, 1, 1)
will check the value of the osc set variable every time the myshape
function is called and so it will use the new value.
What is it you're trying to do?
looking at the other stuff in usercode i guessed that i might have to make it at function.
I also tried to put it in the stdlib/variabels, but same issue.
aahhh, yeah I can see why the variables file might actually make things confusing. that's mainly there because it was the easiest way to make sure a default BPM was set when it gets used in rotate
function etc.
essentially, any variable declared outside a function in the stdlib and usercode files will be set once unless the user resets it in the program they have improviz run each frame