{
   "name" : "Piano Gestures: A Little Study",
   "author" : "mimetikmusic",
   "description" : "A little study on piano improvisation.",
   "ancestor_list" : [],
   "labels" : [
      "pattern",
      "midi",
      "piano",
      "improvisation"
   ],
   "id" : "1-4Sf",
   "is_private" : null,
   "code" : "/* Piano Gestures: A Little Study by mimetik\r\n\r\n This is a little study on piano improvisation, in particular on \"gestures\", by which I mean here little improvised phrasings.\r\n\r\n*/\r\n\r\nMIDIClient.init;\r\n\r\n/*\r\nChoose from the list of devices your internal MIDI router, so to send the notes to piano intrument in your favourite DAW\r\n*/\r\n\r\n~mOut = MIDIOut.new(3);\r\n\r\n//Set the scale to be Cmajor\r\n~scale=[0,2,4,5,7,9,11];\r\n\r\n//Define pattern proxies which will be modified by the task t below\r\n\r\na=PatternProxy(Pxrand([3,3,3,1,3,3],inf));\r\nb=PatternProxy(Pseq([1/2],inf));\r\nr=PatternProxy(Pseq([12],inf));\r\nn=Prand([4,8,16],inf).asStream;\r\n\r\nt=Task({\r\nPdef(\\x,Pbind(\\type,\\midi,\\chan,0,\r\n\t      \\midiout,~mOut,\r\n\t      \\scale,~scale,\r\n\t      \\root,-12,\r\n\t      \\degree,Pxrand([[0,3,5],[3,5,7],[4,6,8],[5,7,11]],inf),\r\n\t      \\legato,1,\r\n\t      \\amp,[{rrand(0.6,0.8)},{rrand(0.5,0.6)},{rrand(0.5,0.6)}]*0.7,\t\\dur,Prand([Pseq([1,1,1,1],1),Pseq([1,1,2],1),Pseq([1,2,1],1)],inf))).play(quant:1);\r\n\r\nPdef(\\y,Pbind(\\type,\\midi,\\chan,0,\r\n\t      \\midiout,~mOut,\r\n\t      \\scale,~scale,\r\n\t      \\root,r,\r\n\t      \\degree,a,\r\n\t      \\legato,1,\r\n\t      \\amp,{rrand(0.5,0.6)},\r\n\\dur,b)).play(quant:1);\r\n\r\n10.wait;\r\n\r\nt=Task({\r\n\tinf.do({\r\n\t\tif (0.7.coin,{\t\r\n\t\t c=[[3,0,7,1,9,11,0,4],[[3,7],0,7,Rest,9,[0,11],0,4]].choose.scramble;\r\n           \t r.source=Pseq([[12,24].wchoose([0.7,0.3])],inf);\r\n\t\t d=n.next;\r\n\t         a.source=Pseq([Pxrand(c,d),Pxrand([3,3,3,1,3,3],inf)]);\r\n\t         b.source=Pseq([Pseq([1/8],d),Pseq([1/2],inf)]);\r\n\t       });\r\n       rrand(3,4).wait;})}).play(quant:1);\r\n\t};\r\n).play(quant:1);"
}
