Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSC only work in main patch, not in usercode #50

Open
sorenpeter opened this issue Feb 15, 2020 · 3 comments
Open

OSC only work in main patch, not in usercode #50

sorenpeter opened this issue Feb 15, 2020 · 3 comments

Comments

@sorenpeter
Copy link
Contributor

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?

@rumblesan
Copy link
Owner

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?

@sorenpeter
Copy link
Contributor Author

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.

@rumblesan
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants