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.

115 lines
2.6 KiB

  1. Ndef(\aix).fadeTime = 10
  2. (
  3. Ndef(\aix, {
  4. var snd, revt;
  5. snd = Pulse.ar(freq: LFNoise0.ar([1/2,1/3]).exprange(50,5000));
  6. snd = snd + RLPF.ar(in: WhiteNoise.ar,
  7. freq: LFNoise0.ar(1/3).exprange(1000,10000),
  8. rq: LFNoise0.ar(1).range(0.01,1));
  9. snd = snd * LFPulse.ar(
  10. freq: LFNoise0.ar(1).exprange(0.1,8),
  11. width: LFNoise0.ar(1).range(0.1,0.001),
  12. // this creates very loud spikes - max 1000 above 1:
  13. mul: LFNoise1.ar(3).exprange(0.01,1000));
  14. snd = HPF.ar(snd, 10);
  15. // reverb time - various optons:
  16. revt = LFNoise0.ar(1/2).exprange(0.0001, 0.1);
  17. //revt = XLine.ar(1, 0.0001,30);
  18. //revt = LFTri.ar(1/10, 1).range(0.01, 0.0001);
  19. //revt = 0.000001;
  20. snd = Greyhole.ar(snd, revt, 0.5, revt);
  21. snd = Limiter.ar(snd, 0.9);
  22. snd = snd * 1;
  23. }).play)
  24. // THANKS TO/FORKED FROM:
  25. // https://sccode.org/1-5ei
  26. /////////////////////////////////////////////////////////////////////////////////////////////
  27. // what can it sound like? see: https://www.youtube.com/watch?v=dRmY3tEwZyE
  28. // the youtube version has been sent through an additional reverb pedal, but
  29. // you don't need the pedal to get something that sounds interesting
  30. (
  31. s.options.memSize_(16384*10);
  32. s.reboot;
  33. s.waitForBoot({
  34. Ndef(\bits, {
  35. var t = PulseCount.ar(Impulse.ar(8e3));
  36. var u = PulseCount.ar(Impulse.ar(7009));
  37. var sig = HPF.ar(
  38. (
  39. ((t * 15) & (t >> 5)) |
  40. ((t * 5) & (t >> [3, 4])) |
  41. ((t * 2) & (t >> 9)) |
  42. ((t * 8) & (t >> 11)) |
  43. (((t*t) & t) | (t >> 3))
  44. - 3 % 256
  45. ) / 127-1 * 3
  46. , 20
  47. ) * 0.1;
  48. var sig2 = LPF.ar(HPF.ar(gcd(t*u, u+t), WhiteNoise.ar()*2000 + 1000), 20);
  49. sig2 = sig2*sig;
  50. sig = 0.3*Splay.ar(Limiter.ar(Greyhole.ar(sig + sig2, sig, 0.5, sig), 0.5).flatten);
  51. }).play;
  52. });
  53. )
  54. /////////////////////////////////////////////////////////////////////////////////////////////
  55. // REWORK/ANALYSIS:
  56. (
  57. Ndef(\bits,
  58. {
  59. var t, u, sig, sig2, sum;
  60. t = PulseCount.ar(Impulse.ar(8e3));
  61. u = PulseCount.ar(Impulse.ar(7009));
  62. sig = ( // bytebeat
  63. ((t * 15) & (t >> 5)) |
  64. ((t * 5) & (t >> [3, 4])) |
  65. ((t * 2) & (t >> 9)) |
  66. ((t * 8) & (t >> 11)) |
  67. (((t*t) & t) | (t >> 3))
  68. - 3 % 256
  69. ) / 127-1 * 3 ;
  70. sig = HPF.ar(sig, 20) * 0.1 ;
  71. sig2 = gcd(t*u, u+t);
  72. sig2 = HPF.ar(sig2, WhiteNoise.ar() * 2000 + 1000);
  73. sig2 = LPF.ar(sig2, 20);
  74. sig2 = sig2 * sig;
  75. sum = Greyhole.ar(in: sig2, delayTime: sig, damp: 0.5, size: sig);
  76. sum = Limiter.ar(sum, 1);
  77. sum = sum.softclip;
  78. sum = sum * 0.5;
  79. //sig2 * 0.0001;
  80. sig;
  81. }
  82. ) // Ndef
  83. //.play;
  84. //.plot(2,minval:-10, maxval:10);
  85. .plot(7);
  86. )
  87. /////////////////////////////////////////////////////////////////////////////////////