Advertisement
Guest User

Untitled

a guest
Jan 12th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (
  2. var master, low, high, lowN, highN, player;
  3.  
  4. TempoClock.tempo = 1;
  5.  
  6. master = Pbind(
  7.     \type, \midi,
  8.     \midiout, m,
  9.     \sustain, 1,
  10. );
  11.  
  12. lowN = 33;
  13. highN = 6;
  14.  
  15. low = Pbindf(
  16.     master,
  17.     \chan, 0,
  18.     \midinote, Pclump(Pseq([1, Pwhite(6, 9, 1)], inf), Pwhite(36, 48)),
  19.     \dur, Pser([Pwhite(4, 8, 1), Pwhite(12, 24, 1)], lowN),
  20.     \tracker, Pseq((1..lowN)),
  21.     \reporter, Pfunc({
  22.         arg thisEvent;
  23.         "low: % of %".format(thisEvent.tracker, lowN).postln;
  24.     }),
  25. );
  26.  
  27. high = Pbindf(
  28.     master,
  29.     \chan, 1,
  30.     \midinote, [56, 68, 80] - Prand([0, 1], inf),
  31.     \dur, Pwhite(7, 13, highN),
  32.     \tracker, Pseq((1..highN)),
  33.     \reporter, Pfunc({
  34.         arg thisEvent;
  35.         "high: % of %".format(thisEvent.tracker, highN).postln;
  36.     }),
  37. );
  38.  
  39. player = Ptpar([
  40.     60 * 0, low,
  41.     60 * 1, high,
  42.     60 * 3, high,
  43.     60 * 5, high,
  44. ]).play;
  45. )
  46.  
  47. Pseq([Pwhite(4, 8, 1), Pwhite(12, 24, 1)], inf).asStream.nextN(30).sum / 60;
  48. Pwhite(7, 13).asStream.nextN(6).sum / 60;
  49.  
  50. (0..15).do{|i| m.allNotesOff(i)};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement