SHARE
TWEET

Setup for 13th January Live Code

theseanco Jan 22nd, 2015 173 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (
  2. // Server.local.options.device = "MOTU Traveler";
  3. Server.local.options.memSize * 128;
  4. s.boot;
  5. p=ProxySpace.push(s);
  6. p.makeTempoClock;
  7. p.clock.tempo = 2;
  8. b = Buffer.alloc(s, 44100 * 4.0, 1);
  9. c = Buffer.alloc(s, 44100 * 4.0, 1);
  10. e = Buffer.alloc(s, 44100 * 4.0, 1);
  11. f = Buffer.alloc(s, 44100 * 4.0, 1);
  12. );
  13.  
  14. //voice synthdefs
  15. (
  16. SynthDef(\vplay,
  17.         {arg out = 0, buf = 0, rate = 1, amp = 0.5, pan = 0, atk=0.01, rel=1;
  18.                 var sig, env;
  19.                 sig = Pan2.ar(PlayBuf.ar(1,buf,rate,doneAction:2),pan);
  20.                 env = EnvGen.ar(Env.perc(atk,rel));
  21.                 sig = sig * env;
  22.                 sig = sig * amp;
  23.                 Out.ar(out,sig);
  24. }).add;
  25.  
  26. (
  27. SynthDef(\warp,
  28.         { arg bufnum=0,scroll=0.05,pitch=1,size=0.5, amp = 0.5, gate = 1, pan = 0.02;
  29.                 var outArray;
  30.  
  31.                 outArray = Pan2.ar(Warp1.ar(1,bufnum,SinOsc.kr(scroll),pitch,size,interp:2),SinOsc.kr(pan),1);
  32.                 Out.ar(0,Linen.kr(gate, 0.01, 0.6, 1.0, doneAction: 2) * outArray * amp);
  33. }).add;
  34. );
  35.  
  36.  
  37. //repetition synthdefs
  38.  
  39. SynthDef(\bplay,
  40.         {arg out = 0, buf = 0, rate = 1, amp = 0.5, pan = 0;
  41.                 var sig;
  42.                 sig = Pan2.ar(PlayBuf.ar(1,buf,BufRateScale.ir(buf) * rate,doneAction:2),pan);
  43.                 sig = sig * amp;
  44.                 Out.ar(out,sig);
  45. }).add;
  46.  
  47. (
  48. SynthDef(\pmosc,
  49.         {arg freq = 440, freq2 = 440, amp = 0.2, atk = 0.01, rel = 0.3, pmind = 0, out = 0;
  50.                 Out.ar(out,PMOsc.ar(freq,freq2,pmind,0,amp) * EnvGen.ar(Env.perc(atk,rel,1),doneAction:2)!2)
  51. }).add;
  52. );
  53.  
  54. (
  55. SynthDef(\sinewave,
  56.         {arg freq = 440, freqmod = 1, amp = 0.8, phase = 0, out = 0, atk = 0.01, rel = 0.1;
  57.                 Out.ar(out,(SinOsc.ar([freq,freq*freqmod],phase,amp) * EnvGen.ar(Env.perc(atk,rel),doneAction:2)))})
  58. .add;
  59. );
  60.  
  61. (
  62. SynthDef(\bufrec, { arg out = 0, bufnum = 0;
  63.             RecordBuf.ar(SoundIn.ar(0), bufnum, doneAction: 2, loop: 0);
  64. }).add;
  65. );
  66.  
  67. (
  68. SynthDef(\buflayer, { arg out=0, bufnum=0, rec = 1, pre = 1;
  69.             RecordBuf.ar(SoundIn.ar(0), bufnum, 0, rec, pre, doneAction: 2, loop: 0);
  70. }).add;
  71. );
  72.  
  73.  
  74.  
  75. /////////////////////////////////////////////////////////////////////////
  76. /////////////////////////////////////////////////////////////////////////
  77. //The other way is this, adding entire directories of sound to one dictionary key to be polled with an array. This is really simple and I don't know why i didn't know about it before.
  78. /////////////////////////////////////////////////////////////////////////
  79. /////////////////////////////////////////////////////////////////////////
  80. d = Dictionary.new;
  81. d.add(\k ->
  82.         PathName("/Users/theseanco/Documents/Sample Library/11 - 'Readymades'/Sample Packs/WAVEFORM RECORDINGS_ANALOG KICKS/KICK HITS/SHARP KICK HITS").entries.collect({
  83.                 arg sf;
  84.                 Buffer.read(s,sf.fullPath);
  85.         });
  86. );
  87. d.add(\h ->
  88.         PathName("/Users/theseanco/Documents/Sample Library/11 - 'Readymades'/Sample Packs/WAVEFORM RECORDINGS - DARK TECHNO/HITS/HATS").entries.collect({
  89.                 arg sf;
  90.                 Buffer.read(s,sf.fullPath);
  91.         });
  92. );
  93. d.add(\c ->
  94.         PathName("/Users/theseanco/Documents/Sample Library/11 - 'Readymades'/Sample Packs/WAVEFORM RECORDINGS - DARK TECHNO/HITS/CLAPS_SNARES").entries.collect({
  95.                 arg sf;
  96.                 Buffer.read(s,sf.fullPath);
  97.         });
  98. );
  99. d.add(\p ->
  100.         PathName("/Users/theseanco/Documents/Sample Library/11 - 'Readymades'/Sample Packs/SM White Label - Percussive Techno - Wav/drum hits/perc/").entries.collect({
  101.                 arg sf;
  102.                 Buffer.read(s,sf.fullPath);
  103.         });
  104. );
  105. d.add(\t ->
  106.         PathName("/Users/theseanco/Documents/Sample Library/11 - 'Readymades'/Sample Packs/SM White Label - Percussive Techno - Wav/drum hits/toms/").entries.collect({
  107.                 arg sf;
  108.                 Buffer.read(s,sf.fullPath);
  109.         });
  110. );
  111. d.add(\s ->
  112.         PathName("/Users/theseanco/Documents/Sample Library/11 - 'Readymades'/Sample Packs/SM White Label - Percussive Techno - Wav/drum hits/snares/").entries.collect({
  113.                 arg sf;
  114.                 Buffer.read(s,sf.fullPath);
  115.         });
  116. );
  117. );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top