InOut { *ar { arg inArray, numOuts; var w,outArray; // some rudimentary argument checking if (inArray.size < 1, {inArray = [Plug.ar(0)] }); if (numOuts.isNumber.not, { numOuts = 2 }); if (numOuts < 1, { numOuts = 2 }); w = GUIWindow.new("InOut", Rect.newBy(20, 70, 92*numOuts, 27*inArray.size)); // make sliders for PanAz inArray.size.do({ arg i; SliderView.new( w, Rect.newBy(26, ((i+1)*20)+5, (numOuts-1)*100, 10), "SliderView", 0, 0, (2/numOuts)*(numOuts-1), 0, 'linear'); }); // make numbers down left side if (inArray.size > 1, { inArray.size.do({ arg i; StringView.new( w, Rect.newBy(3, 19+(i*20), 20, 20), (i+1).asString); }); }); // make numbers across top numOuts.do({ arg i; StringView.new( w, Rect.newBy(22+(98*i), 2, 20, 20), (i+1).asString); }); outArray = inArray.collect({ arg item, i; PanAz.ar(numOuts,item,w.at(i).kr,1,1.6); }); ^Mix.ar(outArray); } } // takes mono, gives back quad with moving delays up to given maximum InMonoOutQuad { *ar { arg in,maxdelay=0.1,add=0,mul=1; var outArray; outArray = Array.fill(4, { DelayL.ar(in,maxdelay,rand(maxdelay)*RandLFO5.kr(0.1)) } ); ^(outArray + add * mul); } } // takes stereo, gives back quad with moving delays up to given maximum InStereoOutQuad { *ar { arg in,maxdelay=0.1,add=0,mul=1; var quadArray1,quadArray2; quadArray1 = Array.fill(4, { DelayL.ar(in.at(0),maxdelay,rand(maxdelay)*RandLFO.kr(0.1)) } ); quadArray2 = Array.fill(4, { DelayL.ar(in.at(1),maxdelay,rand(maxdelay)*RandLFO.kr(0.1)) } ); ^quadArray1 + quadArray2; } } // takes mono, gives back n channels with moving delays up to given maximum InMonoOutN { *ar { arg in,numchans=2,maxdelay=0.1,add=0,mul=1; var outArray; outArray = Array.fill(numchans, { DelayL.ar(in,maxdelay,rand(maxdelay)*RandLFO5.kr(0.1)) } ); ^(outArray + add * mul); } } // takes mono, gives back quad with 4 channel location by wacom tablet InMonoTabletQuad { *ar { arg in,add=0,mul=1; var outArray; var amp1,amp2,amp3,amp4; amp1 = TabletX.kr(1.0,0.0) * TabletY.kr(0.0,1.0); amp2 = TabletX.kr(0.0,1.0) * TabletY.kr(0.0,1.0); amp3 = TabletX.kr(0.0,1.0) * TabletY.kr(1.0,0.0); amp4 = TabletX.kr(1.0,0.0) * TabletY.kr(1.0,0.0); ^[ in * amp1, in * amp2, in * amp3, in * amp4 ]; } } // takes mono, gives back n channels rotating speaker output with control of speed, direction, & angle width // doesn't respond very quickly (must do a full rotation before it gets new parameters) SoundARound { *ar { arg in,numchans=2,speed=10,direction=0,width=2.3,add=0,mul=1; var simpleEnv,theSpeed,theDirection,theWidth,rampEnv; theSpeed = Plug.kr(speed); theDirection = Plug.kr(direction); theWidth = Plug.kr(width); ^Spawn.ar({ arg spawn, count, synth; var spawnSpeed,spawnDirection,spawnWidth; spawnSpeed = theSpeed.poll; spawnDirection = theDirection.poll; spawnWidth = theWidth.poll; spawn.nextTime = spawnSpeed; simpleEnv = Env.linen(0,spawnSpeed,0); if (spawnDirection==0,{ rampEnv = Env.linen(spawnSpeed,0,0) }, { rampEnv = Env.linen(0,0,spawnSpeed) }); PanAz.ar( numchans, in, EnvGen.kr(rampEnv,2), EnvGen.kr(simpleEnv), spawnWidth ); },numchans) + add * mul; } } // takes input array of ugens and arrays of control values/ugens for level outputs // number of control arrays must match size of input array // but the control arrays can be any size MatrixMixer { *ar { arg inArray,controlArray; var outArray; // for each input ugen, outArray = inArray.collect({ arg inUgen,i; // make an array of ugen * array of control values controlArray.at(i).collect({ arg ctrlValue, j; inUgen Plug.kr(ctrlValue); }); }); ^Mix.ar(outArray); } }/* authors so far: mattr */ |