A place to dump little or mid-sized snippets of SuperCollider code.
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.

76 lines
1.5 KiB

  1. (
  2. // synthdefs
  3. SynthDef(\x44y, {
  4. arg out=0, gate=1, amp=0.9;
  5. var snd, env;
  6. env = Linen.kr(gate, releaseTime: 0.001, doneAction:2);
  7. snd = Pulse.ar([1234,2345,3456,4567,5678,8912,11023] * LFNoise0.ar(freq:Array.fill(7, {rrand(1,10)})).range(0.8,1.2), mul:0.2).sum;
  8. snd = snd + WhiteNoise.ar(0.2);
  9. snd = HPF.ar(snd, 8000);
  10. //snd = snd * LFSaw.kr(0.5,iphase:1).exprange(0.00001,1);
  11. snd = snd * amp * env;
  12. snd = snd.dup;
  13. Out.ar(out, snd);
  14. }).add;
  15. SynthDef(\h991, {
  16. arg out=0, freq=90, gate=1, amp;
  17. var snd, env, cfof;
  18. env = Linen.kr(gate, doneAction:2);
  19. freq = freq * XLine.ar(1,0.4, 5);
  20. snd = SinOsc.ar(freq);
  21. snd = BHiPass4.ar(snd, 40);
  22. snd = snd + LPF.ar(Pulse.ar([freq, freq*1.01], 0.01, mul:0.4), freq * 32);
  23. snd = snd + (LFTri.ar([freq*1.01,freq]) + SinOsc.ar(freq, mul:10).max(-0.5).min(0.5)).clip2(0.5);
  24. snd = snd + Pulse.ar(freq, mul:0.2);
  25. snd = snd + Impulse.ar(freq, mul:2);
  26. //cfof = Demand.kr(Impulse.kr(2), 0, Dseq([1,2,3,4,6,8]));
  27. cfof = Demand.kr(Impulse.kr(2), 0, Dxrand([1,2,4,6,8,16],inf));
  28. snd = BLowPass4.ar(snd, SinOsc.kr(cfof).range(300,LFNoise1.kr(1).range(1000,10000)), rq:0.9);
  29. snd = snd * -9.dbamp;
  30. snd = snd * env * amp;
  31. snd = Splay.ar(snd);
  32. Out.ar(out,snd);
  33. }).add;
  34. )
  35. // play
  36. (
  37. Pbindef(\h991p, *[
  38. instrument: \h991,
  39. dur: 4,
  40. octave: 3,
  41. legato: 0.89,
  42. amp: 1
  43. ])
  44. )
  45. Pdef(\h991p).quant = 4;
  46. Pdef(\h991p).play;
  47. (
  48. Pbindef(\x44yp, * [
  49. instrument: \x44y,
  50. dur: 1/8,
  51. legato: Pseq([Pn(0.1, 2), 0.5, Pn(0.1, 4), 0.5],inf),
  52. amp: 1,
  53. ])
  54. )
  55. Pdef(\x44yp).quant = 4;
  56. Pdef(\x44yp).play;
  57. (
  58. Pdef(\h991p).stop;
  59. Pdef(\x44yp).stop;
  60. )