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

printLine() function? #45

Open
sorenpeter opened this issue Dec 10, 2019 · 5 comments
Open

printLine() function? #45

sorenpeter opened this issue Dec 10, 2019 · 5 comments

Comments

@sorenpeter
Copy link
Contributor

Hey Guy,

Is there some king of print/echo fuction in improviz, to output numbers to the terminal?
I would like to see the values that i feed into my code, and not just having to guess if my math is correct.

@rumblesan
Copy link
Owner

There isn't currently, though it would be pretty simple to add. The only potential issue is that because improviz works by evaluating the program every frame, printing numbers every frame is going to spam the console with a lot of output.

not necessarily the end of the world, but not the most user friendly thing :D

Certainly happy to add it in with the onus being on users to enable/disable it though. Possibly as simple as

debugEnable := 1
func debug(data)
  if debugEnable
    print(data)

debug([1,2,3])

@rumblesan
Copy link
Owner

debug function added in version 0.7.0

@sorenpeter
Copy link
Contributor Author

Could the debug() only run once on code execution?

@rumblesan
Copy link
Owner

so there's not really a good way to do this currently due to the constraints of how improviz works. Something that may make it more managable would be to use an external OSC message to control turning it on or off.

printon := ext(:printon, 0)
if printon
    debug(mystuffhere)

@rumblesan
Copy link
Owner

though another thought has just occured. if you use the debug function in some code in a usercode file for example then it will only be run once. it depends what you're wanting to investigate though I guess

@rumblesan rumblesan reopened this Feb 15, 2020
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