change value attribute using scripting

Discuss Lemur and share techniques.
Post Reply
newtfish
Newbie
Posts:41
Joined:09 Apr 2011 19:32
change value attribute using scripting

Post by newtfish » 02 Mar 2014 19:22

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)"?

midimockup
Newbie
Posts:41
Joined:08 Nov 2012 15:55

Re: change value attribute using scripting

Post by midimockup » 02 Mar 2014 19:34

Set On Expression to "any"

newtfish
Newbie
Posts:41
Joined:09 Apr 2011 19:32

Re: change value attribute using scripting

Post by newtfish » 02 Mar 2014 20:12

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);


Macciza
Regular
Posts:1325
Joined:07 Dec 2011 04:57
Location:Sydney, Australia.

Re: change value attribute using scripting

Post by Macciza » 04 Mar 2014 04:55

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?
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]

newtfish
Newbie
Posts:41
Joined:09 Apr 2011 19:32

Re: change value attribute using scripting

Post by newtfish » 04 Mar 2014 18:40

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.

Post Reply