Page 1 of 1

change value attribute using scripting

Posted: 02 Mar 2014 19:22
by newtfish
Hi,

Im wondering if it is possible to change the "value=" attribute through scripting?

Ive tried

Mon.value = range(Knob.x, 0, 1);

However, this only seems to set it once.

Is it possible to achieve, just like setting it in the editor, to put in "range(Knob.x, 0, 1)"?

Re: change value attribute using scripting

Posted: 02 Mar 2014 19:34
by midimockup
Set On Expression to "any"

Re: change value attribute using scripting

Posted: 02 Mar 2014 20:12
by newtfish
Thanks,

But, Im trying to get it to work "On OSC"

I cant seem to substitute the "object.value" variable with another variable, whereas I can do this with "object.x"

And also, if I set the "obja" variable to the correct name for the object (e.g. "Knob.value") It doesnt stick. It just changes the actual value and does not change the "range" in which the value is working. Very weird?

Code: Select all

decl obj = findobject(OSC_ARGS[0]);
decl obja = obj.value;
decl objb = obj.x;

obja = range(objb,0,400);


Re: change value attribute using scripting

Posted: 04 Mar 2014 04:55
by Macciza
Hi
If its a Monitor obj and you want to use OSC then standard mapping will work easiest

If it called Monitor then simply send /Monitor/value n to your iPad address and port 8000 to get it to display what you want.

If scripting then OSC_ARG[0] is the first data of message, not the address which is what the script executes on . ..

Also that obj a = range line will only set it to a value depending on objb, not sure what you were expecting
What are you trying to do?

Re: change value attribute using scripting

Posted: 04 Mar 2014 18:40
by newtfish
This bit "range(objb,0,400);"

normally goes into the left panel of the editor. Into the "value=" section.

Im trying to change that programatically.

Just wondering if that is possible. When I try through scripting the object does show the value, but when I change the object that controls the value, the value does not update.

Heres an example

Fader ( this controls value )
Monitor (this displays value)

Send "range(Fader,0,400);" to the Monitor object.
Monitor object updates once, but when I move the Fader, will no longer get its value from the Fader.