[sc-users] args as integers: outputproxy

Robin Houston robin.houston at gmail.com
Thu Aug 10 14:29:20 PDT 2006


On 8/10/06, James Harkins <jamshark70 at gmail.com> wrote:
> See the helpfile for RandSeed for the server-side equivalent,

Ah! I hadn't discovered RandSeed. So you could do something like the
below, where bell number 0 simply doesn't reset the seed.

Did I mention that I really love SuperCollider? :-)

Robin


(
SynthDef( "Bell3",
{
 arg myBellNumber=0, pan=0 ;
  var out,chime, freqSpec, num, burst, totalHarm = 12, klank,
    burstEnv, att = 0, seeds, burstLength = MouseY.kr(0.0001, 1);
seeds =  [
		0,				// Random bell
		1155524954,		// Nice low bell
		1155442766,		// Nice clunky bell
		1155294420,		// really low bell
		1154676704,		// High bell
		1155146026		// Mid range
];

RandSeed.kr(myBellNumber, Select.kr(myBellNumber, seeds));

freqSpec = `[
	{Rand(1, 30)*(100+Rand(-10.0,10.0))}.dup(totalHarm),
	{Rand(0.1, 0.9)}.dup(totalHarm).normalizeSum,
	{Rand(1.0, 3.0)}.dup(totalHarm)
];
burstEnv = Env.perc(0, burstLength);
burst = PinkNoise.ar(EnvGen.kr(burstEnv, gate: Impulse.kr(1),doneAction: 2));
klank = Klank.ar(freqSpec, burst);
out = Pan2.ar( // Put in stereo field
   klank*MouseX.kr(0.1, 0.8) ,
   pan);
Out.ar(0, out);
}).send(s)
)


More information about the sc-users mailing list