Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.82 KB | None | 0 0
  1. s.boot;
  2.  
  3. ~nRhythmPerms = 10; //differnet rhythm permutations at every performance
  4. ~patRhythm = ~nRhythmPerms.collect{|i| [i+1, [1, 2+i, [3+i, [4, 5]], 6+i]].convertRhythm};
  5. ~rSwitch = (); //make dict
  6. ~pstepDur = ();
  7. ~pstepDur[\cicada] = 8; ~pstepDur[\cricket] = 8; ~pstepDur[\ferry] = 8; ~pstepDur[\natchez] = 8;
  8. ~pstepDur[\rainGutter] = 8; ~pstepDur[\rainShower] = 8; ~pstepDur[\riverDrone] = 8; ~pstepDur[\thunder] = 8;
  9.  
  10. ~cicada = ();
  11. ~cicada[\profDurSynth] = [[1077.17,1016.71,254.18,254.18,1016.71,1077.17,1016.71,1016.71,1077.17,1016.71,1077.17],[1016.71,1077.17,1016.71,1077.17,1016.71,1016.71,1046.5,1016.71,1016.71],[1108.73,1016.71,1016.71,1108.73,932.33,1108.73,1108.73],[1046.5,1108.73,1108.73,1046.5,880.0,1046.5,1046.5],[1046.5,1046.5,1046.5,1046.5,1141.22,1016.71,1141.22,1077.17,1046.5,987.77,905.79,1046.5,1046.5],[932.33,1046.5,1046.5,1046.5,932.33,932.33,932.33],[880.0,1046.5,932.33,932.33,987.77,880.0,880.0],[905.79,987.77,1046.5,1077.17,1141.22,1016.71,1141.22,932.33,880.0,880.0,1141.22,1141.22,1016.71,1141.22,1077.17,1046.5,987.77,905.79,1141.22,1016.71,1141.22,1077.17,1046.5,987.77,905.79],[932.33,905.79,987.77,1046.5,1077.17,1141.22,1016.71,1141.22,905.79,987.77,1046.5,1077.17,1141.22,1016.71,1141.22,1141.22,1016.71,1141.22,1077.17,1046.5,987.77,905.79,1108.73,932.33,932.33],[987.77,1141.22,932.33,932.33,1108.73,987.77,987.77],[1141.22,1174.66,1141.22,987.77,959.65,1108.73,1141.22],[1108.73,1108.73,1108.73,1141.22,1046.5,1108.73,1108.73],[1174.66,959.65,959.65,1174.66,1108.73,959.65,1174.66],[959.65,959.65,959.65,959.65,1046.5,1046.5,959.65],[1046.5,1046.5,1046.5,1046.5,1016.71,1108.73,1046.5],[1108.73,1108.73,1046.5,1046.5,1046.5,1046.5,1108.73],[1046.5,1016.71,1016.71],[1046.5]];
  12. ~cicada[\profDurSynthInv] = [[959.65,1016.71,905.79,959.65,959.65,1174.66,1174.66,1016.71,959.65,1016.71,959.65],[987.77,959.65,959.65,293.66,277.18,293.66,277.18,987.77,987.77],[932.33,880.0,959.65,285.3,285.3,932.33,932.33],[987.77,932.33,959.65,277.18,269.29,987.77,987.77],[1108.73,932.33,959.65,277.18,277.18,987.77,1108.73],[1141.22,1046.5,987.77,959.65,905.79,1016.71,932.33,959.65,320.24,320.24,1108.73,1016.71,905.79,959.65,987.77,1046.5,1141.22],[1077.17,1077.17,959.65,329.63,254.18,293.66,261.63,269.29,277.18,302.27,329.63,1174.66,1077.17],[1016.71,1046.5,1108.73,320.24,320.24,1016.71,905.79,959.65,987.77,1046.5,1141.22,1016.71],[905.79,987.77,1141.22,302.27,302.27,1077.17,905.79],[905.79,987.77,1077.17,261.63,261.63,1016.71,905.79],[905.79,987.77,1077.17,269.29,254.18,905.79,905.79],[932.33,905.79,905.79,254.18,269.29,905.79,932.33],[1077.17,1016.71,905.79,269.29,302.27,905.79,1077.17],[1077.17,1016.71,932.33,302.27,311.13,932.33,1077.17],[959.65,905.79,1016.71,311.13,269.29,1077.17,959.65],[987.77,987.77,1077.17,277.18,285.3,959.65,987.77],[987.77,959.65,932.33,269.29,932.33,987.77],[987.77,987.77],[987.77]];
  13. ~cicada[\profDynSynth] = [[959.65,1016.71,905.79,959.65,959.65,1174.66,1174.66,1016.71,959.65,1016.71,959.65],[987.77,959.65,959.65,293.66,277.18,293.66,277.18,987.77,987.77],[932.33,880.0,959.65,285.3,285.3,932.33,932.33],[987.77,932.33,959.65,277.18,269.29,987.77,987.77],[1108.73,932.33,959.65,277.18,277.18,987.77,1108.73],[1141.22,1046.5,987.77,959.65,905.79,1016.71,932.33,959.65,320.24,320.24,1108.73,1016.71,905.79,959.65,987.77,1046.5,1141.22],[1077.17,1077.17,959.65,329.63,254.18,293.66,261.63,269.29,277.18,302.27,329.63,1174.66,1077.17],[1016.71,1046.5,1108.73,320.24,320.24,1016.71,905.79,959.65,987.77,1046.5,1141.22,1016.71],[905.79,987.77,1141.22,302.27,302.27,1077.17,905.79],[905.79,987.77,1077.17,261.63,261.63,1016.71,905.79],[905.79,987.77,1077.17,269.29,254.18,905.79,905.79],[932.33,905.79,905.79,254.18,269.29,905.79,932.33],[1077.17,1016.71,905.79,269.29,302.27,905.79,1077.17],[1077.17,1016.71,932.33,302.27,311.13,932.33,1077.17],[959.65,905.79,1016.71,311.13,269.29,1077.17,959.65],[987.77,987.77,1077.17,277.18,285.3,959.65,987.77],[987.77,959.65,932.33,269.29,932.33,987.77],[987.77,987.77],[987.77]];
  14. ~cicada[\profDynSynthInv] = [[932.33,1174.66,1077.17,1016.71,1077.17,1016.71],[932.33,302.27,1077.17,1016.71,987.77,905.79,959.65,959.65,1016.71,1077.17,1016.71],[932.33,302.27,1077.17,1016.71,959.65,959.65,905.79,987.77,1016.71,987.77,905.79,959.65,959.65,1016.71,1077.17,1016.71],[932.33,302.27,1077.17,1016.71,959.65,959.65,905.79,987.77,1046.5,987.77,932.33,932.33,959.65,987.77,905.79,959.65,959.65,1016.71,1077.17,1016.71],[932.33,329.63,302.27,277.18,269.29,261.63,293.66,254.18,1077.17,1016.71,959.65,959.65,905.79,987.77,1046.5,987.77,932.33,932.33,959.65,987.77,905.79,959.65,959.65,1016.71,1077.17,959.65,932.33,932.33,987.77,1046.5],[905.79,329.63,302.27,277.18,269.29,261.63,293.66,254.18,1077.17,1016.71,959.65,959.65,905.79,987.77,1046.5,987.77,932.33,932.33,959.65,987.77,905.79,959.65,959.65,1016.71,1077.17,959.65,932.33,932.33,987.77,1046.5],[905.79,329.63,302.27,277.18,269.29,261.63,293.66,254.18,1077.17,1016.71,959.65,959.65,905.79,987.77,1046.5,987.77,932.33,932.33,959.65,932.33,959.65,932.33,932.33,987.77,1046.5],[905.79,329.63,302.27,277.18,269.29,261.63,293.66,254.18,1077.17,1016.71,959.65,959.65,905.79,987.77,1046.5,987.77,932.33,932.33,959.65,932.33,959.65,932.33,932.33,987.77,1046.5],[905.79,269.29,932.33,1046.5,987.77,932.33,932.33,959.65,932.33,959.65,932.33,932.33,987.77,1046.5],[932.33,269.29,905.79,1046.5,987.77,932.33,932.33,959.65,932.33,959.65,932.33,932.33,987.77,1046.5],[932.33,269.29,905.79,1046.5,987.77,932.33,932.33,959.65,932.33,959.65,932.33,932.33,987.77,1046.5],[932.33,269.29,905.79,1046.5,987.77,932.33,932.33,959.65,905.79,959.65,932.33,932.33,987.77,1046.5],[932.33,269.29,932.33,905.79,905.79,905.79],[932.33,269.29,905.79,905.79,905.79,905.79],[932.33,254.18,905.79,905.79,905.79,905.79],[1077.17,1016.71,959.65,959.65,905.79,987.77,285.3,932.33,905.79,905.79,905.79],[1077.17,1016.71,959.65,959.65,905.79,987.77,269.29,932.33,905.79,932.33,905.79],[1077.17,1016.71,959.65,959.65,905.79,987.77,329.63,302.27,277.18,269.29,261.63,293.66,254.18,1077.17,1016.71,959.65,959.65,905.79,987.77,905.79,905.79,905.79],[1077.17,1016.71,959.65,959.65,905.79,987.77,1077.17,905.79,905.79,959.65,932.33,932.33,987.77,1046.5],[1077.17,1016.71,959.65,959.65,905.79,987.77,1077.17,905.79,932.33,959.65,932.33,932.33,987.77,1046.5],[1077.17,1077.17,1046.5,987.77,932.33,932.33,959.65,932.33,959.65,932.33,932.33,987.77,1046.5],[1077.17,1077.17,1046.5,987.77,932.33,932.33,959.65,987.77,905.79,959.65,959.65,1016.71,1077.17,1016.71],[1077.17,1016.71,1016.71]];
  15. ~cicada[\profPitchSynth] = [[254.18,254.18,254.18,254.18,254.18,254.18,254.18],[880.0,880.0,880.0,880.0,880.0,880.0,880.0],[932.33,932.33,932.33,932.33,932.33,932.33,932.33],[1016.71,1016.71,1016.71,1016.71,1016.71,1016.71,1016.71],[932.33,932.33,932.33,932.33,932.33,932.33,932.33],[1046.5,1046.5,1046.5,1046.5,1046.5,1046.5,1046.5],[959.65,959.65,959.65,959.65,959.65,959.65,959.65],[1077.17,1016.71,1077.17,1016.71,1077.17,1016.71,1016.71,1077.17,1016.71,1077.17,1016.71,1077.17,1016.71,1077.17],[959.65,959.65,959.65,959.65,959.65,959.65,959.65],[987.77,987.77,987.77,987.77,987.77,987.77,987.77],[1046.5,1046.5,1046.5,1046.5,1046.5,1046.5,1046.5],[1108.73,1108.73,1108.73,1108.73,1108.73,1108.73,1108.73],[905.79,905.79,905.79,905.79,905.79,905.79,905.79],[1141.22,1141.22,1141.22,1141.22,1141.22,1141.22,1141.22]];
  16. ~cicada[\profPitchSynthInv] = [[1141.22,1141.22,1141.22,1141.22,1141.22,1141.22,1141.22],[329.63,329.63,329.63,329.63,329.63,329.63,329.63],[320.24,320.24,320.24,320.24,320.24,320.24,320.24],[285.3,285.3,285.3,285.3,285.3,285.3,285.3],[311.13,311.13,311.13,311.13,311.13,311.13,311.13],[277.18,277.18,277.18,277.18,277.18,277.18,277.18],[302.27,302.27,302.27,302.27,302.27,302.27,302.27],[269.29,285.3,269.29,285.3,269.29,285.3,285.3,269.29,285.3,269.29,285.3,269.29,285.3,269.29],[302.27,302.27,302.27,302.27,302.27,302.27,302.27],[293.66,293.66,293.66,293.66,293.66,293.66,293.66],[277.18,277.18,277.18,277.18,277.18,277.18,277.18],[261.63,261.63,261.63,261.63,261.63,261.63,261.63],[320.24,320.24,320.24,320.24,320.24,320.24,320.24],[254.18,254.18,254.18,254.18,254.18,254.18,254.18]];
  17.  
  18. t = TempoClock(queueSize: 8192*2).permanent_(true);
  19.  
  20. SynthDef(\bpfsaw, {
  21. arg atk=2, sus=0, rel=3, c1=1, c2=(-1),
  22. freq=500, detune=0.2, pan=0, cfhzmin=0.1, cfhzmax=0.3,
  23. cfmin=500, cfmax=2000, rqmin=0.1, rqmax=0.2,
  24. lsf=200, ldb=0, amp=1, out=0;
  25. var sig, env;
  26. env = EnvGen.kr(Env([0,1, 1,0],[atk,sus, rel]), doneAction:2);
  27. sig = Saw.ar(freq * {LFNoise1.kr(0.5,detune).midiratio}!2);
  28. sig = BPF.ar(
  29. sig,
  30. {LFNoise1.kr(
  31. LFNoise1.kr(4).exprange(cfhzmin,cfhzmax)
  32. ).exprange(cfmin,cfmax)}!2,
  33. {LFNoise1.kr(0.1).exprange(rqmin,rqmax)}!2
  34. );
  35. sig = BLowShelf.ar(sig, lsf, 0.5, ldb);
  36. sig = Balance2.ar(sig[0], sig[1], pan);
  37. sig = sig * env * amp;
  38. Out.ar(out, sig);
  39. }).add;
  40.  
  41. SynthDef(\reed, {
  42. |out = 0, freq = 440, amp = 0.1, gate = 1, atk = 0.3, rel = 0.3|
  43. var snd, blow;
  44. snd = Pulse.ar((Rand(-0.03, 0.05) + freq.cpsmidi).midicps, 0.48 + LFNoise1.kr(0.06, 0.1), 0.2);
  45. snd = Disintegrator.ar(snd, 0.5, 0.7);
  46. snd = snd * LFNoise2.kr(5, 0.05, 1);
  47. blow = EnvGen.ar(Env.asr(atk, 1.0, rel), gate, doneAction: 2);
  48. snd = snd + BPF.ar(snd, blow.linexp(0, 1, 2000, 2442), 0.3, 3);
  49. snd = BHiShelf.ar(snd, 1200, 1, 3);
  50. snd = snd * blow;
  51. Out.ar(out, Pan2.ar(snd, 0, amp));
  52. }).add;
  53.  
  54. SynthDef(\satan, {
  55. arg envTime = 1.0e-3, knee = -10.dbamp, out, in, mix = 1, amp = 0.1;
  56. var sig, inSig = In.ar(in, 2);
  57. sig = DelayC.ar(inSig, 0.01, envTime * 0.5) *
  58. EnvFollow.ar(inSig, 1 - (envTime * SampleRate.ir).reciprocal).max(knee).reciprocal;
  59. sig = sig * amp;
  60. Out.ar(out, (1 - mix) * inSig + (sig * mix));
  61. }).add;
  62.  
  63. SynthDef(\reverb, { |out, in, damp = 0.5,
  64. delayTime = 10, size = 2, diff = 0.2, feedback = 0.2|
  65. var sig, inSig = In.ar(in, 2);
  66. Out.ar(out, Greyhole.ar(inSig, delayTime, damp, size, diff, feedback));
  67. }).add;
  68.  
  69.  
  70. (
  71. ~rSwitch[\cicada] = Pswitch(~patRhythm, Pseq([5, 6, 7], inf)).asStream;
  72. ~pstepDur[\cicada] = 6;
  73.  
  74. i = [\cicadaDefSrc, \cicadaDefDist, \cicadaDefVerb];
  75.  
  76. Pbindef(\cicadaDefSrc,
  77. \instrument, Prand([\reed, \bpfsaw], inf),
  78. \amp, 0.2*(1**Pgauss(0, 0.1)),
  79. \freq,Pstep(Pseq(~cicada[~cicada.keys.choose], inf), ~pstepDur[\cicada], inf),
  80. \dur, Pstep(~rSwitch[\cicada].next, ~pstepDur[\cicada], inf),
  81. \legato, 1,
  82. \atk, Pwhite(1, 4),
  83. \rel, Pwhite(1, 4),
  84. \strum, Pseq([0.1, 0.3, 0.0, 0.5], inf),
  85. \fxOrder, Pstep([[1, 2], 1, 2], ~pstepDur[\cicada], inf),
  86. \cleanupDelay, Pfunc{|e| e.atk + e.rel},
  87. \cleanupClock, t,
  88. \freePerGroup, true
  89. );
  90.  
  91. Pbindef(\cicadaDefDist,
  92. \fx, \satan,
  93. \mix, Prand([0.0, 0.1, 0.2], inf),
  94. \envTime, 0.0001,
  95. \knee, -30.dbamp,
  96. \cleanupDelay, Pkey(\envTime)
  97. );
  98.  
  99. Pbindef(\cicadaDefVerb,
  100. \fx, \reverb,
  101. \delayTime, 20,
  102. \damp, 0.2,
  103. \size, 30,
  104. \diff, 0.2,
  105. \feedback, 0.2,
  106. \cleanupDelay, Pkey(\delayTime)
  107. );
  108.  
  109. p = PbindFx(*i.collect { |x| Pbindef(x) });
  110.  
  111. ~cicadaDef = p;
  112. );
  113.  
  114. Pdef(\cicada, ~cicadaDef).play;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement