Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
script and send() function #355
I tried to use the send() function inside a script but I failed...
I have a widget named text_1
the script condition is
the script content is:
I tried with ip:port too, but my text widget is not modified
See attached session file
This is unclear to me. As cyberic99 mentioned, the docs seem to imply that send() will fire when there is an incoming value, and the condition property is true.
You mention that "send() only sends when it should which is in case of user interaction." ...but user interaction with what? Do you mean interaction with the widget that triggered the value update? This is the part that I am unclear about - I set the send() command up the same way that cyberic99 did and I am unable to get it to fire under any condition. I tried debugging by referencing the current state of the script widget, but it appears self-reference (e.g. "@this" inheritance) for this widget is undefined.
Right now I am assuming that the "incoming value" mentioned in the script widget docs can be any of these:
BTW I'm having a lot of fun with O-S-C - if I could get some multiline OSC messages using the script widget, I would be the happiest kid on the block ;)
Oooookaaay - as it turns out, relative commands work, e.g.:
send(false, "/position", "+");
But absolute commands, especially if they're the same number being sent repeatedly, like:
send(false, "/track/2/volume", 64);
...don't work. Actually, they work once, and then never work again.
Spamming the same number from a normal control works, but not from the script widget. I'm beginning to suspect it's deliberate data thinning, possibly by the OSC API of my host (Bitwig), unless anyone has any other bright ideas :)
[p.s. sorry for posting into a closed issue]
I mean direct interaction with o-s-c's user interface, excluding same
It is triggered when one of the following happens:
The subtle thing here is that value references in the script's
The script widget was kind of a hack on top of the property/value inheritance feature, I must say I'm not fully satisfied with it. When I have the need for these features I prefer writing a custom module.
AHA - Ça y est! I would never have figured that out, merci bien ;)
I generally agree about using a custom module instead of a widget. (When I have need for more complex behavior I tend to do it in Bitwig's API, which also uses .js modules). It is however nice to be able to create complex behavior in o-s-c using only the GUI, especially when you're prototyping 30 different controls and aren't sure what you need yet...I feel the Script widget does have a positive use.
Many thanks for this amazing application!
I second that.
To me, adding small pieces of code thanks to the script widget feels more integrated than a custom module.
And you do everything with the same tool (the editor)