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?
Thanks
assigning a .x value to a list.
-
- Newbie
- Posts: 21
- Joined: 13 Dec 2011 05:52
Re: assigning a .x value to a list.
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.
switch1.x = OSC_ARGS[0];
switch2.x = OSC_ARGS[1];
switch3.x = OSC_ARGS[2];
and so on.
Re: assigning a .x value to a list.
Thanks for the reply highmountain, it helped me a lot!
Re: assigning a .x value to a list.
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.!!
Thanks
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.!!
Thanks
Re: assigning a .x value to a list.
You should read the manual regarding "arrays" and "vectors".
B.
PS.: setattribute(textitem1,content,{OSC_ARG[0], OSC_ARG[1], ... });
B.
PS.: setattribute(textitem1,content,{OSC_ARG[0], OSC_ARG[1], ... });
Win7 64, Ipad Lemur, Cubase6 and a bunch of Roland Synths and Samplers
Re: assigning a .x value to a list.
Ah, for newbies like me. Don't forget the single quotation's at the start and end of the attribute's content.
for example.
CORRECT: setattribute(pl0,'content',OSC_ARGS[0]);
INNCORRECT: setattribute(pl0,content,OSC_ARGS[0]);
for example.
CORRECT: setattribute(pl0,'content',OSC_ARGS[0]);
INNCORRECT: setattribute(pl0,content,OSC_ARGS[0]);
Re: assigning a .x value to a list.
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.
decl i;
for(i=0; i<16;i++);
{
setattribute(textitem,'content',OSC_ARGS));
}
This doesn't compile, can anyone help?
Thanks.
Re: assigning a .x value to a list.
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
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
-
- Liine Staff
- Posts: 126
- Joined: 14 Dec 2011 12:12
Re: assigning a .x value to a list.
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 ')'