>0)+"bmp "+t(r)}e.tap=(new Date).getTime()},e.findChord=function(e){function t(e){var t={};for(var n in e){var r={};for(var i in e[n])r[e[n][i]]=1;t[n]=r}return t}var n={},r="0 3".split(" "),i=t(Piano.chords);for(var s in i)for(var o=0,u=r.length;o0&&(i+="-"+(e[u]-a));var a=e[u],f=Piano.calculateNote(a)%12,l=Piano.keySignature[f],c=Piano.Color[Piano.HSL].english[f];s+=", "+MusicTheory.Solfege[l].syllable,o+=", "+a,n+=", "+l,r+=", "+t[a]}console.log("notes: "+n.substr(2)+"
"+"solfege: "+s.substr(2)+"
"+"intervals: "+r.substr(2)+"
"+"keys: "+o.substr(2)+"
"+"gaps: "+i.substr(1))}}();if(typeof MusicTheory=="undefined")var MusicTheory={};typeof MusicTheory.Synesthesia=="undefined"&&(MusicTheory.Synesthesia={}),function(e){e.data={"Isaac Newton (1704)":{ref:"Gerstner, p.167",english:["red",null,"orange",null,"yellow","green",null,"blue",null,"indigo",null,"violet"],0:[0,96,51],1:[0,0,0],2:[29,94,52],3:[0,0,0],4:[60,90,60],5:[135,76,32],6:[0,0,0],7:[248,82,28],8:[0,0,0],9:[302,88,26],10:[0,0,0],11:[325,84,46]},"Louis Bertrand Castel (1734)":{ref:"Peacock, p.400",english:["blue","blue-green","green","olive green","yellow","yellow-orange","orange","red","crimson","violet","agate","indigo"],0:[248,82,28],1:[172,68,34],2:[135,76,32],3:[79,59,36],4:[60,90,60],5:[49,90,60],6:[29,94,52],7:[360,96,51],8:[1,89,33],9:[325,84,46],10:[273,80,27],11:[302,88,26]},"George Field (1816)":{ref:"Klein, p.69",english:["blue",null,"purple",null,"red","orange",null,"yellow",null,"yellow green",null,"green"],0:[248,82,28],1:[0,0,0],2:[302,88,26],3:[0,0,0],4:[360,96,51],5:[29,94,52],6:[0,0,0],7:[60,90,60],8:[0,0,0],9:[79,59,36],10:[0,0,0],11:[135,76,32]},"D. D. Jameson (1844)":{ref:"Jameson, p.12",english:["red","red-orange","orange","orange-yellow","yellow","green","green-blue","blue","blue-purple","purple","purple-violet","violet"],0:[360,96,51],1:[14,91,51],2:[29,94,52],3:[49,90,60],4:[60,90,60],5:[135,76,32],6:[172,68,34],7:[248,82,28],8:[273,80,27],9:[302,88,26],10:[313,78,37],11:[325,84,46]},"Theodor Seemann (1881)":{ref:"Klein, p.86",english:["carmine","scarlet","orange","yellow-orange","yellow","green","green blue","blue","indigo","violet","brown","black"],0:[0,58,26],1:[360,96,51],2:[29,94,52],3:[49,90,60],4:[60,90,60],5:[135,76,32],6:[172,68,34],7:[248,82,28],8:[302,88,26],9:[325,84,46],10:[0,58,26],11:[0,0,3]},"A. Wallace Rimington (1893)":{ref:"Peacock, p.402",english:["deep red","crimson","orange-crimson","orange","yellow","yellow-green","green","blueish green","blue-green","indigo","deep blue","violet"],0:[360,96,51],1:[1,89,33],2:[14,91,51],3:[29,94,52],4:[60,90,60],5:[79,59,36],6:[135,76,32],7:[163,62,40],8:[172,68,34],9:[302,88,26],10:[248,82,28],11:[325,84,46]},"Bainbridge Bishop (1893)":{ref:"Bishop, p.11",english:["red","orange-red or scarlet","orange","gold or yellow-orange","yellow or green-gold","yellow-green","green","greenish-blue or aquamarine","blue","indigo or violet-blue","violet","violet-red","red"],0:[360,96,51],1:[1,89,33],2:[29,94,52],3:[50,93,52],4:[60,90,60],5:[73,73,55],6:[135,76,32],7:[163,62,40],8:[302,88,26],9:[325,84,46],10:[343,79,47],11:[360,96,51]},"H. von Helmholtz (1910)":{ref:"Helmholtz, p.22",english:["yellow","green","greenish blue","cayan-blue","indigo blue","violet","end of red","red","red","red","red orange","orange"],0:[60,90,60],1:[135,76,32],2:[172,68,34],3:[211,70,37],4:[302,88,26],5:[325,84,46],6:[330,84,34],7:[360,96,51],8:[10,91,43],9:[10,91,43],10:[8,93,51],11:[28,89,50]},"Alexander Scriabin (1911)":{ref:"Jones, p.104",english:["red","violet","yellow","steely with the glint of metal","pearly blue the shimmer of moonshine","dark red","bright blue","rosy orange","purple","green","steely with a glint of metal","pearly blue the shimmer of moonshine"],0:[360,96,51],1:[325,84,46],2:[60,90,60],3:[245,21,43],4:[211,70,37],5:[1,89,33],6:[248,82,28],7:[29,94,52],8:[302,88,26],9:[135,76,32],10:[245,21,43],11:[211,70,37]},"Adrian Bernard Klein (1930)":{ref:"Klein, p.209",english:["dark red","red","red orange","orange","yellow","yellow green","green","blue-green","blue","blue violet","violet","dark violet"],0:[0,91,40],1:[360,96,51],2:[14,91,51],3:[29,94,52],4:[60,90,60],5:[73,73,55],6:[135,76,32],7:[172,68,34],8:[248,82,28],9:[292,70,31],10:[325,84,46],11:[330,84,34]},"August Aeppli (1940)":{ref:"Gerstner, p.169",english:["red",null,"orange",null,"yellow",null,"green","blue-green",null,"ultramarine blue","violet","purple"],0:[0,96,51],1:[0,0,0],2:[29,94,52],3:[0,0,0],4:[60,90,60],5:[0,0,0],6:[135,76,32],7:[172,68,34],8:[0,0,0],9:[211,70,37],10:[273,80,27],11:[302,88,26]},"I. J. Belmont (1944)":{ref:"Belmont, p.226",english:["red","red-orange","orange","yellow-orange","yellow","yellow-green","green","blue-green","blue","blue-violet","violet","red-violet"],0:[360,96,51],1:[14,91,51],2:[29,94,52],3:[50,93,52],4:[60,90,60],5:[73,73,55],6:[135,76,32],7:[172,68,34],8:[248,82,28],9:[313,78,37],10:[325,84,46],11:[338,85,37]},"Steve Zieverink (2004)":{ref:"Cincinnati Contemporary Art Center",english:["yellow-green","green","blue-green","blue","indigo","violet","ultra violet","infra red","red","orange","yellow-white","yellow"],0:[73,73,55],1:[135,76,32],2:[172,68,34],3:[248,82,28],4:[302,88,26],5:[325,84,46],6:[326,79,24],7:[1,89,33],8:[360,96,51],9:[29,94,52],10:[62,78,74],11:[60,90,60]},"Circle of Fifths (2012)":{ref:"Stuart Wheatman",english:[],data:["#122400","#2E002E","#002914","#470000","#002142","#2E2E00","#290052","#003D00","#520029","#003D3D","#522900","#000080","#244700","#570057","#004D26","#7A0000","#003B75","#4C4D00","#47008F","#006100","#850042","#005C5C","#804000","#0000C7","#366B00","#80007F","#00753B","#B80000","#0057AD","#6B6B00","#6600CC","#008A00","#B8005C","#007F80","#B35900","#2424FF","#478F00","#AD00AD","#00994D","#F00000","#0073E6","#8F8F00","#8A14FF","#00AD00","#EB0075","#00A3A3","#E07000","#6B6BFF","#5CB800","#DB00DB","#00C261","#FF5757","#3399FF","#ADAD00","#B56BFF","#00D600","#FF57AB","#00C7C7","#FF9124","#9999FF","#6EDB00","#FF29FF","#00E070","#FF9999","#7ABDFF","#D1D100","#D1A3FF","#00FA00","#FFA3D1","#00E5E6","#FFC285","#C2C2FF","#80FF00","#FFA8FF","#00E070","#FFCCCC","#C2E0FF","#F0F000","#EBD6FF","#ADFFAD","#FFD6EB","#8AFFFF","#FFEBD6","#EBEBFF","#E0FFC2","#FFEBFF","#E5FFF2","#FFF5F5"]}},e.map=function(t){var n={},r=function(e,t){return[e[0]*.5+t[0]*.5+.5>>0,e[1]*.5+t[1]*.5+.5>>0,e[2]*.5+t[2]*.5+.5>>0]},i=e.data,s=i[t]||i["D. D. Jameson (1844)"];for(var o=0;o<=88;o++)if(s.data)n[o]={hsl:s.data[o],hex:s.data[o]};else{var u=s[(o+9)%12],a=u.H||u[0],f=u.S||u[1],l=u.L||u[2];a==f&&f==l&&(u=r(d,s[(o+10)%12]));var c=l/10,h=o/12>>0,p=l+c*h-3*c;n[o]={hsl:"hsla("+a+","+f+"%,"+p+"%, 1)",hex:Color.Space({H:a,S:f,L:p},"HSL>RGB>HEX>W3")};var d=u}return n}}(MusicTheory.Synesthesia);if(typeof widgets=="undefined")var widgets={};(function(){"use strict";var e=Math.PI,t=!document.createElement("canvas").getContext,n=400,r={id:"loader",bars:12,radius:0,lineWidth:20,lineHeight:70,timeout:0,display:!0};widgets.Loader=function(o){if(t)return;var u=this;typeof o=="string"&&(o={message:o}),typeof o=="boolean"&&(o={display:!1}),typeof o=="undefined"&&(o={}),o.container=o.container||document.body;if(!o.container)return;for(var a in r)typeof o[a]=="undefined"&&(o[a]=r[a]);var f=document.getElementById(o.id);if(!f){var l=document.createElement("div"),c=document.createElement("span");c.className="message",l.appendChild(c),l.className=r.id,l.style.cssText=i("opacity",n),this.span=c,this.div=l;var f=document.createElement("canvas");document.body.appendChild(f),f.id=o.id,f.style.cssText="opacity: 1; position: absolute; z-index: 10000;",l.appendChild(f),o.container.appendChild(l)}else this.span=f.parentNode.getElementsByTagName("span")[0];var h=o.delay,p=o.bars,d=o.radius,v=o.lineHeight+20,m=v*2+o.radius*2,g=s(o.container),y=g.width-m,b=g.height-m,w=window.devicePixelRatio||1;f.width=m*w,f.height=m*w;var E=0,S=f.getContext("2d");S.globalCompositeOperation="lighter",S.shadowOffsetX=1,S.shadowOffsetY=1,S.shadowBlur=1,S.shadowColor="rgba(0, 0, 0, 0.5)",this.messages={},this.message=function(e,t){return this.interval?this.add({message:e,onstart:t}):this.start(t,e)},this.update=function(e,t,n){if(!e)for(var e in this.messages);var r=this.messages[e];r.message=t,typeof n=="number"&&(r.span.innerHTML=n+"%"),t.substr(-3)==="..."?(r._message=t.substr(0,t.length-3),r.messageAnimate=[". ",".. ","..."].reverse()):(r._message=t,r.messageAnimate=!1),r.element.innerHTML=t},this.add=function(e){typeof e=="string"&&(e={message:e});var t=o.background?o.background:"rgba(0,0,0,0.65)";this.span.style.cssText="background: "+t+";",this.div.style.cssText=i("opacity",n),this.stopPropagation?this.div.style.cssText+="background: rgba(0,0,0,0.25);":this.div.style.cssText+="pointer-events: none;",f.parentNode.style.opacity=1,f.parentNode.style.display="block",o.background&&(this.div.style.background=o.backgrond);var r=(new Date).getTime(),s=Math.abs(r*Math.random()>>0),u=e.message,a=document.createElement("div");a.style.cssText=i("opacity",500);var l=document.createElement("span");l.style.cssText="float: right; width: 50px;";var c=document.createElement("span");c.innerHTML=u,a.appendChild(c),a.appendChild(l);var h=this.messages[s]={seed:s,container:a,element:c,span:l,message:u,timeout:(e.timeout||o.timeout)*1e3,timestamp:r,getProgress:e.getProgress};return this.span.appendChild(a),this.span.style.display="block",this.update(h.seed,u),e.onstart&&window.setTimeout(e.onstart,50),this.center(),this.interval||(e.delay||N(),window.clearInterval(this.interval),this.interval=window.setInterval(N,30)),s},this.remove=function(e){E+=.07;var t=(new Date).getTime();typeof e=="object"&&(e=e.join(":")),e&&(e=":"+e+":");for(var n in this.messages){var r=this.messages[n];if(!e||e.indexOf(":"+r.seed+":")!==-1)delete this.messages[r.seed],r.container.style.color="#99ff88",T(r),r.getProgress&&(r.span.innerHTML="100%")}},this.start=function(e,t){if(!t&&!o.message)return;return this.add({message:t||o.message,onstart:e})},this.stop=function(){this.remove(),window.clearInterval(this.interval),delete this.interval,o.oncomplete&&o.oncomplete(),f&&f.style&&(l.style.cssText+="pointer-events: none;",window.setTimeout(function(){u.div.style.opacity=0},1),window.setTimeout(function(){if(u.interval)return;u.stopPropagation=!1,f.parentNode.style.display="none",S.clearRect(0,0,m,m)},n*1e3))},this.center=function(){var e=s(o.container),t=e.width-m,n=e.height-m;f.style.left=t/2+"px",f.style.top=n/2+"px",f.style.width=m+"px",f.style.height=m+"px",u.span.style.top=n/2+m-10+"px"};var x=document.createElement("style");x.innerHTML=".loader { color: #fff; position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 100000; opacity: 0; display: none; }.loader span.message { line-height: 1.5em; font-family: monospace; font-size: 14px; margin: auto; opacity: 1; display: none; border-radius: 10px; padding: 0px; width: 300px; text-align: center; position: absolute; z-index: 10000; left: 0; right: 0; }.loader span.message div { border-bottom: 1px solid #222; padding: 5px 10px; clear: both; text-align: left; opacity: 1; }.loader span.message div:last-child { border-bottom: none; }",document.head.appendChild(x);var T=function(e){window.setTimeout(function(){e.container.style.opacity=0},1),window.setTimeout(function(){e.container.parentNode.removeChild(e.container)},250)},N=function(){var t=(new Date).getTime();for(var n in u.messages){var r=u.messages[n],i=E/.07>>0;if(i%5===0&&r.getProgress){if(r.timeout&&r.timestamp&&t-r.timestamp>r.timeout){u.remove(r.seed);continue}var s=r.getProgress();if(s>=100){u.remove(r.seed);continue}r.span.innerHTML=(s>>0)+"%"}if(i%10===0&&r.messageAnimate){var a=r.messageAnimate.length,f=i/10%a,l=r._message+r.messageAnimate[f];r.element.innerHTML=l}}n||u.stop(),S.save(),S.clearRect(0,0,m*w,m*w),S.scale(w,w),S.translate(m/2,m/2);var c=360-360/p;for(var h=0;h\r\n";document.write(IEBinaryToArray_ByteStr_Script),DOMLoader.sendRequest=function(e){function t(e){var t={};for(var n=0;n<256;n++)for(var r=0;r<256;r++)t[String.fromCharCode(n+r*256)]=String.fromCharCode(n)+String.fromCharCode(r);var i=IEBinaryToArray_ByteStr(e),s=IEBinaryToArray_ByteStr_Last(e);return i.replace(/[\s\S]/g,function(e){return t[e]})+s}var n=XMLHttpRequest();return n.open("GET",e.url,!0),e.responseType&&(n.responseType=e.responseType),e.onerror&&(n.onerror=e.onerror),e.onprogress&&(n.onprogress=e.onprogress),n.onreadystatechange=function(r){n.readyState===4&&(n.status===200?n.responseText=t(n.responseBody):n=!1,e.onload&&e.onload(n))},n.setRequestHeader("Accept-Charset","x-user-defined"),n.send(null),n}}else DOMLoader.sendRequest=function(e){var t=new XMLHttpRequest;return t.open(e.data?"POST":"GET",e.url,!0),t.overrideMimeType&&t.overrideMimeType("text/plain; charset=x-user-defined"),e.data&&t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),e.responseType&&(t.responseType=e.responseType),e.onerror&&(t.onerror=e.onerror),e.onprogress&&(t.onprogress=e.onprogress),t.onreadystatechange=function(n){if(t.readyState===4){if(t.status!==200&&t.status!=304){e.onerror&&e.onerror(n,!1);return}e.onload&&e.onload(t)}},t.send(e.data),t};if(typeof Event=="undefined")var Event={};if(typeof eventjs=="undefined")var eventjs=Event;Event=function(e){"use strict";e.modifyEventListener=!1,e.modifySelectors=!1,e.add=function(e,t,r,i){return n(e,t,r,i,"add")},e.remove=function(e,t,r,i){return n(e,t,r,i,"remove")},e.stop=function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.bubble=0},e.prevent=function(e){e.preventDefault&&e.preventDefault(),e.returnValue=!1},e.cancel=function(t){e.stop(t),e.prevent(t)},e.supports=function(e,t){typeof e=="string"&&(t=e,e=window),t="on"+t;if(t in e)return!0;e.setAttribute||(e=document.createElement("div"));if(e.setAttribute&&e.removeAttribute){e.setAttribute(t,"");var n=typeof e[t]=="function";return typeof e[t]!="undefined"&&(e[t]=null),e.removeAttribute(t),n}};var t=function(e){if(!e||typeof e!="object")return e;var n=new e.constructor;for(var r in e)!e[r]||typeof e[r]!="object"?n[r]=e[r]:n[r]=t(e[r]);return n},n=function(u,c,h,p,d,v){p=p||{};if(typeof u=="string"&&c==="ready"){var m=(new Date).getTime(),g=p.timeout,y=p.interval||1e3/60,b=window.setInterval(function(){(new Date).getTime()-m>g&&window.clearInterval(b),document.querySelector(u)&&(window.clearInterval(b),h())},y);return}if(typeof u=="string"){u=document.querySelectorAll(u);if(u.length===0)return i("Missing target on listener!");u.length===1&&(u=u[0])}var w,E={};if(u.length>0){for(var S=0,x=u.length;S=r.maxFingers){var h=[];for(var c in r.tracker)h.push(c);return n.identifier=h.join(","),s}var p=0;for(var d in o){if(o[d].up){delete o[d],i(l,c),r.cancel=!0;break}p++}if(o[c])continue;i(l,c)}else o=r.tracker={},n.bbox=r.bbox=e.getBoundingBox(r.target),r.fingers=0,r.cancel=!1,i(l,c)}var h=[];for(var c in r.tracker)h.push(c);return n.identifier=h.join(","),s},e.pointerEnd=function(e,t,n,r){var i=e.touches||[],s=i.length,o={};for(var u=0;u1)return;var s=n.changedTouches||e.getCoords(n),o=s[0],u=t.bbox,a=e.getBoundingBox(t.target);if(t.position==="relative")var f=(o.pageX+u.scrollLeft-u.x1)*u.scaleX,l=(o.pageY+u.scrollTop-u.y1)*u.scaleY;else var f=o.pageX-u.x1,l=o.pageY-u.y1;f>0&&f0&&l0&&l0&&c1)&&(a.state=t.gesture,t.listener(o,a)),clearTimeout(s),r=i=0)};var a=e.pointerSetup(t);return a.state="dblclick",Event.add(t.target,"mousedown",t.onPointerDown),a},Event.Gesture=Event.Gesture||{},Event.Gesture._gestureHandlers=Event.Gesture._gestureHandlers||{},Event.Gesture._gestureHandlers.dbltap=e.dbltap,Event.Gesture._gestureHandlers.dblclick=e.dblclick,e}(Event.proxy);if(typeof Event=="undefined")var Event={};typeof Event.proxy=="undefined"&&(Event.proxy={}),Event.proxy=function(e){"use strict";return e.dragElement=function(t,n){e.drag({event:n,target:t,position:"move",listener:function(e,n){t.style.left=n.x+"px",t.style.top=n.y+"px"}})},e.drag=function(t){t.gesture="drag",t.onPointerDown=function(r){e.pointerStart(r,n,t)&&(Event.add(t.doc,"mousemove",t.onPointerMove),Event.add(t.doc,"mouseup",t.onPointerUp)),t.onPointerMove(r,"down")},t.onPointerMove=function(r,i){var s=t.bbox,o=r.changedTouches||e.getCoords(r),u=o.length;for(var a=0;a0?x:-x,typeof c.DEG2!="undefined"&&(x>0?c.rotation+=c.DEG1-c.DEG2:c.rotation-=c.DEG1-c.DEG2,v+=c.rotation),a.push(c.move)}r.touches=a,r.fingers=n.fingers,r.scale=d/n.fingers,r.rotation=v/n.fingers,r.state="change",n.listener(i,r)},n.onPointerUp=function(t){var i=n.fingers;e.pointerEnd(t,r,n)&&(Event.remove(n.doc,"mousemove",n.onPointerMove),Event.remove(n.doc,"mouseup",n.onPointerUp)),i===n.minFingers&&n.fingersn){var w=p*g/b,E=Math.abs(w+y.value);y.value&&En.threshold&&(f.x/=h,f.y/=h,r.start=f,r.x=l/h,r.y=c/h,r.angle=-(((u/n.snap+.5>>0)*n.snap||360)-360),r.velocity=s,r.fingers=n.gestureFingers,r.state="swipe",n.listener(i,r))}};var r=e.pointerSetup(n);return Event.add(n.target,"mousedown",n.onPointerDown),r},Event.Gesture=Event.Gesture||{},Event.Gesture._gestureHandlers=Event.Gesture._gestureHandlers||{},Event.Gesture._gestureHandlers.swipe=e.swipe,e}(Event.proxy);if(typeof Event=="undefined")var Event={};typeof Event.proxy=="undefined"&&(Event.proxy={}),Event.proxy=function(e){"use strict";return e.tap=e.longpress=function(t){t.delay=t.delay||500,t.timeout=t.timeout||250;var n,r;t.onPointerDown=function(s){if(e.pointerStart(s,i,t)){n=(new Date).getTime(),Event.add(t.doc,"mousemove",t.onPointerMove).listener(s),Event.add(t.doc,"mouseup",t.onPointerUp);if(t.gesture!=="longpress")return;r=setTimeout(function(){if(s.cancelBubble&&++s.bubble>1)return;var e=0;for(var n in t.tracker){if(t.tracker[n].end===!0)return;if(t.cancel)return;e++}i.state="start",i.fingers=e,t.listener(s,i)},t.delay)}},t.onPointerMove=function(n){var r=t.bbox,i=n.changedTouches||e.getCoords(n),s=i.length;for(var o=0;o0&&l0&&c1)return;if(t.gesture==="longpress"){i.state==="start"&&(i.state="end",t.listener(s,i));return}if(t.cancel)return;if((new Date).getTime()-n>t.timeout)return;i.state="tap",i.fingers=t.gestureFingers,t.listener(s,i)}};var i=e.pointerSetup(t);return Event.add(t.target,"mousedown",t.onPointerDown),i},Event.Gesture=Event.Gesture||{},Event.Gesture._gestureHandlers=Event.Gesture._gestureHandlers||{},Event.Gesture._gestureHandlers.tap=e.tap,Event.Gesture._gestureHandlers.longpress=e.longpress,e}(Event.proxy);if(typeof Event=="undefined")var Event={};typeof Event.proxy=="undefined"&&(Event.proxy={}),Event.proxy=function(e){"use strict";return e.wheel=function(e){var t,n=e.timeout||150,r=0,i={gesture:"wheel",state:"start",wheelDelta:0,target:e.target,listener:e.listener,remove:function(){e.target[u](a,s,!1)}},s=function(s){s=s||window.event,i.state=r++?"change":"start",i.wheelDelta=s.detail?s.detail*-20:s.wheelDelta,e.listener(s,i),clearTimeout(t),t=setTimeout(function(){r=0,i.state="end",i.wheelDelta=0,e.listener(s,i)},n)},o=document.addEventListener?"addEventListener":"attachEvent",u=document.removeEventListener?"removeEventListener":"detachEvent",a=Event.supports("mousewheel")?"mousewheel":"DOMMouseScroll";return e.target[o](a,s,!1),i},Event.Gesture=Event.Gesture||{},Event.Gesture._gestureHandlers=Event.Gesture._gestureHandlers||{},Event.Gesture._gestureHandlers.wheel=e.wheel,e}(Event.proxy);
\ No newline at end of file
+if(typeof MIDI=="undefined")var MIDI={};(function(){"use strict";var e={},t=function(t){var n=new Audio,r=t.split(";")[0];n.id="audio",n.setAttribute("preload","auto"),n.setAttribute("audiobuffer",!0),n.addEventListener("canplaythrough",function(){e[r]=!0},!1),n.src="data:"+t,document.body.appendChild(n)};MIDI.audioDetect=function(n){if(typeof Audio=="undefined")return n({});var r=new Audio;if(typeof r.canPlayType=="undefined")return n(e);var i=r.canPlayType('audio/ogg; codecs="vorbis"');i=i==="probably"||i==="maybe";var s=r.canPlayType("audio/mpeg");s=s==="probably"||s==="maybe";if(!i&&!s){n(e);return}i&&t("audio/ogg;base64,T2dnUwACAAAAAAAAAADqnjMlAAAAAOyyzPIBHgF2b3JiaXMAAAAAAUAfAABAHwAAQB8AAEAfAACZAU9nZ1MAAAAAAAAAAAAA6p4zJQEAAAANJGeqCj3//////////5ADdm9yYmlzLQAAAFhpcGguT3JnIGxpYlZvcmJpcyBJIDIwMTAxMTAxIChTY2hhdWZlbnVnZ2V0KQAAAAABBXZvcmJpcw9CQ1YBAAABAAxSFCElGVNKYwiVUlIpBR1jUFtHHWPUOUYhZBBTiEkZpXtPKpVYSsgRUlgpRR1TTFNJlVKWKUUdYxRTSCFT1jFloXMUS4ZJCSVsTa50FkvomWOWMUYdY85aSp1j1jFFHWNSUkmhcxg6ZiVkFDpGxehifDA6laJCKL7H3lLpLYWKW4q91xpT6y2EGEtpwQhhc+211dxKasUYY4wxxsXiUyiC0JBVAAABAABABAFCQ1YBAAoAAMJQDEVRgNCQVQBABgCAABRFcRTHcRxHkiTLAkJDVgEAQAAAAgAAKI7hKJIjSZJkWZZlWZameZaouaov+64u667t6roOhIasBACAAAAYRqF1TCqDEEPKQ4QUY9AzoxBDDEzGHGNONKQMMogzxZAyiFssLqgQBKEhKwKAKAAAwBjEGGIMOeekZFIi55iUTkoDnaPUUcoolRRLjBmlEluJMYLOUeooZZRCjKXFjFKJscRUAABAgAMAQICFUGjIigAgCgCAMAYphZRCjCnmFHOIMeUcgwwxxiBkzinoGJNOSuWck85JiRhjzjEHlXNOSuekctBJyaQTAAAQ4AAAEGAhFBqyIgCIEwAwSJKmWZomipamiaJniqrqiaKqWp5nmp5pqqpnmqpqqqrrmqrqypbnmaZnmqrqmaaqiqbquqaquq6nqrZsuqoum65q267s+rZru77uqapsm6or66bqyrrqyrbuurbtS56nqqKquq5nqq6ruq5uq65r25pqyq6purJtuq4tu7Js664s67pmqq5suqotm64s667s2rYqy7ovuq5uq7Ks+6os+75s67ru2rrwi65r66os674qy74x27bwy7ouHJMnqqqnqq7rmarrqq5r26rr2rqmmq5suq4tm6or26os67Yry7aumaosm64r26bryrIqy77vyrJui67r66Ys67oqy8Lu6roxzLat+6Lr6roqy7qvyrKuu7ru+7JuC7umqrpuyrKvm7Ks+7auC8us27oxuq7vq7It/KosC7+u+8Iy6z5jdF1fV21ZGFbZ9n3d95Vj1nVhWW1b+V1bZ7y+bgy7bvzKrQvLstq2scy6rSyvrxvDLux8W/iVmqratum6um7Ksq/Lui60dd1XRtf1fdW2fV+VZd+3hV9pG8OwjK6r+6os68Jry8ov67qw7MIvLKttK7+r68ow27qw3L6wLL/uC8uq277v6rrStXVluX2fsSu38QsAABhwAAAIMKEMFBqyIgCIEwBAEHIOKQahYgpCCKGkEEIqFWNSMuakZM5JKaWUFEpJrWJMSuaclMwxKaGUlkopqYRSWiqlxBRKaS2l1mJKqcVQSmulpNZKSa2llGJMrcUYMSYlc05K5pyUklJrJZXWMucoZQ5K6iCklEoqraTUYuacpA46Kx2E1EoqMZWUYgupxFZKaq2kFGMrMdXUWo4hpRhLSrGVlFptMdXWWqs1YkxK5pyUzDkqJaXWSiqtZc5J6iC01DkoqaTUYiopxco5SR2ElDLIqJSUWiupxBJSia20FGMpqcXUYq4pxRZDSS2WlFosqcTWYoy1tVRTJ6XFklKMJZUYW6y5ttZqDKXEVkqLsaSUW2sx1xZjjqGkFksrsZWUWmy15dhayzW1VGNKrdYWY40x5ZRrrT2n1mJNMdXaWqy51ZZbzLXnTkprpZQWS0oxttZijTHmHEppraQUWykpxtZara3FXEMpsZXSWiypxNhirLXFVmNqrcYWW62ltVprrb3GVlsurdXcYqw9tZRrrLXmWFNtBQAADDgAAASYUAYKDVkJAEQBAADGMMYYhEYpx5yT0ijlnHNSKucghJBS5hyEEFLKnINQSkuZcxBKSSmUklJqrYVSUmqttQIAAAocAAACbNCUWByg0JCVAEAqAIDBcTRNFFXVdX1fsSxRVFXXlW3jVyxNFFVVdm1b+DVRVFXXtW3bFn5NFFVVdmXZtoWiqrqybduybgvDqKqua9uybeuorqvbuq3bui9UXVmWbVu3dR3XtnXd9nVd+Bmzbeu2buu+8CMMR9/4IeTj+3RCCAAAT3AAACqwYXWEk6KxwEJDVgIAGQAAgDFKGYUYM0gxphhjTDHGmAAAgAEHAIAAE8pAoSErAoAoAADAOeecc84555xzzjnnnHPOOeecc44xxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY0wAwE6EA8BOhIVQaMhKACAcAABACCEpKaWUUkoRU85BSSmllFKqFIOMSkoppZRSpBR1lFJKKaWUIqWgpJJSSimllElJKaWUUkoppYw6SimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaVUSimllFJKKaWUUkoppRQAYPLgAACVYOMMK0lnhaPBhYasBAByAwAAhRiDEEJpraRUUkolVc5BKCWUlEpKKZWUUqqYgxBKKqmlklJKKbXSQSihlFBKKSWUUkooJYQQSgmhlFRCK6mEUkoHoYQSQimhhFRKKSWUzkEoIYUOQkmllNRCSB10VFIpIZVSSiklpZQ6CKGUklJLLZVSWkqpdBJSKamV1FJqqbWSUgmhpFZKSSWl0lpJJbUSSkklpZRSSymFVFJJJYSSUioltZZaSqm11lJIqZWUUkqppdRSSiWlkEpKqZSSUmollZRSaiGVlEpJKaTUSimlpFRCSamlUlpKLbWUSkmptFRSSaWUlEpJKaVSSksppRJKSqmllFpJKYWSUkoplZJSSyW1VEoKJaWUUkmptJRSSymVklIBAEAHDgAAAUZUWoidZlx5BI4oZJiAAgAAQABAgAkgMEBQMApBgDACAQAAAADAAAAfAABHARAR0ZzBAUKCwgJDg8MDAAAAAAAAAAAAAACAT2dnUwAEAAAAAAAAAADqnjMlAgAAADzQPmcBAQA="),s&&t("audio/mpeg;base64,/+MYxAAAAANIAUAAAASEEB/jwOFM/0MM/90b/+RhST//w4NFwOjf///PZu////9lns5GFDv//l9GlUIEEIAAAgIg8Ir/JGq3/+MYxDsLIj5QMYcoAP0dv9HIjUcH//yYSg+CIbkGP//8w0bLVjUP///3Z0x5QCAv/yLjwtGKTEFNRTMuOTeqqqqqqqqqqqqq/+MYxEkNmdJkUYc4AKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq");var o=(new Date).getTime(),u=window.setInterval(function(){for(var t in e);var r=(new Date).getTime(),i=r-o>5e3;if(t||i)window.clearInterval(u),n(e)},1)}})();if(typeof MIDI=="undefined")var MIDI={};typeof MIDI.Soundfont=="undefined"&&(MIDI.Soundfont={}),function(){"use strict";var e=!1;MIDI.loadPlugin=function(e){typeof e=="function"&&(e={callback:e});var r=e.instruments||e.instrument||"acoustic_grand_piano";typeof r!="object"&&(r=[r]),r.map(function(e){return typeof e=="number"&&(e=MIDI.GeneralMIDI.byId[e]),e}),MIDI.soundfontUrl=e.soundfontUrl||MIDI.soundfontUrl||"./soundfont/",MIDI.audioDetect(function(i){var s="";typeof s=="undefined"&&(n[window.location.hash]?s=window.location.hash.substr(1):s=""),s===""&&(navigator.requestMIDIAccess?s="webmidi":window.webkitAudioContext?s="webaudio":window.Audio?s="audiotag":s="flash");if(!t[s])return;var o=i["audio/ogg"]?"ogg":"mp3";t[s](o,r,e.callback)})};var t={};t.webmidi=function(e,t,n){MIDI.loader&&MIDI.loader.message("Web MIDI API..."),MIDI.WebMIDI.connect(n)},t.flash=function(e,t,n){MIDI.loader&&MIDI.loader.message("Flash API..."),DOMLoader.script.add({src:"./inc/SoundManager2/script/soundmanager2.js",verify:"SoundManager",callback:function(){MIDI.Flash.connect(n)}})},t.audiotag=function(t,n,s){MIDI.loader&&MIDI.loader.message("HTML5 Audio API...");var o=i({items:n,getNext:function(n){e?DOMLoader.sendRequest({url:MIDI.soundfontUrl+n+"-"+t+".js",onprogress:r,onload:function(e){MIDI.Soundfont[n]=JSON.parse(e.responseText),MIDI.loader&&MIDI.loader.update(null,"Downloading",100),o.getNext()}}):DOMLoader.script.add({src:MIDI.soundfontUrl+n+"-"+t+".js",verify:n,callback:function(){MIDI.loader&&MIDI.loader.update(null,"Downloading...",100),o.getNext()}})},onComplete:function(){MIDI.AudioTag.connect(s)}})},t.webaudio=function(t,n,s){MIDI.loader&&MIDI.loader.message("Web Audio API...");var o=i({items:n,getNext:function(n){e?DOMLoader.sendRequest({url:MIDI.soundfontUrl+n+"-"+t+".js",onprogress:r,onload:function(e){MIDI.Soundfont[n]=JSON.parse(e.responseText),MIDI.loader&&MIDI.loader.update(null,"Downloading...",100),o.getNext()}}):DOMLoader.script.add({src:MIDI.soundfontUrl+n+"-"+t+".js",verify:"MIDI.Soundfont."+n,callback:function(){MIDI.loader&&MIDI.loader.update(null,"Downloading...",100),o.getNext()}})},onComplete:function(){MIDI.WebAudioAPI.connect(s)}})};var n={"#webmidi":!0,"#webaudio":!0,"#audiotag":!0,"#flash":!0},r=function(e){this.totalSize||(this.getResponseHeader("Content-Length-Raw")?this.totalSize=parseInt(this.getResponseHeader("Content-Length-Raw")):this.totalSize=e.total);var t=this.totalSize?Math.round(e.loaded/this.totalSize*100):"";MIDI.loader&&MIDI.loader.update(null,"Downloading...",t)},i=function(e){var t={};t.queue=[];for(var n in e.items)t.queue.push(e.items[n]);return t.getNext=function(){if(!t.queue.length)return e.onComplete();e.getNext(t.queue.shift())},setTimeout(t.getNext,1),t}}();if(typeof MIDI=="undefined")var MIDI={};(function(){"use strict";(function(){var e=null,t=null,n=[],r=MIDI.WebMIDI={};r.setVolume=function(e,n){t.send([176+e,7,n])},r.programChange=function(e,n){t.send([192+e,n])},r.noteOn=function(e,n,r,i){t.send([144+e,n,r],i*1e3)},r.noteOff=function(e,n,r){t.send([128+e,n],r*1e3)},r.chordOn=function(e,n,r,i){for(var s=0;sProcessing: "+(r/87*100>>0)+"%
"+l),n.id=f,i[r]=n;if(i.length===t.length){while(i.length){n=i.pop();if(!n)continue;var c=MIDI.keyToNote[n.id];s[a+""+c]=n}o(e)}})};t.setVolume=function(e){i=e},t.programChange=function(e,t){MIDI.channels[e].instrument=t},t.noteOn=function(e,t,o,u){if(!MIDI.channels[e])return;var a=MIDI.channels[e].instrument;if(!s[a+""+t])return;u>0,s=n[r%12]+i;MIDI.keyToNote[s]=r,MIDI.noteToKey[r]=s}}()})();if(typeof MIDI=="undefined")var MIDI={};typeof MIDI.Player=="undefined"&&(MIDI.Player={}),function(){"use strict";var e=MIDI.Player;e.callback=undefined,e.currentTime=0,e.endTime=0,e.restart=0,e.playing=!1,e.timeWarp=1,e.start=e.resume=function(){e.currentTime<-1&&(e.currentTime=-1),f(e.currentTime)},e.pause=function(){var t=e.restart;l(),e.restart=t},e.stop=function(){l(),e.restart=0,e.currentTime=0},e.addListener=function(e){s=e},e.removeListener=function(){s=undefined},e.clearAnimation=function(){e.interval&&window.clearInterval(e.interval)},e.setAnimation=function(t){var n=typeof t=="function"?t:t.callback,r=t.interval||30,s=0,o=0,u=0;e.clearAnimation(),e.interval=window.setInterval(function(){if(e.endTime===0)return;e.playing?(s=u===e.currentTime?o-(new Date).getTime():0,e.currentTime===0?s=0:s=e.currentTime-s,u!==e.currentTime&&(o=(new Date).getTime(),u=e.currentTime)):s=e.currentTime;var t=e.endTime,r=s/t,a=s/1e3,f=a/60,l=a-f*60,c=f*60+l,h=t/1e3;if(h-c<-1)return;n({now:c,end:h,events:i})},r)},e.loadMidiFile=function(){e.replayer=new Replayer(MidiFile(e.currentData),e.timeWarp),e.data=e.replayer.getData(),e.endTime=a()},e.loadFile=function(t,n){e.stop();if(t.indexOf("base64,")!==-1){var r=window.atob(t.split(",")[1]);e.currentData=r,e.loadMidiFile(),n&&n(r);return}var i=t.split(" - ")[1]||t;document.getElementById("playback-title").innerHTML=i.replace(".mid","");var s=new XMLHttpRequest;s.open("GET",t),s.overrideMimeType("text/plain; charset=x-user-defined"),s.onreadystatechange=function(){if(this.readyState===4&&this.status===200){var t=this.responseText||"",r=[],i=t.length,s=String.fromCharCode;for(var o=0;o\r\n";document.write(IEBinaryToArray_ByteStr_Script),DOMLoader.sendRequest=function(e){function t(e){var t={};for(var n=0;n<256;n++)for(var r=0;r<256;r++)t[String.fromCharCode(n+r*256)]=String.fromCharCode(n)+String.fromCharCode(r);var i=IEBinaryToArray_ByteStr(e),s=IEBinaryToArray_ByteStr_Last(e);return i.replace(/[\s\S]/g,function(e){return t[e]})+s}var n=XMLHttpRequest();return n.open("GET",e.url,!0),e.responseType&&(n.responseType=e.responseType),e.onerror&&(n.onerror=e.onerror),e.onprogress&&(n.onprogress=e.onprogress),n.onreadystatechange=function(r){n.readyState===4&&(n.status===200?n.responseText=t(n.responseBody):n=!1,e.onload&&e.onload(n))},n.setRequestHeader("Accept-Charset","x-user-defined"),n.send(null),n}}else DOMLoader.sendRequest=function(e){var t=new XMLHttpRequest;return t.open(e.data?"POST":"GET",e.url,!0),t.overrideMimeType&&t.overrideMimeType("text/plain; charset=x-user-defined"),e.data&&t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),e.responseType&&(t.responseType=e.responseType),e.onerror&&(t.onerror=e.onerror),e.onprogress&&(t.onprogress=e.onprogress),t.onreadystatechange=function(n){if(t.readyState===4){if(t.status!==200&&t.status!=304){e.onerror&&e.onerror(n,!1);return}e.onload&&e.onload(t)}},t.send(e.data),t};if(typeof DOMLoader=="undefined")var DOMLoader={};(function(){"use strict";DOMLoader.script=function(){return this.loaded={},this.loading={},this},DOMLoader.script.prototype.add=function(e){var t=this;typeof e=="string"&&(e={src:e});var n=e.srcs;typeof n=="undefined"&&(n=[{src:e.src,verify:e.verify}]);var r=document.getElementsByTagName("head")[0],i=function(e,n){if(t.loaded[e.src])return;if(n&&typeof window[n]=="undefined")return;t.loaded[e.src]=!0,t.loading[e.src]&&t.loading[e.src](),delete t.loading[e.src],e.callback&&e.callback(),typeof f!="undefined"&&f()},s=[],o=function(n){typeof n=="string"&&(n={src:n,verify:e.verify});if(/([\w\d.])$/.test(n.verify)){n.test=n.verify;if(typeof n.test=="object")for(var o in n.test)s.push(n.test[o]);else s.push(n.test)}if(t.loaded[n.src])return;var u=document.createElement("script");u.onreadystatechange=function(){if(this.readyState!=="loaded"&&this.readyState!=="complete")return;i(n)},u.onload=function(){i(n)},u.onerror=function(){},u.setAttribute("type","text/javascript"),u.setAttribute("src",n.src),r.appendChild(u),t.loading[n.src]=function(){}},u=function(t){if(t)i(t,t.test);else for(var r=0;r
+
-
+
diff --git a/grunt.js b/grunt.js
index ca4b6d6..604db65 100644
--- a/grunt.js
+++ b/grunt.js
@@ -10,10 +10,23 @@
module.exports = function (grunt) {
grunt.initConfig({
concat: {
- 'build/MIDI.js': "./js/**"
+ 'build/MIDI.js': [
+ "./js/MIDI/AudioDetect.js",
+ "./js/MIDI/LoadPlugin.js",
+ "./js/MIDI/Plugin.js",
+ "./js/MIDI/Player.js",
+ "./js/Window/DOMLoader.XMLHttp.js", // req when using XHR
+ "./js/Window/DOMLoader.script.js", // req otherwise
+// "./js/Color/SpaceW3.js", // optional
+// "./js/MusicTheory/Synesthesia.js", // optional
+// "./js/Widgets/Loader.js", // optional
+// "./js/Window/Event.js" // optional
+ ]
},
min: {
- 'build/MIDI.min.js': ['build/MIDI.js']
+ 'build/MIDI.min.js': [
+ 'build/MIDI.js'
+ ]
}
});
///