Skip to content

Instantly share code, notes, and snippets.

@iani
Created May 4, 2015 13:50
Show Gist options
  • Select an option

  • Save iani/106a67e4041878484fd6 to your computer and use it in GitHub Desktop.

Select an option

Save iani/106a67e4041878484fd6 to your computer and use it in GitHub Desktop.
Using different instruments in patterns with Pbind and Ppar
/* This part is from steal this sound ported by Nick Collins.
http://composerprogrammer.com/code.html
http://composerprogrammer.com/code/stealthissound.scd
*/
/////////////////////////////
/* Using different instruments in patterns */
////////////////////////////////
Server.default.boot;
Server.default.prepareForRecord;
Server.default.record;
(degree: 10).play;
(
Ptpar(({|i|[i*8,Pbind(
\instrument, \werkit,
\scale,[0,7,4,3,5],
\degree,Pseq(32.fib.fold(0,6),4)+(2*i+i)-10,
\dur,1+2**i%2/6)]}!7).flat
).play
)
(
Ptpar(({|i|[i*8,Pbind(
\instrument, \werkit,
\scale,[0,7,4,3,5] + 10,
\degree,Pseq(32.fib.fold(0,6),4)+(2*i+i)-10,
\dur,1+2**i%2/6)]}!7).flat
).play
)
(
Ptpar(({|i|[i*8,Pbind(
\instrument, \organdonor,
\scale,[0,7,4,3,5] + 10,
\degree,Pseq(32.fib.fold(0,6),4)+(2*i+i)-10,
\dur,1+2**i%2/6)]}!7).flat
).play
)
(
Ptpar(({|i|[i*8,Pbind(
\instrument, \singleoscillatorwobble,
\scale,[0,7,4,3,5] + 10,
\degree,Pseq(32.fib.fold(0,6),4)+(2*i+i)-10,
\dur,1+2**i%2/6)]}!7).flat
).play
)
Ptpar(({|i|[i*8,Pbind(\scale,[0,2,4,7,9],\degree,Pseq(32.fib.fold(0,10),4)+(2*i+i)-10,\dur,1+2**i%2/6)]}!4).flat).play,
play{x=165;b=SinOsc;p=Trig.ar(Saw.ar(x),1);y=b.ar(p*x);z=b.ar(p);(GVerb.ar(GrainIn.ar(2,y,y/2,z,p*z,-1),9))/9}
play{LeakDC.ar(BRF.ar(Saw.ar(8,Decay2.kr(x=Duty.kr(1/8,0,Drand([0,Drand((0.4,0.5..1))],inf)),0.01,0.3))**1.5,x*20+[45.1,45],0.1)).tanh}
play{AllpassC.ar(SinOsc.ar(55).tanh,0.4,TExpRand.ar(2e-4, 0.4,Impulse.ar(8)).round([2e-3,4e-3]),2)};
play{p=PinkNoise.ar(1!2);BRF.ar(p+Blip.ar(p+2,400),150,2,0.1)+LPF.ar(FreeVerb2.ar(*LPF.ar(p+0.2*Dust.ar(0.1),60)++[1,1,0.2,1e4]).tanh,2000)}
{a=[0.02,0.1,1,2,3,4]; k=LFPar.kr(a+0.5).sum; f=Latch.kr(k,Impulse.kr(a)); Splay.ar(SinOsc.ar(f*100+300)/5)}.play
{a=[0.02,0.1,1,8,3,8]; k=LFPar.kr(a+0.7).sum; f=Latch.kr(k,Impulse.kr(a)); Splay.ar(SinOsc.ar(f*100+300)/10)}.play
Server.default.stopRecording;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment