text: var MUSIQ={noteNames:"CDEFGAB".split(""),notePositions:[0,2,4,5,7,9,11],sharpNames:"C C# D D# E F F# G G# A A# B".split(" "),flatNames:"C Db D Eb E F Gb G Ab A Bb B".split(" "),accidentals:"bbb bb b  # ## ###".split(" "),cofPositions:[0,7,2,9,4,11,6,1,8,3,10,5],tonicPositions:[0,5,7,2,9,4,11,6,1,8,3,10],signatures:[0,-5,2,-3,4,-1,6,1,-4,3,-2,5],solfege:"do di re me mi fa se sol le la te ti".split(" "),intervalNames:"unison;minor second;major second;minor third;major third;fourth;tritone;fifth;minor sixth;major sixth;minor seventh;major seventh;octave".split(";"),
  chordExtensionNotes:[1,2,8,9],chords:[{names:["5","power"],longName:" power",notes:[0,7]},{names:["maj","M","ma","major",""],longName:"major",notes:[0,4,7]},{names:["m","mi","min","minor","-"],longName:"minor",notes:[0,3,7]},{names:["dim","diminished","o"],longName:"diminished",notes:[0,3,6]},{names:["aug","augmented","a"],longName:"augmented",notes:[0,4,8]},{names:["sus2"],longName:"suspended 2nd",notes:[0,2,7]},{names:["sus4","su","sus"],longName:"suspended 4th",notes:[0,5,7]},{names:["maj7","maj 7",
  "major 7"],longName:"major 7th",notes:[0,4,7,11],optional:[7]},{names:["m7","mi7","min7","minor 7","-7"],longName:"minor 7th",notes:[0,3,7,10],optional:[7]},{names:["7","M7"],longName:"dominant 7th",notes:[0,4,7,10],optional:[7]},{names:["dim7","dim 7"],longName:"diminished 7th",notes:[0,3,6,9]},{names:["m7b5","\u00f87","-7b5","m7(b5)"],longName:"half diminished",notes:[0,3,6,10]},{names:["mM7"],longName:"minor major seventh",notes:[0,3,7,11],optional:[7]},{names:["6"],longName:"major 6th",notes:[0,
  4,7,9],optional:[7]},{names:["m6"],longName:"minor 6th",notes:[0,3,7,9],optional:[7]},{names:["9","M9"],longName:"dominant 9th",notes:[0,4,7,10,14],optional:[7]},{names:["maj9"],longName:"major 9th",notes:[0,4,7,11,14],optional:[7]},{names:["m9"],longName:"minor 9th",notes:[0,3,7,10,14],optional:[7]},{names:["madd9","m add9","min add9"],longName:"minor add 9th",notes:[0,3,7,14],optional:[7]},{names:["add9","Madd9","maj add9"],longName:"major add 9th",notes:[0,4,7,14],optional:[7]},{names:["6/9","69"],
  longName:"6 9th chord",notes:[0,4,7,9,14],optional:[7]},{names:[" b9","Mb9","maj b9"],longName:"major flat 9th",notes:[0,4,7,11,13],optional:[7]},{names:["7b9","M7b9","7 b9"],longName:"dominant 7th flat 9th",notes:[0,4,7,10,13],optional:[7]},{names:["7#9","M7#9","7 #9","hendrix","7alt"],longName:"dominant 7th sharp 9th",notes:[0,3,4,7,10],optional:[7]},{names:["#9","M#9","M #9","maj #9"],longName:"sharp 9th",notes:[0,4,7,15],optional:[7]},{names:["maj11"],longName:"major 11th",notes:[0,4,7,11,17],
  optional:[7]},{names:["m11"],longName:"minor 11th",notes:[0,3,7,10,17],optional:[7,10]},{names:["11"],longName:"dominant 11th",notes:[0,4,7,10,17],optional:[7,10]},{names:["maj13"],longName:"major 13th",notes:[0,4,7,11,21],optional:[7]},{names:["m13"],longName:"minor 13th",notes:[0,3,7,10,21],optional:[7]},{names:["13","M13"],longName:"dominant 13th",notes:[0,4,7,10,21],optional:[7]},{names:[" b13"],longName:"flat 13th",notes:[0,4,7,10,20],optional:[7]}],scales:[{names:["chromatic","chro"],longName:"chromatic",
  notes:[0,1,2,3,4,5,6,7,8,9,10,11]},{names:["major","ionian","-major"],longName:"major",notes:[0,2,4,5,7,9,11]},{names:["minor","aeolian"],longName:"minor",notes:[0,2,3,5,7,8,10]},{names:["major pentatonic","pentatonic"],longName:"major pentatonic",notes:[0,2,4,7,9]},{names:["minor pentatonic","relative minor pentatonic"],longName:"relative minor pentatonic",notes:[0,3,5,7,10]},{names:["major blues","blues major","blues","hexatonic"],longName:"major blues",notes:[0,2,4,6,7,9]},{names:["minor blues",
  "blues minor","m blues"],longName:"minor blues",notes:[0,3,5,6,7,10]},{names:["ionian","Major"],longName:"ionian",notes:[0,2,4,5,7,9,11]},{names:["dorian"],longName:"dorian",notes:[0,2,3,5,7,9,10]},{names:["phrygian"],longName:"phrygian",notes:[0,1,3,5,7,8,10]},{names:["lydian"],longName:"lydian",notes:[0,2,4,6,7,9,11]},{names:["mixolydian"],longName:"mixolydian",notes:[0,2,4,5,7,9,10]},{names:["aeolian","natural minor"],longName:"aeolian",notes:[0,2,3,5,7,8,10]},{names:["locrian"],longName:"locrian",
  notes:[0,1,3,5,6,8,10]}],NOTE_REGEX:"([A-G]|[a-g])(bbb|bb|b|#|##)? ?([0-9])? ?(n|no|not|note|notes)",NOTE_SIMPLE_REGEX:"([A-G]|[a-g])(bbb|bb|b|#|##|###)?",SCALE_REGEX:"(s|sc|sca|scal|scale)?",CHORD_REGEX:"(c|ch|cho|chrd|chor|chord)?",match:function(a){var b=[];MUSIQ.isValidNote(a)&&(console.log("Match single note"),b.push(Note.fromNotation(a)));MUSIQ.isValidNoteList(a)&&(console.log("Match multiple notes"),b.concat(Note.fromNotation(a)));MUSIQ.isValidChord(a)&&(console.log("Match single chord"),b.push(Chords.fromNotation(a)));
  MUSIQ.isValidScale(a)&&(console.log("Match single scale"),b.push(Chords.fromNotation(a,"scale")));console.log("MusiQ MAtch: "+a);console.log(b);return b},isValidNote:function(a){return!a?!1:RegExp("^"+MUSIQ.NOTE_REGEX+"?$","m").exec(a)},isValidNoteList:function(){return!1},isValidChord:function(a){if(!a)return!1;var b=a;if(!a||0==a.length)b="M";a=_(MUSIQ.chords).reduce(function(a,b){return(_(a).isString()?a:a.names.join("|")+"|"+a.longName)+"|"+b.names.join("|")+"|"+b.longName});return RegExp("^"+
  MUSIQ.NOTE_SIMPLE_REGEX+" ?("+a+")? ?"+MUSIQ.CHORD_REGEX+"$","m").exec(b)},isValidChordList:function(){return!1},isValidScale:function(a){if(!a)return!1;var b=a;if(!a||0===a.length)b="M";a=_(MUSIQ.scales).reduce(function(a,b){return(_(a).isString()?a:a.names.join("|"))+"|"+b.names.join("|")});return RegExp("^"+MUSIQ.NOTE_SIMPLE_REGEX+" ?("+a+")? ?"+MUSIQ.SCALE_REGEX+"$","m").exec(b)},isValidScaleList:function(){return!1},guitar:{}};MUSIQ.guitar.isValidFingerPos=function(a){return/^((xX|[0-9]{1,2})[ -]*){6}$/m.exec(a)};
  MUSIQ.guitar.isValidChord=function(){};var Note=function(a,b){this.pos=a;if(this.relative=b||!1)this.pos%=12};
  Note.fromNotation=function(a){var b;if(a){var c=MUSIQ.isValidNote(a);if(c){var d=c[1],e=(c[2]||"").replace("\u266d","b").replace("\u266f","#"),g=+c[3]||0;b=1>g;"0"==c[3]&&(b=!1);c=d.toUpperCase();c=MUSIQ.notePositions[MUSIQ.noteNames.indexOf(c)];e=MUSIQ.accidentals.indexOf(e)-3;if(-3>e||"undefined"==typeof c||0>c)return console.warn("ERROR: note not found ("+a+")"),null;a=c+e+12*g;0>a&&b&&(a+=12);return b=new Note(a,b)}console.warn("Note not found : "+name)}};Note.fromPos=function(a){return new Note(a)};
  Note.distance=function(a,b){return b.pos-a.pos};Note.relativeDistance=function(a,b){var c=b.toRelative().pos-a.toRelative().pos;return 0>c?c+12:c};Note.shortestDistance=function(){return 0};Note.shortestRelativeDistance=function(){return 0};Note.interval=function(a,b){return new Interval(Note.distance(a,b))};Note.signature=function(a){return MUSIQ.signatures[a.toRelative().pos]};Note.cofPosition=function(a){return MUSIQ.cofPositions[a.toRelative().pos]};
  Note.notation=function(a,b){var c="",c=Note.signatureIsFlat(b)?MUSIQ.flatNames[a.relPos()]+(!a.relative?a.octave():""):MUSIQ.sharpNames[a.relPos()]+(!a.relative?a.octave():"");return c.replace("b","\u266d").replace("#","\u266f")};Note.simpleNotation=function(a,b){var c=a;a instanceof Note||(c=new Note(a));return(Note.signatureIsFlat(b)?MUSIQ.flatNames[c.relPos()]:MUSIQ.sharpNames[c.relPos()]).replace("b","\u266d").replace("#","\u266f")};
  Note.signatureIsFlat=function(a){return"undefined"==typeof a?!1:_(a).isBoolean()?a:0>a};Note.transpose=function(a,b){return _(b).isNumber()?new Note(a.pos+b):_(b).isString()?new Note(a.pos+Interval.fromName(b).distance):new Note(a.pos+b.distance)};Note.prototype.distance=function(a){return Note.distance(this,a)};Note.prototype.relativeDistance=function(a){return Note.relativeDistance(this,a)};Note.prototype.shortestDistance=function(a){return Note.shortestDistance(this,a)};
  Note.prototype.interval=function(a){return Note.interval(this,a)};Note.prototype.signature=function(){return Note.signature(this)};Note.prototype.cofPosition=function(){return Note.cofPosition(this)};Note.prototype.notation=function(a){return Note.notation(this,a)};Note.prototype.simple=Note.prototype.simpleNotation=function(a){return Note.simpleNotation(this,a)};Note.prototype.hasName=function(a){return Note.fromNotation(a)&&this.relPos()==Note.fromNotation(a).relPos()};
  Note.prototype.octave=function(){return Math.floor(this.pos/12)};Note.prototype.toRelative=Note.prototype.rel=function(){return new Note(this.pos-12*this.octave())};Note.prototype.relPos=function(){return this.relative?this.pos:this.toRelative().pos};Note.prototype.transpose=function(a){return Note.transpose(this,a)};Note.prototype.type=function(){return"note"};Note.prototype.frequency=function(){return 440*Math.pow(2,(this.pos-69)/12)};function note(a){return Note.fromNotation(a)};var Scale={fromTonicAndType:function(){},extend:function(a,b){this.startOctave=a;this.endOctave=b}};var Chord=function(a,b,c,d,e){b.hasOwnProperty("names")&&(this.relNotes=b.notes,this.names=b.names,this.longName=b.longName);this.notes=a;this.abstr=c?!1:!0;this.relative=d||!1;this.relative=c.relative;this.tonic=c||new Note(0);this._type=e||"chord"};
  Chord.fromNotation=function(a,b){var c,d,e="";"scale"==b?(c=MUSIQ.isValidScale(a),d=MUSIQ.scales,e="scale"):(c=MUSIQ.isValidChord(a),d=MUSIQ.chords,e="chord");if(!c)return console.warn("Chord not found : "+a),null;var g=Note.fromNotation(c[1]+(c[2]||"")),f=c[3];if(!f||0==f.length)f="major";c=_(d).filter(function(a){return _(a.names).some(function(a){return a==f})});console.assert(1==c.length);d=c[0].optional?_(c[0].notes).union(c[0].optional).sort(function(a,b){return a-b}):c[0].notes;d=_(d).map(function(a){return(new Note(a)).transpose(g.pos).relPos()});
  return new Chord(d,c[0],g,!1,e)};Chord.fromNotes=function(a,b){var c=Chords.fromNotes(a,b);return c&&0<c.length?c[0]:null};Chord.contains=function(a,b){return a.relative?_(a.relNotes).contains(b.relPos()):_(a.notes).contains(b.pos)};Chord.prototype.notation=function(a){return this.abstr?this.names[0].replace("b","\u266d").replace("#","\u266f"):this.tonic.simpleNotation(a)+this.names[0].replace("b","\u266d").replace("#","\u266f")};
  Chord.prototype.longNotation=function(a){return this.abstr?this.longName.replace("b","\u266d").replace("#","\u266f"):this.tonic.simpleNotation(a)+" "+this.longName.replace("b","\u266d").replace("#","\u266f")};Chord.prototype.transpose=function(a){this.notes=_(this.notes).map(function(b){return b.transpose(a)});this.tonic=this.tonic.transpose(a)};Chord.prototype.noteObjects=function(){return this._notes?this._notes:this._notes=_.map(this.relNotes,function(a){return new Note(this.tonic.pos+a)},this)};
  Chord.prototype.hasName=function(a){a=MUSIQ.isValidChord(a);if(!a||!this.tonic.hasName(a[1]+(a[2]||"")))return!1;var b=a[3]||"";""===b&&console.warn(b);a=_(this.names).find(function(a){return b===a});console.log(a);return"undefined"==typeof a?!1:!0};Chord.prototype.toString=function(){var a="[ ";_.each(this.notes,function(b){a+=new Note(b)});return a};Chord.prototype.minNotes=function(){return _(this.notes).filter(function(a){return!_(this.optional).contains(a)})};Chord.prototype.type=function(){return this._type};
  Chord.prototype.contains=function(a){return Chord.contains(this,a)};
  var Chords={fromNotes:function(a,b){var c=[],d=_.map(a,function(a){return new Note(a)});if(_.isNumber(b)&&-1<b){var e=a.slice();e.sort(function(a,b){return a-b});var g=e[b],e=_.map(e,function(a){return a-g}),e=_.map(e,function(a){0>a&&(a-=12*Math.floor(a/12),console.assert(0<=a));return a}),e=_.map(e,function(a){if(0>a)console.log("ERROR: negative note! ");else{if(12>a)return a;a%=12;return-1<MUSIQ.chordExtensionNotes.indexOf(a)?a+12:a}}),e=_.uniq(e);e.sort(function(a,b){return a-b});var c=_(MUSIQ.chords).filter(function(a){if(a.optional){var b=
  _(e).difference(a.optional);a=_(a.notes).difference(a.optional);return _(a).isEqual(e)||_(a).isEqual(b)}return _(a.notes).isEqual(e)},this),c=_.uniq(c),f=_.map(c,function(a){return new Chord(d,a,new Note(g))});return f}for(var h=[],j=0;j<a.length;j++)f=new Note(a[j]),-1<h.indexOf(f.toRelative().pos)||(h.push(f.toRelative().pos),f=Chords.fromNotes(a,j),c=c.concat(f));return c}};Chords.fromNotation=Chord.fromNotation;function chord(a){return Chord.fromNotation(a)};var Interval=function(a){this.distance=a;this.octaves=Math.floor(this.distance/12);this.relativeDistance=this.distance-12*this.octaves};Interval.prototype.name=function(){return MUSIQ.intervalNames[this.relativeDistance]};Interval.fromNotes=function(a,b){return new Interval(a.distance(b))};Interval.fromName=function(a){return new Interval(MUSIQ.intervalNames.indexOf(a))};function interval(a){return Interval.fromName(a)};var Guitar=function(a){this.strings=[];this.tuning(a||"standard");this.FRETS_SHOWN=Guitar.FRETS_SHOWN;this.frets=[];for(a=0;a<this.FRETS_SHOWN;a++)this.frets[a]=new GuitarFret(this,a);this.createNotes()};Guitar.tunings={standard:{name:"Standard",notes:[40,45,50,55,59,64]},"drop d":{name:"Drop D",notes:[38,45,50,55,59,64]},"open g":{name:"Open G",notes:[38,43,50,55,59,62]},fourths:{name:"All Fourths",notes:[40,45,50,55,60,65]},ukelele:{name:"Ukelele Standard",notes:[67,60,64,69]}};
  Guitar.FRETS_SHOWN=16;Guitar.prototype.createNotes=function(){this.notes=_(this.strings).map(function(a,b){return _(this.frets).map(function(c,d){return this.notes[b]&&this.notes[b][d]?(this.notes[b][d].note.pos=a.base+d,this.notes[b][d]):new GuitarNote(this,a,c,[b,d])},this)},this)};
  Guitar.prototype.tuning=function(a){if(!a)return this._tuning;if(this._tuning=Guitar.tunings[a])return this.strings=_.map(this._tuning.notes,function(a,c){return new GuitarString(this,c,a)},this),this.createNotes(),this._tuning;console.warn("Tuning not found! "+a)};Guitar.prototype.chordsFromFingerPos=function(a){return Chords.fromNotes(this.notesFromFingerPos(a))};Guitar.prototype.chordFromFingerPos=function(a){return Chord.fromNotes(this.notesFromFingerPos(a))};
  Guitar.prototype.chordsFromActiveNotes=function(){var a=_(this.activeNotes()).map(function(a){return a.notePos()});return Chord.fromNotes(a)};Guitar.prototype.activeMatches=function(){var a=_(this.activeNotes()).map(function(a){return a.notePos()}),a=Chords.fromNotes(a);return!a?_(this.activeNotes()).map(function(a){return a.note}):a};Guitar.prototype.activeNotes=function(){var a=[];_(this.notes).each(function(b){_(b).each(function(b){b.active()&&a.push(b)})});return a};
  Guitar.prototype.notesFromFingerPos=function(a){var b=[];_(a).each(function(a,d){-1<a&&b.push(this.notes[d][a].note.pos)},this);return b};Guitar.prototype.posFromChord=function(){};Guitar.prototype.notesOnFret=function(a){return _(this.strings).map(function(b,c){return this.notes[c][a]},this)};Guitar.prototype.notesOnString=function(a){return this.notes[a]};Guitar.prototype.noteOnPos=function(a){return this.notes[a[0]][a[1]]};Guitar.prototype.notationFor=function(a,b){return this.notes[a][b].note.simpleNotation()};
  Guitar.prototype.transpose=function(a){var b=_(this.notes).map(function(a){return _(a).map(function(a){return _.clone(a.state)})});_(this.notes).each(function(c,d){_(c).each(function(c,g){var f=g-a;c.state=-1<f&&f<Guitar.FRETS_SHOWN?b[d][f]:_.clone(GuitarNote.DEFAULT_STATE)})});return this};
  Guitar.prototype.show=function(a){if(!a)return this;this.clearFretboard();_(a).each(function(a,c){console.log(c);var d={only:!0,active:!0,ghosted:0<c};"note"==a.type()?(this.showNotes([a],d),d.tonic=!0):("chord"==a.type()||"scale"==a.type())&&this.showChords([a],d)},this);return this};
  Guitar.prototype.showNotes=function(a,b){console.log("ShowNotes ");var c=b||{only:!0,active:!0},d=_(a).map(function(a){if(a instanceof Note)return a;if(_(a).isNumber())return 12>a?new Note(a,!0):new Note(a);if(_(a).isString())return Note.fromNotation(a);console.log("Note not recognized! ");console.log(a)});console.log(d);_(this.notes).each(function(a){_(a).each(function(a){var b=_(d).find(function(b){if(!b)return!1;if(b.relative){if(a.relativeNotePos()==b.pos)return!0}else if(a.notePos()==b.pos)return!0;
  return!1});c.only?a.active(b):b&&a.active(b);c.active&&a.active(b);c.tonic&&a.tonic(b);c.ghosted&&a.ghosted(b)})});return this};Guitar.prototype.showChords=function(a){console.log("ShowChords ");console.log(a);a&&0<a.length&&(this.showNotes(a[0].notes),this.showTonic(a[0].tonic));return this};Guitar.prototype.showScales=function(){console.log("Function showScales not implemented!");return this};
  Guitar.prototype.showTonic=function(a){console.log("Showing tonic");console.log(a);return this.showNotes([a],{only:!1,tonic:!0})};Guitar.prototype.showFrets=function(a){_(this.notes).each(function(b,c){-1<a[c]&&b[a[c]].active(!0)});return this};Guitar.prototype.clearFretboard=function(){_(this.notes).each(function(a){_(a).each(function(a){a.state={active:!1,ghosted:!1,root:!1}})});return this};var GuitarNote=function(a,b,c,d,e){this.guitar=a;this.guitarString=b;this.fret=c;this.pos=d;this.state=e||_.clone(GuitarNote.DEFAULT_STATE);this.note=new Note(b.base+c.pos)};GuitarNote.DEFAULT_STATE={active:!1,ghosted:!1,tonic:!1};GuitarNote.prototype.notation=function(){return this.note.notation()};GuitarNote.prototype.simple=function(a){return this.note.simpleNotation(a)};GuitarNote.prototype.active=function(a){"undefined"!=typeof a&&(this.state.active=a);return this.state.active};
  GuitarNote.prototype.tonic=function(a){"undefined"!=typeof a&&(this.state.tonic=a);return this.state.tonic};GuitarNote.prototype.ghosted=function(a){"undefined"!=typeof a&&(this.state.ghosted=a);return this.state.ghosted};GuitarNote.prototype.fretPos=function(){return this.pos[1]};GuitarNote.prototype.stringPos=function(){return this.pos[0]};GuitarNote.prototype.onlyActive=function(a){return this.guitarString.onlyActive(this.pos[1],a)};
  GuitarNote.prototype.className=function(a){var b=[];this.state.active&&b.push("active");this.state.ghosted&&b.push("ghosted");this.state.tonic&&b.push("tonic");a&&b.push(this.intervalToTonic(a).name().replace(" ","-"));return b.join(" ")};GuitarNote.prototype.intervalToTonic=function(a){if(a)return a.interval(this.note)};GuitarNote.prototype.notePos=function(){return this.note.pos};GuitarNote.prototype.relPos=GuitarNote.prototype.relativeNotePos=function(){return this.note.toRelative().pos};
  GuitarNote.prototype.distanceTo=function(a){return[a.pos[0]-this.pos[0],a.pos[1]-this.pos[1]]};var GuitarChord=function(a,b,c){this.guitar=a;this.chord=b;this.notes=c;this._barre=0};GuitarChord.MAX_STRETCH=3;
  GuitarChord.fromChordAndBase=function(a,b,c){var d=c.stringPos();c.fretPos();if(!(d+(b.notes.length-(b.optional?b.optional.length:0))>a.strings.length)){var e=[],g=b.notes;e.push([c]);for(d+=1;d<a.strings.length;d++){var f=_(a.notes[d]).filter(function(a){return _(g).contains(a.relPos())}),f=_(f).filter(function(a){if(Math.abs(a.distanceTo(c)[1])<=GuitarChord.MAX_STRETCH)return!0});!f||0==f.length?console.log("No notes on string found!"):e.push(f)}g=e;console.log("FoundNotes:");console.log(g);var h=
  function(a){if(0==a.length)return[];if(1==a.length)return a[0];var b=h(_.rest(a)),c=[];_.each(_.first(a),function(a){_.each(b,function(b){c.push([a].concat(b))})});return c};a=h(g);console.log("STEP 2 - # of matches");console.log(a.length);a=_(a).filter(function(a){var c=b.relNotes.slice();a=_(a).map(function(a){return a.relPos()});return 0==_(c).difference(a).length});console.log("STEP 3 - # of matches");console.log(a.length);a=_(a).filter(function(a){var b=_(a).map(function(a){return a.fretPos()}),
  c=_(b).min(),d=_(b).max();if(Math.abs(c-d)>GuitarChord.MAX_STRETCH)return!1;for(c=1;c<a.length;c++)if(Math.abs(a[c].fretPos()-a[c-1].fretPos())>GuitarChord.MAX_STRETCH)return!1;console.log("match ",b);return!0});console.log("STEP 4 - # of matches");console.log(a.length);return g}};
  GuitarChord.fromChord=function(a,b){if(!b.relative)return console.warn("Relative chord not allowed!"),null;var c=[];_(a.notes).each(function(a){_(a).each(function(a){b.contains(a.note)&&c.push(a)})});console.log(c);return _.compact(_(c).map(function(c){return GuitarChord.fromChordAndBase(a,b,c)}))};GuitarChord.prototype.valid=function(){};GuitarChord.prototype.barre=function(){var a=0,b=_(this.guitar.frets).last();_(this.notes).pluck("fret").reverse().each(function(c){c==b&&a++});console.log(a);return a};var GuitarFret=function(a,b){this.guitar=a;this.pos=b;this.barre=!1};GuitarFret.prototype.notes=function(){return this.guitar.notesOnFret(this.pos)};GuitarFret.prototype.className=function(){if(3==this.pos)return"third";if(5==this.pos)return"fifth";if(7==this.pos)return"seventh";if(9==this.pos)return"ninth";if(12==this.pos)return"twelfth"};var GuitarString=function(a,b,c){this.guitar=a;this.pos=b;this.base=c};GuitarString.prototype.noteOnFret=function(a){return this.guitar[this.pos][a.pos]};GuitarString.prototype.matchNotes=function(){};GuitarString.prototype.activeNotes=function(){};GuitarString.prototype.onlyActive=function(a,b){_(this.guitar.notes[this.pos]).each(function(c,d){d==a?c.active(b):c.active(!1)},this);return this};
  