Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 4th, 2012  |  syntax: None  |  size: 1.21 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. (
  2. SynthDef("SimpleSine", { | pitch, decay = 2 , vol = 0.5|
  3.         var sound = SinOsc.ar(pitch.midicps) * EnvGen.ar(Env.perc(0.001, decay, vol), doneAction: 2);
  4.         Out.ar(0, 0.5*sound!2);
  5. }).memStore;
  6.  
  7. SynthDef("Bass", { | pitch |
  8.         var env = EnvGen.ar(Env.perc(0, 0.5, 1), doneAction: 2);
  9.         var saw = RLPF.ar(Saw.ar(pitch.midicps), 700);
  10.         var sine = SinOsc.ar(pitch.midicps);
  11.         var sound = 0.5*Mix([0.3*sine, 0.6*saw]) * env;
  12.         Out.ar(0, sound!2);
  13. }).memStore;
  14. )
  15.  
  16. a = Synth.new('SimpleSine', [\pitch, 60]);
  17. b = Synth.new('Bass', [\pitch, 36]);
  18.  
  19. (
  20. t = TempoClock.new(80/60, 0, Main.elapsedTime.ceil);
  21.  
  22. p = Pbind(\instrument, \SimpleSine,
  23.         \pitch, Pseq([60, 63, 60, Prand([67, 70], 1), 65, Prand([67, 70]), 69, Prand([65, 58], 1)], inf),
  24.         \dur, Prand([1, 0.5], inf),
  25.         \vol, 0.2
  26. ).play(t, quant: 1)
  27. )
  28.  
  29. (
  30. q = Pbind(\instrument, \SimpleSine,
  31.         \pitch, 12 + Pseq([60, 63, 74, Prand([67, 75], 1), 65, Prand([67, 70]), 69, Prand([65, 58], 1)], inf),
  32.         \dur, Prand([1, 0.5], inf)*2/3,
  33.         \vol, 0.2
  34. ).play(t, quant: 1)
  35. )
  36.  
  37. (
  38. r = Pbind(\instrument, \Bass,
  39.         \pitch, Pstutter(5, Pseq([60, 58, 53, 56], inf))-24,
  40.         \dur, 0.5
  41. ).play(t, quant: 1)
  42. )
  43.  
  44. t.tempo_(200/60)
  45. t.tempo_(120/60)
  46. t.tempo_(80/60)
  47.  
  48. p.stop
  49. q.stop
  50. r.stop