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.

44 lines
1.3 KiB

  1. (
  2. x = {
  3. arg gate=1;
  4. var sum, snd0, snd1, snd2, env, gen, faderosc, numosc;
  5. numosc = 10;
  6. env = Env.adsr(20, 0, 1, 30, 1, \sin);
  7. gen = EnvGen.kr(env, gate, doneAction:2);
  8. faderosc = SinOsc.ar(1/60).range(-1,2).min(1).max(0);
  9. snd0 = Array.fill(numosc, {
  10. var freq, local;
  11. freq = [100,150,300,400] * 0.5;
  12. local = Saw.ar(rrand(freq, freq * 1.03 ) * LFNoise1.kr(0.3).range(1, 1.03), -10.dbamp);
  13. local = Mix(local);
  14. });
  15. snd0 = Splay.ar(snd0);
  16. snd0 = faderosc * snd0;
  17. snd0 = LPF.ar(snd0, LFNoise1.ar(0.06).exprange(300,10000));
  18. snd0 = CombL.ar(snd0, 1, LFNoise1.ar(0.05).range([0.5,0.65],[0.53,0.68]), 15, -1.dbamp) + snd0;
  19. snd1 = Array.fill(numosc, {
  20. var freq, local;
  21. freq = [100,150,300,400] * 0.8;
  22. local = Saw.ar(rrand(freq, freq * 1.03 ) * LFNoise1.kr(0.3).range(1, 1.03), -10.dbamp);
  23. local = Mix(local);
  24. });
  25. snd1 = Splay.ar(snd1);
  26. snd1 = (0-faderosc+1) * snd1;
  27. snd1 = LPF.ar(snd1, LFNoise1.ar(0.07).exprange(300,10000));
  28. snd1 = CombL.ar(snd1, 1, LFNoise1.ar(0.05).range([0.77,0.65],[0.80,0.68]), 15, -1.dbamp) + snd1;
  29. snd2 = WhiteNoise.ar * LFPulse.ar(0.06, width:0.02) * -25.dbamp;
  30. snd2 = HPF.ar(snd2, 2000);
  31. snd2 = snd2 + Dust.ar(LFNoise1.ar(0.1).range(1,100), mul:0.2);
  32. sum = snd0 + snd1;
  33. sum = sum * gen + snd2;
  34. }.play
  35. )
  36. x.set(\gate,0); // fadeout