Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // LiveCoding by RudeCode /w visuals by b00leant
  2.  
  3. //OSC - R E C I V E
  4. (
  5. OSCdef(\osc1,
  6.     {arg msg, time, addr, recvPort;
  7.         msg.postln; //displays the received OSC messages on the windows post
  8.         /*synth*/.set(\/*arg*/, msg/*.lincurve(0,10,110,146)*/);
  9. }, '/foo', recvPort:57120); // the path of the OSC address of this object
  10. )
  11.  
  12. // OSC  - S E N D
  13.  
  14. b = NetAddr.new("192.168.1.25", 8000);
  15.  
  16. b.sendMsg("/cubo", 1);
  17.  
  18. ///////////////////////////////////////////////
  19. //////////////////////////////////////////////
  20.  
  21.  
  22. //Load setup file to get examples working
  23. ("C:/Users/Mauro/Desktop/howto_co34pt_liveCode-master/Setup/Setup.scd").load;
  24.  
  25. p.clock.tempo = 120/60;
  26.  
  27. ~windNoise={Pan2.ar(Gendy4.ar(0,initCPs:1))};
  28.  
  29. (
  30. b = NetAddr.new("192.168.1.25", 8000);
  31. b.sendMsg("/cubo", 1);
  32. Ndef(\wind,~windNoise).play;
  33. )
  34.  
  35. (
  36. ~coin=SynthDef("tCoin", { arg out=0, prob=0.08;
  37.     var trig;
  38.     trig = Impulse.ar(20, 0, SinOsc.kr(0.5,0,1,1));
  39.     Out.ar(out,
  40.         Mix.fill(3, {Ringz.ar(CoinGate.ar(prob, trig*0.5), #[1,1.5]*Rand(1000, 9000), 0.01)})
  41.     )
  42. }).add;
  43. )
  44.  
  45.  
  46. ~coin.set(\prob, 0.5); //0.01 - 0.05 - 0.5
  47.  
  48.  
  49.  
  50. //YUPPA by Nathaniel Virgo ('headcube')-140-character
  51. ~yuppa = {x=Saw.ar([50,50.1]);8.do{|i|f=2**(8-i);x=BRF.ar(AllpassN.ar(x,1,0.1/(12-i),2),80**TRand.ar(0,1,Impulse.ar(f/32,1/2)).lag(1/f)*80,2)};x};
  52.  
  53. (
  54. b.sendMsg("/cubo", 15);
  55. Ndef(\yu,~yuppa).play;
  56. )
  57.  
  58.  
  59.  
  60.  
  61. //FILTER ~yuppa
  62. (
  63. ~filterYuppa = {
  64.     BMoog.ar(
  65.         Ndef(\yu),
  66.         MouseX.kr(20,20000,\exponential), // cutoff freq.
  67.         MouseY.kr(1.0, 0.0, \linear), // q
  68.         0, // mode - lowpass
  69.         0.25); // mul
  70. }.play)
  71.  
  72.  
  73.  
  74.  
  75.  
  76. // II° part
  77.  
  78.  
  79. Ndef(\wind).stop(3);
  80.  
  81. ~filterYuppa.free;
  82.  
  83.  
  84.  
  85.  
  86. (
  87. SynthDef(\onSal, {
  88.     arg carfreq=50, modfreq=55, envdur=64;
  89.     var sig;
  90.     sig=PMOsc.ar(carfreq, modfreq, Line.ar(0,20,envdur,doneAction:2 )!2, 0, 0.02);
  91.     Out.ar(0, sig);
  92. }).add;
  93. )
  94.  
  95.  
  96.  
  97. (
  98. ~windNoise.free(4);
  99. ~intro1= Pbind(\instrument, \onSal ,\dur,24);
  100. ~intro1.set(\carfreq,300);
  101. ~intro1.set(\modfreq,550);
  102. ~intro1.set(\envddur,8);
  103. )
  104.  
  105. (
  106. p.fadeTime = 4;
  107. ~intro1= Pbind(\instrument, \bpfsaw , \rel,0.05, \ts,1,\dur,Pseq([0.5,Pseq([1],inf)],inf),\freq, [110,150,180], \amp, 0.4);
  108. ~intro1.play;
  109. )
  110. p.fadeTime=0;
  111. ~intro1.set(\ts,0.1);
  112.  
  113.  
  114.  
  115. ~h = Pbind(\instrument,\bplay,\buf,d["ch"][3],\dur,Pwhite(0.25,0.75).round(0.25),\amp,Pwhite(0.2,0.5));
  116.  
  117. ~h2 = Pbind(\instrument,\bplay,\buf,d["ch"][3],\dur,Pwhite(0.25,0.75).round(0.25),\amp,Pwhite(0.2,1),\rate,Pseq([1,2],inf)*2);
  118.  
  119. (
  120. ~intro1.free(3);~h.play;~h2.play; Ndef(\yu,~yuppa).free;
  121. b.sendMsg("/cubo", 2);
  122. )
  123.  
  124.  
  125.  
  126. (
  127. ~t = Pbind(\instrument,\bplay,\buf,d["t"][0],\dur,Pseq([1,1,1,0.5],inf),\amp,0.5,\rate,1.5);
  128. ~t.play;
  129. b.sendMsg("/sfera", 0);
  130. )
  131.  
  132.  
  133. (
  134. p.clock.tempo = 2;
  135. ~k = Pbind(\instrument,\bplay,\buf,d["sk"][0],\dur,Pbjorklund2(3,8)/4,\amp,0.5,\rate,Pseq([1,1.2],inf));
  136. ~k.play;
  137. b.sendMsg("/sfera", 2);
  138. )
  139. //kicks at a different pitch. Evaluate this a few times to get different permutations
  140. (
  141. ~k2 = Pbind(\instrument,\bplay,\buf,d["sk"][0],\dur,Pbjorklund2(3,8)/4,\amp,0.5,\rate,Pseq([1,1.8],inf)*4);
  142. ~k2.play;
  143. )
  144.  
  145.  
  146.  
  147.  
  148. // III° Part
  149.  
  150.  
  151.  
  152. p.clock.tempo = 140/60;
  153.  
  154. (
  155.  
  156.         SynthDef("looper",{ arg out=0,bufnum, vol=0.8;
  157.     var diskin;
  158.     diskin = (DiskIn.ar( 2, bufnum, 1))*vol;
  159.  
  160.     Out.ar(out, diskin)
  161.  
  162.         }).send(s);
  163.  
  164. )
  165.  
  166. (
  167. b = Buffer.cueSoundFile(s,"C:/Users/Mauro/Desktop/LiveCoding/Code/CODICE/AUDIOSAMPLE/IntroLake.wav"
  168. , 0, 2);
  169. )
  170.  
  171. r = Synth.new("looper", [\bufnum,b.bufnum], s);
  172.  
  173.  
  174. (
  175. r.free;
  176. b.free;
  177. ~bass1= Pbind(\instrument, \ring1 ,\a,6,\d,2,\dur,1, \amp,0.4);
  178. ~bass1.play;
  179.  
  180. ~k = Pbind(\instrument,\bplay,\buf,d["k"][0],\dur,1,\amp,0.5);
  181. ~k.play;
  182. )
  183.  
  184. (
  185. ~k.stop;
  186. ~intro.set(\ts,0.2);
  187. )
  188.  
  189.  
  190. (
  191. //~k.play;
  192. ~oh = Pbind(\instrument,\bplay,\buf,d["ch"][0],\dur,Pseq([0.5,Pseq([1],inf)],inf),\amp,1);
  193. ~oh.play;
  194. )
  195.  
  196. (
  197. ~k.stop;
  198. ~intro.set(\ts,3);
  199. )
  200.  
  201. (
  202. ~intro.set(\ts,0.2);
  203. ~k.play;
  204. ~h = Pbind(\instrument,\bplay,\buf,d["ch"][0],\dur,0.25,\amp,Pwhite(0.1,0.4));
  205. ~h.play;
  206. )
  207.  
  208. ~k.stop;
  209.  
  210. (
  211. ~intro.stop;
  212. ~sd = Pbind(\instrument,\bplay,\buf,d["s"][4],\dur,2,\amp,0.5);
  213. ~sd.play;
  214. ~bass1.set(\d,1);
  215. ~bass1.set(\amp, 0.35);
  216. )
  217.  
  218. (
  219. ~k.stop;
  220. ~bass1.stop;
  221. ~h.stop;
  222. ~sd.stop;
  223. )
  224.  
  225.  
  226. (
  227. ~intro.stop;
  228. ~k = Pbind(\instrument,\bplay,\buf,d["k"][0],\dur,Pwhite(0.25,0.5).round(0.25), \amp, 0.5);
  229. ~k.play;
  230. ~bass1.set(\d,1);
  231. ~h.play;
  232. ~bass1.play
  233. )
  234.  
  235.  
  236. (
  237. ~k.stop;
  238. ~fx1.stop;
  239. ~k2 = Pbind(\instrument,\bplay,\buf,d["sk"][0],\dur,1,\amp,0.5);
  240. ~k2.play;
  241. )
  242.  
  243. //// techno 4
  244. ~synth= Pbind(\instrument, \sinfb, \rel,0.5 ,\dur,Pseq([0.5,Pseq([1],inf)],inf),\freq, [110,150,180]);
  245.  
  246. (
  247. ~bass1.stop;
  248. ~synth.play;
  249. )
  250.  
  251. ~k2.stop;
  252.  
  253. (
  254. ~fx2.stop;
  255. ~gate.stop;
  256. ~k = Pbind(\instrument,\bplay,\buf,d["sk"][0],\dur,1,\amp,0.8);
  257. ~k.play;
  258. )
  259.  
  260. ~sd = Pbind(\instrument,\bplay,\buf,d["s"][4],\dur,2,\amp,0.5);
  261. ~sd.play;
  262.  
  263.  
  264. ~filterSd = {LPF.ar(~sd, 200 , 3.5)};
  265. ~filterSd.play;
  266.  
  267.  
  268. ~verbSd= {FreeVerb.ar(~sd,0.33,0.5,0.8)};
  269. ~verbSd.play;
  270.  
  271.  
  272. (
  273. ~h = Pbind(\instrument,\bplay,\buf,d["ch"][0],\dur,0.5,\amp,Pwhite(0.1,0.3));
  274. ~h.play;
  275. )
  276.  
  277.  
  278. ~verbh= {FreeVerb.ar(~h,0.60,0.5,1)};
  279.  
  280. // game game game
  281. (
  282. ~k.stop;
  283. ~h.stop;
  284. )
  285.  
  286.  
  287. (
  288. ~k.play;
  289. ~verbh.play;
  290. )
  291. ~verbh.stop;
  292.  
  293. (
  294. { | atk = 0.01, dur = 0.15, freq = 50, amp=0.8 |
  295.     BPF.ar(LFSaw.ar(freq), freq, 2, mul: EnvGen.kr( Env.perc( atk, dur-atk, amp, 6 ), doneAction: 2 )) ! 2;
  296. }.asSynthDef.name_("bass").add;
  297. )
  298.  
  299.  
  300. (
  301. ~bass = Pbind(
  302.         \instrument, \bass,
  303.         \delta, 1/4,
  304.     //  \dur, Pkey(\delta) * Pfunc({ thisThread.clock.beatDur }),
  305.     \dur, 0.08,
  306.         \freq, Pseq([/*\r*/ 50,60,70].pyramid, inf),
  307.         \amp,0.3
  308. ))
  309.  
  310. ~bass.play;
  311. ~bass.set(\freq, 50);
  312.  
  313. ~filter = {MoogFF.ar(~bass, 2000, 3.5)};
  314.  
  315. ~filter.play;
  316. ~filter.stop;
  317.  
  318.  
  319.  
  320.  
  321. ///// basso semplice insieme alla sola cassa da qui si ricostiuisce una nuova traccia
  322.  
  323. (
  324. ~bass = Pbind(
  325.         \instrument, \bass,
  326.         \delta, 1/2, // !!!!!!!!!!!!!!!!!!
  327.  
  328.     \dur, 0.08,
  329.  
  330.         \amp,0.3
  331. ))
  332.  
  333.  
  334.  
  335. (
  336. ~h = Pbind(\instrument,\bplay,\buf,d["ch"][3],\dur,0.25,\amp,Pwhite(0.1,0.2));
  337. ~h.play;
  338. )
  339.  
  340. (
  341. ~sd = Pbind(\instrument,\bplay,\buf,d["s"][4],\dur,2,\amp,0.5);
  342. ~sd.play;
  343. )
  344.  
  345.  
  346.  
  347. ~filter = {MoogFF.ar(~bass, 100, 3.5)};
  348. ~filter.play;
  349. ~filter.stop;
  350.  
  351.  
  352. ~h2.free;
  353.  
  354. //chiusura
  355.  
  356. (
  357. p.clear;
  358. Server.hardFreeAll;
  359. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement