{
   "is_private" : null,
   "id" : "1-51C",
   "code" : "(\r\nMIDIClient.init;\r\nMIDIIn.connectAll;\r\n~lpChan = 0;\r\n~lpIn = MIDIClient.sources.select({arg item, i; (item.name == \"Launchpad Mini\")})[0]; //Pick the first launcpad mini you find\r\n~lpOut = MIDIOut.newByName(\"Launchpad Mini\", \"Launchpad Mini\");\r\n~lpNoteNums = Array.fill([8,8], {|i,j| j+(i*16) });\r\n)\r\n\r\n(\r\nvar path = {\r\n\tvar dir = [1,0];\r\n\tvar list = List.new;\r\n\tvar idx = [-1,0];\r\n\tvar size = 8;\r\n\tsize.do { arg x;\r\n\t\tif(x==0, 1, 2).do {\r\n\t\t\t(size-x).do {\r\n\t\t\t\tidx = idx + dir;\r\n\t\t\t\tlist.add(idx);\r\n\t\t\t};\r\n\t\t\tdir = [ -1 * dir[1], dir[0] ]; // rotate \r\n\t\t};\r\n\t};\r\n\tlist;\r\n}.value.collect({ arg x; x[0]+(x[1]*16) });\r\n\r\nr = Routine({\r\n\tinf.do{\r\n\t\tvar velocity = [127, 120, 107].choose;\r\n\t\tpath.do{|note, i|\r\n\t\t\t~lpOut.noteOn(~lpChan, note, velocity);\r\n\t\t\t0.015.wait;\r\n\t\t\t~lpOut.noteOff(~lpChan, note, velocity);\r\n\t\t}\r\n\t}\r\n});\r\nTempoClock.default.sched(0, r);\r\n)",
   "labels" : [
      "code fork"
   ],
   "description" : "For the challenge, let's make the path algorithmically =)",
   "ancestor_list" : [
      "1-51B"
   ],
   "name" : "Re: Launchpad Spiral",
   "author" : "grirgz"
}
