[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] indexing controls



x = SynthDef("help-node-set", {| freq = 440, out = 0 |
    Out.ar(out, SinOsc.ar(freq, 0, 0.1));
});

x.allControlNames.do { |cn|
    cn.name.debug(cn.index);
};

-->
0: freq
1: out



In this other variant:
x = {| freq = 440, out = 0 |
    Out.ar(out, SinOsc.ar(freq, 0, 0.1));
}.asSynthDef;

x.allControlNames.do { |cn|
    cn.name.debug(cn.index);
};

-->
0: i_out
1: freq
2: out

It's a bad example in the help, though, since you should normally not write your own Out when using Function:play.
hjh


--
James Harkins /// dewdrop world
jamshark70@xxxxxxxxxxxxxxxxx
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman