Problem to execute a script

Discuss Lemur and share techniques.
Post Reply
MrOT
Newbie
Posts:5
Joined:05 Feb 2012 17:25
Problem to execute a script

Post by MrOT » 05 Feb 2012 17:50

Hello out there.

Got a Problem to execute a script.
I wanna set the x value of a Fader to 0 when hit a button.

The script tells me no problem, but nothing happen if i hit the Button!

my Script:

Code: Select all

decl n= 0;
setattribute(Container5.Fader74, 'x', n);
and my hierarchy is in the picture!

Whats going wrong?
Attachments
faderscript.jpg
faderscript
faderscript.jpg (52.55KiB)Viewed 1326 times

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

Re: Problem to execute a script

Post by Macciza » 06 Feb 2012 02:04

Hi

The reason is that 'x' is not an attribute, it is a variable . . .
Attributes refer to the state of the object, how it presents itself or reacts to input .
Variables are the data part of the object.

So maybe reread sections 6.9 Using containers and 10.4 Attributes.
The script for your button will be something like

Code: Select all

Container5.Fader74.x=0;
Cheers
MM
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]

axel_liine
Liine Staff
Posts:126
Joined:14 Dec 2011 12:12

Re: Problem to execute a script

Post by axel_liine » 06 Feb 2012 09:29

Exactly. Note that variables are also called "expressions'". Another function with the same result :

Code: Select all

decl n= 0;
setexpression(Container5.Fader74, 'x', n);
It's less efficient in this case, but 'setexpression' can be used when iterating over an array of objects for example.

MrOT
Newbie
Posts:5
Joined:05 Feb 2012 17:25

Re: Problem to execute a script

Post by MrOT » 06 Feb 2012 12:26

That's the Reason!

THX very much!

Post Reply