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.

31 lines
695 B

  1. (
  2. var scale = Scale.zhi;
  3. 10.do{ arg i;
  4. {
  5. var snd, trig, freq, decaytime, envspec, env, noise;
  6. trig = Impulse.ar(
  7. freq: i * 0.083 * rrand(0.8, 1.2),
  8. phase: 100.rand*0.01);
  9. envspec = Env.perc(
  10. attackTime: 0.001,
  11. releaseTime: rrand(0.001, 0.1),
  12. level: LFNoise0.ar(100).range(0,1));
  13. env = EnvGen.ar(
  14. envelope: envspec,
  15. gate: trig);
  16. noise = BrownNoise.ar * env;
  17. freq = (scale.degrees+60).choose.midicps * [0.5,1,2].choose;
  18. decaytime = rrand(0.01,2);
  19. snd = Ringz.ar(
  20. in:noise,
  21. freq: freq,
  22. decaytime: decaytime,
  23. mul:0.015);
  24. snd = snd.dup; // mono on both speakers.
  25. snd; // lastline = what functions returns = output for .play
  26. }.play;
  27. }
  28. )