{
   "code" : "LividBASE{\r\n\tclassvar <>defKeys,<>defMap,<>base,<>baseOut,<>baseIn;\r\n\r\n\t*init{ arg settings;\r\n\t\tthis.defKeys = [\\slider1,\\btn1,\\scene1,\\scene1LEDs,\\pad1];\r\n\t\tthis.defMap = Dictionary[\r\n\t\t\t\\slider1 ->1,\r\n\t\t\t\\btn1-> 10,\r\n\t\t\t\\scene1 -> 18,\r\n\t\t\t\\scene1LEDs -> #[18,26],\r\n\t\t\t\\pad1 ->36\r\n\t\t];\r\n\t\tsettings.do{|a|\r\n\t\t\tif(a != nil && a.size==2,\r\n\t\t\t\t{this.defMap.put(a[0],a[1])}\r\n\t\t\t)\r\n\t\t};\r\n\t\tthis.initMIDI;\r\n\r\n\t}\r\n\r\n\r\n\t*initMIDI{\r\n\t\tvar baseFound=false;\r\n\r\n\t\tif(MIDIClient.initialized==false,{MIDIClient.init});\r\n\t\tMIDIClient.sources.do{|a,b|\r\n\t\t\tif(\r\n\t\t\t\tbaseFound==false &&\r\n\t\t\t\ta.device == \"Base\" &&\r\n\t\t\t\ta.name == \"Controls\",\r\n\t\t\t\t{\r\n\t\t\t\t\tbaseFound=true;\r\n\t\t\t\t\tthis.base = b;\r\n\t\t\t\t\tthis.baseIn=MIDIIn(b);\r\n\t\t\t\t\tthis.baseOut = MIDIOut.newByName(\"Base\",\"Controls\");\r\n\t\t\t\t}\r\n\t\t\t)\r\n\t\t};\r\n\t\tif(this.base == nil,\r\n\t\t\t{Post << \"BASE not found! base==\"<< this.base << Char.nl},\r\n\t\t\t{\r\n\t\t\t\t// generic midi func\r\n\t\t\t\tMIDIFunc.noteOn({arg val,num,chan,src; val.postln;\"ooo\".postln;});\r\n\t\t\t\tMIDIFunc.noteOff({arg val,num,chan,src; val.postln;});\r\n\t\t\t\t// MIDIFunc({},\r\n\t\t\t\t// give a confirmation light show\r\n\t\t\t\t//this.mapToNotes\r\n\t\t\t\tthis.hiBASE;\r\n\t\t\t}\r\n\t\t);\r\n\t}\r\n\t/*\r\n\t\"BASE FOUND!\" LED sequence\r\n\t*/\r\n\t*hiBASE{\r\n\t\tvar seq=Pbind(\r\n\t\t\t\\type, \\midi,\r\n\t\t\t\\chan, 16,\r\n\t\t\t\\midiout, this.baseOut,\r\n\t\t\t\\midinote,Pseq(this.defMap.at(\\pad1)+(0..31)),\r\n\t\t\t\\dur,0.007//Pbrown(0.1,0.6,length:32)\r\n\t\t).play;\r\n\t}\r\n}",
   "is_private" : null,
   "id" : "1-4WE",
   "labels" : [
      "midi",
      "class",
      "controller"
   ],
   "description" : "getting livid base communicating.",
   "ancestor_list" : [],
   "name" : "just a start with Livid BASE",
   "author" : "moncrey"
}
