Troubleshooting

Variable not sent via OSC

Started by Romang on .

Sign in or create an account to join the conversation.

9 posts

Topic starter
Hi guys!
Having a trouble here:
Lemur is not sending variable defined inside the script through OSC to Ableton Live.

I've defined "b" variable in "Quant_switch" Object:
[img]http://s9.postimage.org/asz6wtvv3/Screen_shot_2012_07_13_at_9_06_29_PM.png[/img]

And I have a "Quant" script which defines the position of active switch (defines position of first non-null value) and assigns 1,2,4 or 0 to "b" variable
[img]http://s9.postimage.org/9pf2kvb7z/Screen_shot_2012_07_13_at_9_06_51_PM.png[/img]

But after assigning "b" variable to be sent over OSC0, it doesn't go to Ableton:
[img]http://s16.postimage.org/693ampwad/Screen_shot_2012_07_13_at_9_13_21_PM.png[/img]

Why "b" variable changes are not sent to Ableton?
What am I doing wrong?
I have Max receiving all OSC messages:
[img]http://s10.postimage.org/5ifans3o9/Screen_shot_2012_07_14_at_09_38_38.png[/img]

"print udp" shows all incoming messages on 8000 port except this "b" variable
I have tried to send variable to OSC1 and made one more port, but still the same - all other variables go into Max via OSC, except "b"


I did a monitor object to observe whether script "Quant" is doing all correct and it also shows the values which are being assigned to "b" variable:
[img]http://s18.postimage.org/75qsc6eah/Screen_shot_2012_07_14_at_9_47_10_AM.png[/img]

Why it still doesnt send "b" over OSC is a secret for me :)
Hi

Easy way to debug in Max is to drop a message box in and wire to the right input . . .

The message should be being sent as /Container5/Quant_switch/b which is what you need to route.
Or use the custom address to make it whatever you want.

Cheers
MM
Macciza wrote:Hi

Easy way to debug in Max is to drop a message box in and wire to the right input . . .

The message should be being sent as /Container5/Quant_switch/b which is what you need to route.
Or use the custom address to make it whatever you want.

Cheers
MM
I know debugging in Max, that's how I know this "Container5/Quant_switch/b" variable is not coming INTO MAX
I use "print udp" as I wrote earlier, which shows all incoming OSC messages which arrived.
So I think the error is somewhere in Lemur - the variable doesn't come from it.
Hi
Was just trying to point out that the OSC-route was not going to work because the address needs to be the full message.

Anyway will have to check but possibly because it is undefined it is not evaluated,
or because in the order of execution it has not been set yet - just a few thoughts of the top of my head.

So a solution? Make 'b' do something .
I split your script up a bit.
I created a container called _func which would contain various function.
I made an manual script called quant though the name could possibly be better
It take a number froom 0 to 3 and returns the numbers you want instead.

The 'b' expression now calls that function with the firstof(x) of the switch it is in
This then works top send the OSC message
Var_now_set.jzml
Cheers
MM
Romang wrote:
Macciza wrote:Hi

Easy way to debug in Max is to drop a message box in and wire to the right input . . .

The message should be being sent as /Container5/Quant_switch/b which is what you need to route.
Or use the custom address to make it whatever you want.

Cheers
MM
I know debugging in Max, that's how I know this "Container5/Quant_switch/b" variable is not coming INTO MAX
I use "print udp" as I wrote earlier, which shows all incoming OSC messages which arrived.
So I think the error is somewhere in Lemur - the variable doesn't come from it.
Indeed, variables whose values are changed by assigning in a script do not send out their new values by default.
You could send the OSC message within your script with oscout()
A workaround would be to set another variable in your script :
if (a==0) b2 = 1;
else if (a==1) b2 = 2;
...
and set up the "b" variable to evaluate to "b2" (instead of leaving it blank). Then "b" will update to the value of "b2" anytime it is changed from a script, and output its new value via OSC.
Macciza wrote:Hi
Was just trying to point out that the OSC-route was not going to work because the address needs to be the full message.

Anyway will have to check but possibly because it is undefined it is not evaluated,
or because in the order of execution it has not been set yet - just a few thoughts of the top of my head.

So a solution? Make 'b' do something .
I split your script up a bit.
I created a container called _func which would contain various function.
I made an manual script called quant though the name could possibly be better
It take a number froom 0 to 3 and returns the numbers you want instead.

The 'b' expression now calls that function with the firstof(x) of the switch it is in
This then works top send the OSC message
Var_now_set.jzml
Cheers
MM
Thank you!
I will try your Lemur interface!
I know about OSC-route, it was just a chunk of all my patch :)
axel_liine wrote: Indeed, variables whose values are changed by assigning in a script do not send out their new values by default.
You could send the OSC message within your script with oscout()
YES! This works for my interface, thanks for pointing to such a great function!

axel_liine wrote:
A workaround would be to set another variable in your script :
if (a==0) b2 = 1;
else if (a==1) b2 = 2;
...
and set up the "b" variable to evaluate to "b2" (instead of leaving it blank). Then "b" will update to the value of "b2" anytime it is changed from a script, and output its new value via OSC.

this method isn't working...

But big thanks for pointing to oscout!