Smol or mid-sized snippets of SuperCollider code that start in SuperCollider's Workspace Emacs buffer from scratch.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
4.3 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
  1. // arp galore!
  2. // set bus for the fx-delay
  3. ~delay1 = Bus.audio(s, 2);
  4. ( // synthdefs:
  5. SynthDef(\sin1, {
  6. arg freq=440, out=0, gate=1, amp=0.1, release=0, cutoff=10, rq=0.5;
  7. var snd, env;
  8. freq = [freq,freq*1.01];
  9. env = Linen.kr(gate, attackTime: 0.001, releaseTime: release, doneAction:2);
  10. snd = SinOsc.ar(freq) + Saw.ar(freq*1.004, mul:0.3) + Pulse.ar(freq*0.996, mul:0.4);
  11. snd = snd + snd.fold2(0.65);
  12. snd = (snd * 0.5) + (snd.wrap2(0.64) * 0.5) * 2;
  13. cutoff = cutoff * 0.1;
  14. cutoff = freq.pow(cutoff);
  15. cutoff = cutoff.max(100);
  16. cutoff = cutoff.min(18000);
  17. snd = RLPF.ar(snd, cutoff, rq);
  18. snd = snd * env;
  19. snd = snd * amp;
  20. Out.ar(out, snd);
  21. }).add;
  22. SynthDef(\dlywrangler, {
  23. arg out=0, in, wet=0.1, wet2=0.5;
  24. var snd, dly2;
  25. snd = In.ar(in,2);
  26. dly2 = CombN.ar(HPF.ar(snd,300), 1, [0.5,0.77], 5, mul: LFNoise1.kr(0.1).range(0.4,0.1) * 2 * wet2);
  27. snd = CombN.ar(snd, 1, Lag.ar(LFNoise0.ar(1).range(0.01,0.1),0.1), 3, mul:wet) + snd;
  28. snd = Limiter.ar(snd, 0.8);
  29. snd = snd + dly2;
  30. Out.ar(out, snd);
  31. }).add;
  32. )
  33. // create delaymangler comb // on ctrl+. you need to reeval this
  34. ~dlywrang1 = Synth(\dlywrangler, [\out, 0, \in, ~delay1]);
  35. ~dlywrang1.set(\wet2, 0.8); // normal space delay
  36. ( // basics
  37. Pbindef(\y3,
  38. \instrument, \sin1,
  39. \degree, Pseq( [ 0, 2, -1, 5, -2, 6 ], inf),
  40. \octave, 4,
  41. \scale, Scale.minor(\just),
  42. \mtranspose, 0,
  43. \cutoff, Pstutter(16, Pseq([Pseq((13..18)),Pseq((17..12))].min(18),inf)),
  44. \rq, Prand([0.2,0.3,0.5]*1,inf),
  45. \legato, Pseq([Prand([1,0.7]), 0.6, 0.9, 0.4, 0.6] * 0.2, inf),
  46. \release, 0.1,
  47. \dur, 1/8,
  48. \amp, [0.2,0.2,0.1] * Pseq([Prand([1,0.7]), 0.6, 0.9, 0.7, 0.6], inf) * 0.5,
  49. \dlywet, Pstutter(8, Pfunc({~dlywrang1.set(\wet, rrand(0, ((0..1) * 0.1).choose ) ) })),
  50. \out, ~delay1,
  51. )
  52. )
  53. Pdef(\y3).quant=4;
  54. Pdef(\y3).play
  55. // PLAY HERE:
  56. // change these freely without restarting other patterns
  57. // shuffle?
  58. Pbindef(\y3, \dur, Pseq([2.1/16, 1.9/16],inf))
  59. Pbindef(\y3, \dur, Pseq([2.3/16, 1.7/16],inf))
  60. Pbindef(\y3, \dur, Pseq([2.5/16, 1.5/16],inf))
  61. Pbindef(\y3, \dur, 1/8)
  62. // shorter/longer notes:
  63. Pbindef(\y3, \legato, Pseq([Prand([1,0.7]), 0.6, 0.9, 0.4, 0.6] * 0.5, inf))
  64. Pbindef(\y3, \legato, Pseq([Prand([1,0.7]), 0.6, 0.9, 0.4, 0.6] * 1, inf))
  65. Pbindef(\y3, \legato, Pseq([Prand([1,0.7]), 0.6, 0.9, 0.4, 0.6] * 0.1, inf))
  66. // degree
  67. Pbindef(\y3, \degree, Pseq( [ 0, 2, -1, 5, -2, 6 ], inf)) // default
  68. Pbindef(\y3, \degree, Pseq( [ [7,0], 2, -1, 5, Prand([-2,Pseq([2,6])]) ], inf))
  69. Pbindef(\y3, \degree, Pseq( [ [7,0], 2, -1, Prand([4,5]), Prand([-2,Pseq([2,6])]) ], inf))
  70. // octave
  71. Pbindef(\y3, \octave, 4)
  72. Pbindef(\y3, \octave, [4,5])
  73. Pbindef(\y3, \octave, [4,5,6])
  74. Pbindef(\y3, \octave, [4,5,6] + Pwrand([0,0,1,-1],[0.7,0.1,0.1,0.1],inf))
  75. Pbindef(\y3, \octave, [4,5,6] + Pwrand([0,2,1,-1],[0.7,0.1,0.1,0.1],inf))
  76. Pbindef(\y3, \octave, [4,5,6] + Pwrand([0,2,1, 3],[0.7,0.1,0.1,0.1],inf))
  77. Pbindef(\y3, \octave, Pstutter(32, Pseq( [5, [4,5], [4,5,6] ], inf), inf))
  78. Pbindef(\y3, \octave, Pstutter(32, Pseq( [5, [4,5], [4,5,6] ], inf), inf) + Pwrand( [0,1,1,-1], [0.7,0.1,0.1,0.1], inf))
  79. Pbindef(\y3, \octave, Pstutter(32, Pseq( [5, [4,5], [4,5,6] ], inf), inf) + Pwrand( [0,1,2,-1], [0.7,0.1,0.1,0.1], inf))
  80. // mtranspose
  81. Pbindef(\y3, \mtranspose, 0)
  82. Pbindef(\y3, \mtranspose, Pstutter(16, Pseq([Pn(0,2), Pn(3,2)],inf)))
  83. Pbindef(\y3, \mtranspose, Pstutter(16, Pseq([Pn(0,4), 3,5],inf)))
  84. Pbindef(\y3, \mtranspose, Pstutter(16, Pseq([7, Pn(0,3), 3, 5 ],inf)))
  85. // gritty it with more 'wetness' to wrangler delay
  86. Pbindef(\y3, \dlywet, Pstutter(8, Pfunc({~dlywrang1.set(\wet, rrand(0, ((0..1) * 0.1).choose ) ) }))) // default
  87. Pbindef(\y3, \dlywet, Pstutter(8, Pfunc({~dlywrang1.set(\wet, rrand(0, ((0..4) * 0.1).choose ) ) })))
  88. Pbindef(\y3, \dlywet, Pstutter(8, Pfunc({~dlywrang1.set(\wet, rrand(0, ((5..9) * 0.1).choose ) ) })))
  89. Pbindef(\y3, \dlywet, Pstutter(8, Pfunc({~dlywrang1.set(\wet, rrand(0, 1 ) ) })))
  90. Pbindef(\y3, \dlywet, Pstutter(8, Pfunc({~dlywrang1.set(\wet, rrand(0, 0.2 ) ) })))
  91. // filter
  92. Pbindef(\y3, \cutoff, Pstutter(16, Pseq([Pseq((13..18)),Pseq((17..12))].min(18),inf)))
  93. Pbindef(\y3, \cutoff, Pstutter(16, Pseq([Pseq((13..18)),Pseq((17..12))].min(13),inf)))
  94. Pbindef(\y3, \cutoff, Pstutter(16, Pseq([Pseq((13..18)),Pseq((17..12))].min(11),inf)))
  95. Pbindef(\y3, \cutoff, Pstutter(16, Pseq([Pseq((13..18)),Pseq((17..12))].min(10),inf)))
  96. Pbindef(\y3).stop