SuperCollider code written for smol release called 'noether'. https://music.lukaprincic.si/album/noether
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.

159 lines
4.6 KiB

  1. /*
  2. written by Luka Prinčič for 'noether' release.
  3. heavily inspired by chords written by Ichika Nito on a track 'Arpeggio'
  4. */
  5. (
  6. Server.default.waitForBoot { fork {
  7. ~revBus.free;
  8. ~revFx.free;
  9. ~revBus = Bus.audio(s, 2);
  10. SynthDef(\bet, { |gate = 1, freq = 234, out = 0, pan = 0, amp = 0.1, cutoff = 4000 |
  11. var snd, env, fenv;
  12. freq = [freq, freq * 1.01] * Rand(0.995, 1.0);
  13. freq = freq * SinOsc.kr(5).range(0.99, 1.01);
  14. env = EnvGen.ar(Env.asr(0, 1, 3), gate, doneAction:2);
  15. fenv = EnvGen.ar(Env.adsr(0.05, 0.5, 0.4, 2), gate);
  16. snd = SinOsc.ar(freq);
  17. snd = snd + Pulse.ar(freq * 0.5, mul:5);
  18. snd = snd + LFTri.ar(freq * [1,2].choose * 1.01, mul:1);
  19. snd = LPF.ar(snd, cutoff * fenv + 100);
  20. snd = snd + Decimator.ar(snd, freq*30);
  21. snd = snd * env * amp;
  22. snd = Balance2.ar(snd[0], snd[1], pan, 0.7);
  23. snd = snd * 0.4;
  24. OffsetOut.ar(out, snd);
  25. }).add;
  26. SynthDef(\nhat, { |gate = 1, out = 0, amp = 0.1, rls = 0.2, pan = 0|
  27. var snd, env;
  28. env = EnvGen.ar(Env.asr(0, 1, rls, -10), gate:gate, doneAction: Done.freeSelf);
  29. snd = WhiteNoise.ar;
  30. snd = snd * env;
  31. snd = BPF.ar(snd, 9000);
  32. snd = snd * amp;
  33. snd = Pan2.ar(snd, pan);
  34. Out.ar(out, snd);
  35. }).add;
  36. SynthDef(\kick, { |gate = 1, out = 0, amp = 0.1, release = 0.9, freq=50, pan = 0, cutoff = 500, fxout=0, hpf=0 |
  37. var snd, env, fenv;
  38. fenv = EnvGen.ar(Env([freq*4,freq],0.08,'cub'));
  39. snd = SinOsc.ar(freq: [fenv,fenv*2], mul:[1,0.4] ).sum;
  40. snd = snd * LFPulse.ar(24).range(0.7,1).lag(0.02);
  41. snd = snd + WhiteNoise.ar(0.3);
  42. snd = snd + SinOsc.ar(freq: [freq*2,freq*4], mul:EnvGen.ar(Env.perc(0, 0.2)) * 0.5).sum;
  43. snd = snd + LFTri.ar(freq: freq*4, mul:EnvGen.ar(Env.perc(0, 0.5)) * 0.3);
  44. snd = RLPF.ar(snd, cutoff, 0.7);
  45. snd = HPF.ar(snd, hpf);
  46. snd = snd.softclip;
  47. snd = snd * EnvGen.ar(Env.adsr(0, 0.05, 0.4, release, curve:'sqr'), gate: gate, doneAction:Done.freeSelf);
  48. snd = snd * amp * 5;
  49. snd = Pan2.ar(snd, pan);
  50. //DetectSilence.ar(snd, doneAction:Done.freeSelf);
  51. Out.ar(fxout, snd);
  52. Out.ar(out, snd);
  53. }).add;
  54. // reverb synthdef
  55. SynthDef(\revfx, { |inBus, outBus = 0, wet = 0.3, amp = 0.2|
  56. var snd, rev;
  57. snd = In.ar(inBus, 2);
  58. snd = BHiShelf.ar(snd, 5000, db:-3);
  59. rev = GVerb.ar(snd, 100, taillevel:wet);
  60. rev = rev * amp;
  61. OffsetOut.ar(outBus, rev);
  62. }).add;
  63. s.sync;
  64. // reverb on a reverb bus
  65. ~revFx = Synth(\revfx, [\inBus, ~revBus, \amp, 0.4, \wet, 0.5], addAction:\addAfter);
  66. s.sync;
  67. // PATTERNS: ////////////////////////////////////////
  68. t = TempoClock.default.tempo = 140/120;
  69. Pbind(*[
  70. instrument: \kick,
  71. freq: Prand((1..9) * 0.1 + 1 + 50,inf),
  72. dur: Pseq([2/3,2/3,1/3,2/3,1/6,1/6,1/3],inf) + Prand([0,0,1/3,1/6,2/3],inf),
  73. sustain: 0.1,
  74. hpf: Pseg([300,300,0,0,3000, 3000], [60, 60, 120, 30, 30]),
  75. amp: Pseg([0, 0, 0.1, 0.1, 0.01, 0], [60, 60, 120, 20, 10], \sqr),
  76. release: Prand((1..9) * 0.1, inf),
  77. cutoff: Prand((1..9) * 500, inf),
  78. ]).play(quant:1);
  79. Pbind(*[
  80. instrument: \nhat,
  81. dur: Pwrand([1/3, Pn(1/6,2)], [0.9,0.1], inf),
  82. amp: Pseg([0, 0, 0.1, 0.1, 0], [60, 60, 120, 30]),
  83. pan: Pwhite(-0.5,0.5),
  84. sustain: Prand([0.002, 0.01, 0.02],inf)
  85. ]).play(quant:1);
  86. Pbind(*[
  87. instrument: \bet,
  88. dur: Prand([
  89. Pseq([1/3, 3/6, 1/3, 1/3, 1/6, 2/6],4),
  90. Pseq([3/6, 1/3, 1/3, 1/6, 2/6, 1/3],4),
  91. Pseq([1/3, 1/3, 1/6, 2/6, 1/3, 3/6],4),
  92. Pseq([1/3, 1/6, 2/6, 1/3, 3/6, 1/3],4),
  93. Pseq([1/6, 2/6, 1/3, 3/6, 1/3, 1/3],4),
  94. Pseq([2/6, 1/3, 3/6, 1/3, 1/3, 1/6],4)
  95. ],inf),
  96. // inspired by Ichika Nito - Arpeggio //
  97. note: Pseq([
  98. 1, 13, 15, 20, 16, Rest(), // Dbm(add9)
  99. -1, 11, 15, 20, 16, Rest(), // EM7/B
  100. -3, 13, 15, 20, 16, Rest(), // Dbm(add9)/A
  101. -3, 12, 18, 23, 25, Rest(), // Gbsus4(+11)/A
  102. -6, 6, 9, 13, 20, Rest(), // Gbm(add9)
  103. -4, 8, 12, 18, 16, 20, // Abaug7
  104. 1, 13, 15, 20, 16, Rest(), // Dbm(add9)
  105. -1, 11, 15, 20, 16, Rest(), // EM7/B
  106. -3, 13, 15, 20, 16, Rest(), // Dbm(add9)/A
  107. -3, 12, 18, 23, 16, Rest(), //
  108. -4, 6, 11, 15, 16, Rest(), // EM9/Ab
  109. -4, 6, 13, 16, 25, 28, // Ab7sus4(-13(
  110. -6, 6, 9, 13, 20, Rest(), // Gbm(add9)
  111. -6, 8, 12, 18, 20, 16, // Abaug7
  112. ], inf),
  113. octave:
  114. Pseq([ Pn([4,5],14*6*2),Pn([4,5,6],14*6*2),
  115. Pseq([
  116. Prand([[5,4],[5,6],[4,5,6]]),
  117. Pn(Pwrand([5,6],[0.9,0.1]), 5)
  118. ], 14*2),
  119. Pseq([ Pn([4,5,6,7],14*6*4)])]),
  120. detune: 3, // Hz added to final freq
  121. legato: Pseq([4, Pn(Prand((2..5)*0.2),5)],inf) * 0.1,
  122. cutoff: Prand((1..4),inf) *
  123. Pseg([50, 500, 1000, 1000, 50, 10], [60, 60, 120, 30, 20], \cub),
  124. amp: Pseg([0, 0.1, 0.1, 0.01, 0], [10, 120+180, 30, 10], \cub) * 0.6,
  125. pan: Prand((0..10)-5*0.1, inf),
  126. out: ~revBus,
  127. ]).play(quant:1)
  128. }}
  129. )