Page 1 of 1
Variable not sent via OSC
Posted: 13 Jul 2012 18:16
by Romang
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:
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
But after assigning "b" variable to be sent over OSC0, it doesn't go to Ableton:
Why "b" variable changes are not sent to Ableton?
What am I doing wrong?
Re: Variable not sent via OSC
Posted: 13 Jul 2012 21:51
by shimoda
What do you have to receive the OSC in Ableton?
Re: Variable not sent via OSC
Posted: 14 Jul 2012 06:41
by Romang
I have Max receiving all OSC messages:
"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:
Why it still doesnt send "b" over OSC is a secret for me
Re: Variable not sent via OSC
Posted: 14 Jul 2012 06:51
by Macciza
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
Re: Variable not sent via OSC
Posted: 14 Jul 2012 07:33
by Romang
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.
Re: Variable not sent via OSC
Posted: 14 Jul 2012 10:25
by Macciza
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
Cheers
MM
Re: Variable not sent via OSC
Posted: 14 Jul 2012 14:02
by axel_liine
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 :
Code: Select all
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.
Re: Variable not sent via OSC
Posted: 16 Jul 2012 18:57
by Romang
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
Re: Variable not sent via OSC
Posted: 16 Jul 2012 19:00
by Romang
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 :
Code: Select all
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!