assigning a .x value to a list.

Discuss Lemur and share techniques.
Post Reply
fhill2
Newbie
Posts: 11
Joined: 13 Apr 2012 19:28

assigning a .x value to a list.

Post by fhill2 »

Is it possible assign 4 separate switches to - switch1.x==switch[0].... switch2.x==switch[1].... etc. Where switch is an incoming OSC packet of 0 0 1 0 or any combination?
How would I correctly set this up? :oops:
Thanks
highmountain
Newbie
Posts: 21
Joined: 13 Dec 2011 05:52

Re: assigning a .x value to a list.

Post by highmountain »

You need to add a script somewhere. Select it and change the execution to "On Osc". Set a custom address if you want. Then in the script you want to do this:

switch1.x = OSC_ARGS[0];
switch2.x = OSC_ARGS[1];
switch3.x = OSC_ARGS[2];

and so on.
fhill2
Newbie
Posts: 11
Joined: 13 Apr 2012 19:28

Re: assigning a .x value to a list.

Post by fhill2 »

Thanks for the reply highmountain, it helped me a lot!
:P
fhill2
Newbie
Posts: 11
Joined: 13 Apr 2012 19:28

Re: assigning a .x value to a list.

Post by fhill2 »

For setting attributes, will it be the same?
I have tried: setattribute(textitem1,content,OSC_ARG[0]);

Going further, how would I make a loop statement to assign each item in the OSC arguments to each of the 16 text object's contents I have(in ascending order).
I have been messing about with lots of code, but nothing compiles correctly.!! :o
Thanks
bxsj
Regular
Posts: 116
Joined: 24 Dec 2011 06:47
Location: Vienna

Re: assigning a .x value to a list.

Post by bxsj »

You should read the manual regarding "arrays" and "vectors".
B.

PS.: setattribute(textitem1,content,{OSC_ARG[0], OSC_ARG[1], ... });
Win7 64, Ipad Lemur, Cubase6 and a bunch of Roland Synths and Samplers
fhill2
Newbie
Posts: 11
Joined: 13 Apr 2012 19:28

Re: assigning a .x value to a list.

Post by fhill2 »

Ah, for newbies like me. Don't forget the single quotation's at the start and end of the attribute's content. :oops:
for example.
CORRECT: setattribute(pl0,'content',OSC_ARGS[0]);
INNCORRECT: setattribute(pl0,content,OSC_ARGS[0]);
fhill2
Newbie
Posts: 11
Joined: 13 Apr 2012 19:28

Re: assigning a .x value to a list.

Post by fhill2 »

This is my best attempt to assign each item in the OSC arguments to each of the 16 text object's contents I have(in ascending order):

decl i;
for(i=0; i<16;i++);
{
setattribute(textitem,'content',OSC_ARGS));
}

This doesn't compile, can anyone help?
Thanks.
bxsj
Regular
Posts: 116
Joined: 24 Dec 2011 06:47
Location: Vienna

Re: assigning a .x value to a list.

Post by bxsj »

If "textitem" is a text object, the setattribute command has to be called separately for each text object:

setattribute(textitem1,'content',OSC_ARGS[1]);
setattribute(textitem2,'content',OSC_ARGS[2]);
and so on ...

Just another hint: A switch object can have multiple columns (and rows). So for a switch object with 5 columns, the x value of the switch is an array containing the 5 x values for each column...

Hope that helps,
BxSj
Win7 64, Ipad Lemur, Cubase6 and a bunch of Roland Synths and Samplers
axel_liine
Liine Staff
Posts: 126
Joined: 14 Dec 2011 12:12

Re: assigning a .x value to a list.

Post by axel_liine »

fhill2 wrote:This is my best attempt to assign each item in the OSC arguments to each of the 16 text object's contents I have(in ascending order):

decl i;
for(i=0; i<16;i++);
{
setattribute(textitem,'content',OSC_ARGS));
}

This doesn't compile, can anyone help?
Thanks.

I see an extra parenthesis at the end of the line ')'
Post Reply