@vue-skuilder/courseware 0.1.33 → 0.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CourseWare-BTFRjgBR.js +305 -0
- package/dist/CourseWare-BTFRjgBR.js.map +1 -0
- package/dist/CourseWare-DSeyTAtH.cjs +2 -0
- package/dist/CourseWare-DSeyTAtH.cjs.map +1 -0
- package/dist/assets/CourseWare.css +1 -0
- package/dist/assets/chess.css +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/assets/math.css +1 -0
- package/dist/assets/piano.css +1 -0
- package/dist/assets/sightsing.css +1 -0
- package/dist/assets/typing.css +1 -0
- package/dist/backend.cjs.js +1 -1
- package/dist/backend.cjs.js.map +1 -1
- package/dist/backend.mjs +4 -3
- package/dist/backend.mjs.map +1 -1
- package/dist/chess/components/ChessBoard.vue.d.ts.map +1 -1
- package/dist/chess/composables/useChessgroundBounds.d.ts +24 -0
- package/dist/chess/composables/useChessgroundBounds.d.ts.map +1 -0
- package/dist/chess/questions/puzzle/puzzle.vue.d.ts.map +1 -1
- package/dist/chess-BbHATAzk.js +2949 -0
- package/dist/chess-BbHATAzk.js.map +1 -0
- package/dist/chess-BsgVZARV.cjs +7 -0
- package/dist/chess-BsgVZARV.cjs.map +1 -0
- package/dist/chess-C_2RQEuq.cjs +1 -0
- package/dist/chess-X1bmWmh3.js +3 -0
- package/dist/french-Bxet7hJm.cjs +2 -0
- package/dist/french-Bxet7hJm.cjs.map +1 -0
- package/dist/french-Dk7YG8Td.js +140 -0
- package/dist/french-Dk7YG8Td.js.map +1 -0
- package/dist/french-evUMlbbq.js +3 -0
- package/dist/french-x9P8RRn8.cjs +1 -0
- package/dist/index.cjs.js +2 -170
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +172 -62021
- package/dist/index.mjs.map +1 -1
- package/dist/math-B1oDAkOy.cjs +34 -0
- package/dist/math-B1oDAkOy.cjs.map +1 -0
- package/dist/math-B4HbgYf6.js +13391 -0
- package/dist/math-B4HbgYf6.js.map +1 -0
- package/dist/math-BWlIa6-l.cjs +1 -0
- package/dist/math-DYni7rRl.js +3 -0
- package/dist/piano-BN5Btq91.js +3 -0
- package/dist/piano-Btvkzjfz.cjs +1 -0
- package/dist/piano-CefQUc72.cjs +2 -0
- package/dist/piano-CefQUc72.cjs.map +1 -0
- package/dist/piano-DF1g6yaX.js +3603 -0
- package/dist/piano-DF1g6yaX.js.map +1 -0
- package/dist/pitch-C-lh9ezH.cjs +2 -0
- package/dist/pitch-C-lh9ezH.cjs.map +1 -0
- package/dist/pitch-CgGJFkZ1.js +106 -0
- package/dist/pitch-CgGJFkZ1.js.map +1 -0
- package/dist/pitch-Dn0iNqiS.js +3 -0
- package/dist/pitch-DsopN5IR.cjs +1 -0
- package/dist/{shapes-nszfsx3o.js → shapes-BQUVJdp5.js} +3 -21
- package/dist/shapes-BQUVJdp5.js.map +1 -0
- package/dist/shapes-C_-mvrCc.cjs +2 -0
- package/dist/shapes-C_-mvrCc.cjs.map +1 -0
- package/dist/shapes-DRq8J94A.cjs +2 -0
- package/dist/shapes-DRq8J94A.cjs.map +1 -0
- package/dist/shapes-ICeg46lr.js +25 -0
- package/dist/shapes-ICeg46lr.js.map +1 -0
- package/dist/sightsing-BFQ7HRig.js +41061 -0
- package/dist/sightsing-BFQ7HRig.js.map +1 -0
- package/dist/sightsing-CJX3k0Fd.js +3 -0
- package/dist/sightsing-Cr_SJ5Vc.cjs +133 -0
- package/dist/sightsing-Cr_SJ5Vc.cjs.map +1 -0
- package/dist/sightsing-CtagQ0FJ.cjs +1 -0
- package/dist/typing-BevtfWlp.js +184 -0
- package/dist/typing-BevtfWlp.js.map +1 -0
- package/dist/typing-CBPjtwrg.cjs +1 -0
- package/dist/typing-CK-glKhm.cjs +2 -0
- package/dist/typing-CK-glKhm.cjs.map +1 -0
- package/dist/typing-k-ojjO7G.js +3 -0
- package/dist/word-work-BOnRlZgd.js +108 -0
- package/dist/word-work-BOnRlZgd.js.map +1 -0
- package/dist/word-work-C5MTSapy.cjs +1 -0
- package/dist/word-work-Dd6tIKrt.js +3 -0
- package/dist/word-work-fNbCLNuN.cjs +2 -0
- package/dist/word-work-fNbCLNuN.cjs.map +1 -0
- package/package.json +6 -5
- package/dist/shapes-DJ-ujuDr.cjs +0 -2
- package/dist/shapes-DJ-ujuDr.cjs.map +0 -1
- package/dist/shapes-nszfsx3o.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"piano-CefQUc72.cjs","names":["cache","parse","REGEX","REGEX$1","cache$1","parse$1","transpose","distance","REGEX","cache","get","dictionary","index","get","all","entries","add","get$1","addAlias","index","get","all","entries","add","get$1","tokenize","get","get$1","distance","transpose$1","DATA","add","names","get","name","simplify","index","NAMES","get","transpose","transpose$1","index","get","tokenize","get","transpose","get","get$1","transpose"],"sources":["../../../node_modules/webmidi/webmidi.min.js","../../../node_modules/@tonaljs/core/dist/index.es.js","../../../node_modules/@tonaljs/collection/dist/index.es.js","../../../node_modules/@tonaljs/pcset/dist/index.es.js","../../../node_modules/@tonaljs/chord-type/dist/index.es.js","../../../node_modules/@tonaljs/scale-type/dist/index.es.js","../../../node_modules/@tonaljs/chord/dist/index.es.js","../../../node_modules/@tonaljs/duration-value/dist/index.es.js","../../../node_modules/@tonaljs/interval/dist/index.es.js","../../../node_modules/@tonaljs/midi/dist/index.es.js","../../../node_modules/@tonaljs/note/dist/index.es.js","../../../node_modules/@tonaljs/roman-numeral/dist/index.es.js","../../../node_modules/@tonaljs/key/dist/index.es.js","../../../node_modules/@tonaljs/mode/dist/index.es.js","../../../node_modules/@tonaljs/scale/dist/index.es.js","../src/piano/utility/midi.ts","../src/piano/utility/SyllableSeqVis.vue","../src/piano/utility/SyllableSeqVis.vue","../src/piano/NoteDisplay.vue","../src/piano/NoteDisplay.vue","../src/piano/questions/echo/Playback.vue","../src/piano/questions/echo/Playback.vue","../src/piano/questions/echo/index.ts","../src/piano/questions/playNote/NotePlayback.vue","../src/piano/questions/playNote/NotePlayback.vue","../src/piano/questions/playNote/index.ts","../src/piano/index.ts"],"sourcesContent":["/*\n\nWebMidi v2.5.3\n\nWebMidi.js helps you tame the Web MIDI API. Send and receive MIDI messages with ease. Control instruments with user-friendly functions (playNote, sendPitchBend, etc.). React to MIDI input with simple event listeners (noteon, pitchbend, controlchange, etc.).\nhttps://github.com/djipco/webmidi\n\n\nThe MIT License (MIT)\n\nCopyright (c) 2015-2019, Jean-Philippe Côté\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and\nassociated documentation files (the \"Software\"), to deal in the Software without restriction,\nincluding without limitation the rights to use, copy, modify, merge, publish, distribute,\nsublicense, and/or sell copies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial\nportions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT\nNOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES\nOR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n\n!function(scope){\"use strict\";function WebMidi(){if(WebMidi.prototype._singleton)throw new Error(\"WebMidi is a singleton, it cannot be instantiated directly.\");(WebMidi.prototype._singleton=this)._inputs=[],this._outputs=[],this._userHandlers={},this._stateChangeQueue=[],this._processingStateChange=!1,this._midiInterfaceEvents=[\"connected\",\"disconnected\"],this._nrpnBuffer=[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],this._nrpnEventsEnabled=!0,this._nrpnTypes=[\"entry\",\"increment\",\"decrement\"],this._notes=[\"C\",\"C#\",\"D\",\"D#\",\"E\",\"F\",\"F#\",\"G\",\"G#\",\"A\",\"A#\",\"B\"],this._semitones={C:0,D:2,E:4,F:5,G:7,A:9,B:11},Object.defineProperties(this,{MIDI_SYSTEM_MESSAGES:{value:{sysex:240,timecode:241,songposition:242,songselect:243,tuningrequest:246,sysexend:247,clock:248,start:250,continue:251,stop:252,activesensing:254,reset:255,midimessage:0,unknownsystemmessage:-1},writable:!1,enumerable:!0,configurable:!1},MIDI_CHANNEL_MESSAGES:{value:{noteoff:8,noteon:9,keyaftertouch:10,controlchange:11,channelmode:11,nrpn:11,programchange:12,channelaftertouch:13,pitchbend:14},writable:!1,enumerable:!0,configurable:!1},MIDI_REGISTERED_PARAMETER:{value:{pitchbendrange:[0,0],channelfinetuning:[0,1],channelcoarsetuning:[0,2],tuningprogram:[0,3],tuningbank:[0,4],modulationrange:[0,5],azimuthangle:[61,0],elevationangle:[61,1],gain:[61,2],distanceratio:[61,3],maximumdistance:[61,4],maximumdistancegain:[61,5],referencedistanceratio:[61,6],panspreadangle:[61,7],rollangle:[61,8]},writable:!1,enumerable:!0,configurable:!1},MIDI_CONTROL_CHANGE_MESSAGES:{value:{bankselectcoarse:0,modulationwheelcoarse:1,breathcontrollercoarse:2,footcontrollercoarse:4,portamentotimecoarse:5,dataentrycoarse:6,volumecoarse:7,balancecoarse:8,pancoarse:10,expressioncoarse:11,effectcontrol1coarse:12,effectcontrol2coarse:13,generalpurposeslider1:16,generalpurposeslider2:17,generalpurposeslider3:18,generalpurposeslider4:19,bankselectfine:32,modulationwheelfine:33,breathcontrollerfine:34,footcontrollerfine:36,portamentotimefine:37,dataentryfine:38,volumefine:39,balancefine:40,panfine:42,expressionfine:43,effectcontrol1fine:44,effectcontrol2fine:45,holdpedal:64,portamento:65,sustenutopedal:66,softpedal:67,legatopedal:68,hold2pedal:69,soundvariation:70,resonance:71,soundreleasetime:72,soundattacktime:73,brightness:74,soundcontrol6:75,soundcontrol7:76,soundcontrol8:77,soundcontrol9:78,soundcontrol10:79,generalpurposebutton1:80,generalpurposebutton2:81,generalpurposebutton3:82,generalpurposebutton4:83,reverblevel:91,tremololevel:92,choruslevel:93,celestelevel:94,phaserlevel:95,databuttonincrement:96,databuttondecrement:97,nonregisteredparametercoarse:98,nonregisteredparameterfine:99,registeredparametercoarse:100,registeredparameterfine:101},writable:!1,enumerable:!0,configurable:!1},MIDI_NRPN_MESSAGES:{value:{entrymsb:6,entrylsb:38,increment:96,decrement:97,paramlsb:98,parammsb:99,nullactiveparameter:127},writable:!1,enumerable:!0,configurable:!1},MIDI_CHANNEL_MODE_MESSAGES:{value:{allsoundoff:120,resetallcontrollers:121,localcontrol:122,allnotesoff:123,omnimodeoff:124,omnimodeon:125,monomodeon:126,polymodeon:127},writable:!1,enumerable:!0,configurable:!1},octaveOffset:{value:0,writable:!0,enumerable:!0,configurable:!1}}),Object.defineProperties(this,{supported:{enumerable:!0,get:function(){return\"requestMIDIAccess\"in navigator}},enabled:{enumerable:!0,get:function(){return void 0!==this.interface}.bind(this)},inputs:{enumerable:!0,get:function(){return this._inputs}.bind(this)},outputs:{enumerable:!0,get:function(){return this._outputs}.bind(this)},sysexEnabled:{enumerable:!0,get:function(){return!(!this.interface||!this.interface.sysexEnabled)}.bind(this)},nrpnEventsEnabled:{enumerable:!0,get:function(){return!!this._nrpnEventsEnabled}.bind(this),set:function(enabled){return this._nrpnEventsEnabled=enabled,this._nrpnEventsEnabled}},nrpnTypes:{enumerable:!0,get:function(){return this._nrpnTypes}.bind(this)},time:{enumerable:!0,get:function(){return performance.now()}}})}var wm=new WebMidi;function Input(midiInput){var that=this;this._userHandlers={channel:{},system:{}},this._midiInput=midiInput,Object.defineProperties(this,{connection:{enumerable:!0,get:function(){return that._midiInput.connection}},id:{enumerable:!0,get:function(){return that._midiInput.id}},manufacturer:{enumerable:!0,get:function(){return that._midiInput.manufacturer}},name:{enumerable:!0,get:function(){return that._midiInput.name}},state:{enumerable:!0,get:function(){return that._midiInput.state}},type:{enumerable:!0,get:function(){return that._midiInput.type}}}),this._initializeUserHandlers(),this._midiInput.onmidimessage=this._onMidiMessage.bind(this)}function Output(midiOutput){var that=this;this._midiOutput=midiOutput,Object.defineProperties(this,{connection:{enumerable:!0,get:function(){return that._midiOutput.connection}},id:{enumerable:!0,get:function(){return that._midiOutput.id}},manufacturer:{enumerable:!0,get:function(){return that._midiOutput.manufacturer}},name:{enumerable:!0,get:function(){return that._midiOutput.name}},state:{enumerable:!0,get:function(){return that._midiOutput.state}},type:{enumerable:!0,get:function(){return that._midiOutput.type}}})}WebMidi.prototype.enable=function(callback,sysex){this.enabled||(this.supported?navigator.requestMIDIAccess({sysex:sysex}).then(function(midiAccess){var promiseTimeout,events=[],promises=[];this.interface=midiAccess,this._resetInterfaceUserHandlers(),this.interface.onstatechange=function(e){events.push(e)};for(var inputs=midiAccess.inputs.values(),input=inputs.next();input&&!input.done;input=inputs.next())promises.push(input.value.open());for(var outputs=midiAccess.outputs.values(),output=outputs.next();output&&!output.done;output=outputs.next())promises.push(output.value.open());function onPortsOpen(){clearTimeout(promiseTimeout),this._updateInputsAndOutputs(),this.interface.onstatechange=this._onInterfaceStateChange.bind(this),\"function\"==typeof callback&&callback.call(this),events.forEach(function(event){this._onInterfaceStateChange(event)}.bind(this))}promiseTimeout=setTimeout(onPortsOpen.bind(this),200),Promise&&Promise.all(promises).catch(function(err){}).then(onPortsOpen.bind(this))}.bind(this),function(err){\"function\"==typeof callback&&callback.call(this,err)}.bind(this)):\"function\"==typeof callback&&callback(new Error(\"The Web MIDI API is not supported by your browser.\")))},WebMidi.prototype.disable=function(){if(!this.supported)throw new Error(\"The Web MIDI API is not supported by your browser.\");this.enabled&&(this.removeListener(),this.inputs.forEach(function(input){input.removeListener()})),this.interface&&(this.interface.onstatechange=void 0),this.interface=void 0,this._inputs=[],this._outputs=[],this._nrpnEventsEnabled=!0,this._resetInterfaceUserHandlers()},WebMidi.prototype.addListener=function(type,listener){if(!this.enabled)throw new Error(\"WebMidi must be enabled before adding event listeners.\");if(\"function\"!=typeof listener)throw new TypeError(\"The 'listener' parameter must be a function.\");if(!(0<=this._midiInterfaceEvents.indexOf(type)))throw new TypeError(\"The specified event type is not supported.\");return this._userHandlers[type].push(listener),this},WebMidi.prototype.hasListener=function(type,listener){if(!this.enabled)throw new Error(\"WebMidi must be enabled before checking event listeners.\");if(\"function\"!=typeof listener)throw new TypeError(\"The 'listener' parameter must be a function.\");if(!(0<=this._midiInterfaceEvents.indexOf(type)))throw new TypeError(\"The specified event type is not supported.\");for(var o=0;o<this._userHandlers[type].length;o++)if(this._userHandlers[type][o]===listener)return!0;return!1},WebMidi.prototype.removeListener=function(type,listener){if(!this.enabled)throw new Error(\"WebMidi must be enabled before removing event listeners.\");if(void 0!==listener&&\"function\"!=typeof listener)throw new TypeError(\"The 'listener' parameter must be a function.\");if(0<=this._midiInterfaceEvents.indexOf(type))if(listener)for(var o=0;o<this._userHandlers[type].length;o++)this._userHandlers[type][o]===listener&&this._userHandlers[type].splice(o,1);else this._userHandlers[type]=[];else{if(void 0!==type)throw new TypeError(\"The specified event type is not supported.\");this._resetInterfaceUserHandlers()}return this},WebMidi.prototype.toMIDIChannels=function(channel){var channels;if(\"all\"===channel||void 0===channel)channels=[\"all\"];else{if(\"none\"===channel)return channels=[];channels=Array.isArray(channel)?channel:[channel]}return-1<channels.indexOf(\"all\")&&(channels=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),channels.map(function(ch){return parseInt(ch)}).filter(function(ch){return 1<=ch&&ch<=16})},WebMidi.prototype.getInputById=function(id){if(!this.enabled)throw new Error(\"WebMidi is not enabled.\");id=String(id);for(var i=0;i<this.inputs.length;i++)if(this.inputs[i].id===id)return this.inputs[i];return!1},WebMidi.prototype.getOutputById=function(id){if(!this.enabled)throw new Error(\"WebMidi is not enabled.\");id=String(id);for(var i=0;i<this.outputs.length;i++)if(this.outputs[i].id===id)return this.outputs[i];return!1},WebMidi.prototype.getInputByName=function(name){if(!this.enabled)throw new Error(\"WebMidi is not enabled.\");for(var i=0;i<this.inputs.length;i++)if(~this.inputs[i].name.indexOf(name))return this.inputs[i];return!1},WebMidi.prototype.getOctave=function(number){if(null!=number&&0<=number&&number<=127)return Math.floor(Math.floor(number)/12-1)+Math.floor(wm.octaveOffset)},WebMidi.prototype.getOutputByName=function(name){if(!this.enabled)throw new Error(\"WebMidi is not enabled.\");for(var i=0;i<this.outputs.length;i++)if(~this.outputs[i].name.indexOf(name))return this.outputs[i];return!1},WebMidi.prototype.guessNoteNumber=function(input){var output=!1;if(input&&input.toFixed&&0<=input&&input<=127?output=Math.round(input):0<=parseInt(input)&&parseInt(input)<=127?output=parseInt(input):(\"string\"==typeof input||input instanceof String)&&(output=this.noteNameToNumber(input)),!1===output)throw new Error(\"Invalid input value (\"+input+\").\");return output},WebMidi.prototype.noteNameToNumber=function(name){\"string\"!=typeof name&&(name=\"\");var matches=name.match(/([CDEFGAB])(#{0,2}|b{0,2})(-?\\d+)/i);if(!matches)throw new RangeError(\"Invalid note name.\");var semitones=wm._semitones[matches[1].toUpperCase()],result=12*(parseInt(matches[3])+1-Math.floor(wm.octaveOffset))+semitones;if(-1<matches[2].toLowerCase().indexOf(\"b\")?result-=matches[2].length:-1<matches[2].toLowerCase().indexOf(\"#\")&&(result+=matches[2].length),result<0||127<result)throw new RangeError(\"Invalid note name or note outside valid range.\");return result},WebMidi.prototype._updateInputsAndOutputs=function(){this._updateInputs(),this._updateOutputs()},WebMidi.prototype._updateInputs=function(){for(var i=0;i<this._inputs.length;i++){for(var remove=!0,updated=this.interface.inputs.values(),input=updated.next();input&&!input.done;input=updated.next())if(this._inputs[i]._midiInput===input.value){remove=!1;break}remove&&this._inputs.splice(i,1)}this.interface&&this.interface.inputs.forEach(function(nInput){for(var add=!0,j=0;j<this._inputs.length;j++)this._inputs[j]._midiInput===nInput&&(add=!1);add&&this._inputs.push(new Input(nInput))}.bind(this))},WebMidi.prototype._updateOutputs=function(){for(var i=0;i<this._outputs.length;i++){for(var remove=!0,updated=this.interface.outputs.values(),output=updated.next();output&&!output.done;output=updated.next())if(this._outputs[i]._midiOutput===output.value){remove=!1;break}remove&&this._outputs.splice(i,1)}this.interface&&this.interface.outputs.forEach(function(nOutput){for(var add=!0,j=0;j<this._outputs.length;j++)this._outputs[j]._midiOutput===nOutput&&(add=!1);add&&this._outputs.push(new Output(nOutput))}.bind(this))},WebMidi.prototype._onInterfaceStateChange=function(e){this._updateInputsAndOutputs();var event={timestamp:e.timeStamp,type:e.port.state};this.interface&&\"connected\"===e.port.state?\"output\"===e.port.type?event.port=this.getOutputById(e.port.id):\"input\"===e.port.type&&(event.port=this.getInputById(e.port.id)):event.port={connection:\"closed\",id:e.port.id,manufacturer:e.port.manufacturer,name:e.port.name,state:e.port.state,type:e.port.type},this._userHandlers[e.port.state].forEach(function(handler){handler(event)})},WebMidi.prototype._resetInterfaceUserHandlers=function(){for(var i=0;i<this._midiInterfaceEvents.length;i++)this._userHandlers[this._midiInterfaceEvents[i]]=[]},Input.prototype.on=Input.prototype.addListener=function(type,channel,listener){var that=this;if(void 0===channel&&(channel=\"all\"),Array.isArray(channel)||(channel=[channel]),channel.forEach(function(item){if(\"all\"!==item&&!(1<=item&&item<=16))throw new RangeError(\"The 'channel' parameter is invalid.\")}),\"function\"!=typeof listener)throw new TypeError(\"The 'listener' parameter must be a function.\");if(void 0!==wm.MIDI_SYSTEM_MESSAGES[type])this._userHandlers.system[type]||(this._userHandlers.system[type]=[]),this._userHandlers.system[type].push(listener);else{if(void 0===wm.MIDI_CHANNEL_MESSAGES[type])throw new TypeError(\"The specified event type is not supported.\");if(-1<channel.indexOf(\"all\")){channel=[];for(var j=1;j<=16;j++)channel.push(j)}this._userHandlers.channel[type]||(this._userHandlers.channel[type]=[]),channel.forEach(function(ch){that._userHandlers.channel[type][ch]||(that._userHandlers.channel[type][ch]=[]),that._userHandlers.channel[type][ch].push(listener)})}return this},Input.prototype.hasListener=function(type,channel,listener){var that=this;if(\"function\"!=typeof listener)throw new TypeError(\"The 'listener' parameter must be a function.\");if(void 0===channel&&(channel=\"all\"),channel.constructor!==Array&&(channel=[channel]),void 0!==wm.MIDI_SYSTEM_MESSAGES[type]){for(var o=0;o<this._userHandlers.system[type].length;o++)if(this._userHandlers.system[type][o]===listener)return!0}else if(void 0!==wm.MIDI_CHANNEL_MESSAGES[type]){if(-1<channel.indexOf(\"all\")){channel=[];for(var j=1;j<=16;j++)channel.push(j)}return!!this._userHandlers.channel[type]&&channel.every(function(chNum){var listeners=that._userHandlers.channel[type][chNum];return listeners&&-1<listeners.indexOf(listener)})}return!1},Input.prototype.removeListener=function(type,channel,listener){var that=this;if(void 0!==listener&&\"function\"!=typeof listener)throw new TypeError(\"The 'listener' parameter must be a function.\");if(void 0===channel&&(channel=\"all\"),channel.constructor!==Array&&(channel=[channel]),void 0!==wm.MIDI_SYSTEM_MESSAGES[type])if(void 0===listener)this._userHandlers.system[type]=[];else for(var o=0;o<this._userHandlers.system[type].length;o++)this._userHandlers.system[type][o]===listener&&this._userHandlers.system[type].splice(o,1);else if(void 0!==wm.MIDI_CHANNEL_MESSAGES[type]){if(-1<channel.indexOf(\"all\")){channel=[];for(var j=1;j<=16;j++)channel.push(j)}if(!this._userHandlers.channel[type])return this;channel.forEach(function(chNum){var listeners=that._userHandlers.channel[type][chNum];if(listeners)if(void 0===listener)that._userHandlers.channel[type][chNum]=[];else for(var l=0;l<listeners.length;l++)listeners[l]===listener&&listeners.splice(l,1)})}else{if(void 0!==type)throw new TypeError(\"The specified event type is not supported.\");this._initializeUserHandlers()}return this},Input.prototype._initializeUserHandlers=function(){for(var prop1 in wm.MIDI_CHANNEL_MESSAGES)Object.prototype.hasOwnProperty.call(wm.MIDI_CHANNEL_MESSAGES,prop1)&&(this._userHandlers.channel[prop1]={});for(var prop2 in wm.MIDI_SYSTEM_MESSAGES)Object.prototype.hasOwnProperty.call(wm.MIDI_SYSTEM_MESSAGES,prop2)&&(this._userHandlers.system[prop2]=[])},Input.prototype._onMidiMessage=function(e){if(0<this._userHandlers.system.midimessage.length){var event={target:this,data:e.data,timestamp:e.timeStamp,type:\"midimessage\"};this._userHandlers.system.midimessage.forEach(function(callback){callback(event)})}e.data[0]<240?(this._parseChannelEvent(e),this._parseNrpnEvent(e)):e.data[0]<=255&&this._parseSystemEvent(e)},Input.prototype._parseNrpnEvent=function(e){var data1,data2,command=e.data[0]>>4,channelBufferIndex=15&e.data[0],channel=1+channelBufferIndex;if(1<e.data.length&&(data1=e.data[1],data2=2<e.data.length?e.data[2]:void 0),wm.nrpnEventsEnabled&&command===wm.MIDI_CHANNEL_MESSAGES.controlchange&&(data1>=wm.MIDI_NRPN_MESSAGES.increment&&data1<=wm.MIDI_NRPN_MESSAGES.parammsb||data1===wm.MIDI_NRPN_MESSAGES.entrymsb||data1===wm.MIDI_NRPN_MESSAGES.entrylsb)){var ccEvent={target:this,type:\"controlchange\",data:e.data,timestamp:e.timeStamp,channel:channel,controller:{number:data1,name:this.getCcNameByNumber(data1)},value:data2};if(ccEvent.controller.number===wm.MIDI_NRPN_MESSAGES.parammsb&&ccEvent.value!=wm.MIDI_NRPN_MESSAGES.nullactiveparameter)wm._nrpnBuffer[channelBufferIndex]=[],wm._nrpnBuffer[channelBufferIndex][0]=ccEvent;else if(1===wm._nrpnBuffer[channelBufferIndex].length&&ccEvent.controller.number===wm.MIDI_NRPN_MESSAGES.paramlsb)wm._nrpnBuffer[channelBufferIndex].push(ccEvent);else if(2!==wm._nrpnBuffer[channelBufferIndex].length||ccEvent.controller.number!==wm.MIDI_NRPN_MESSAGES.increment&&ccEvent.controller.number!==wm.MIDI_NRPN_MESSAGES.decrement&&ccEvent.controller.number!==wm.MIDI_NRPN_MESSAGES.entrymsb)if(3===wm._nrpnBuffer[channelBufferIndex].length&&wm._nrpnBuffer[channelBufferIndex][2].number===wm.MIDI_NRPN_MESSAGES.entrymsb&&ccEvent.controller.number===wm.MIDI_NRPN_MESSAGES.entrylsb)wm._nrpnBuffer[channelBufferIndex].push(ccEvent);else if(3<=wm._nrpnBuffer[channelBufferIndex].length&&wm._nrpnBuffer[channelBufferIndex].length<=4&&ccEvent.controller.number===wm.MIDI_NRPN_MESSAGES.parammsb&&ccEvent.value===wm.MIDI_NRPN_MESSAGES.nullactiveparameter)wm._nrpnBuffer[channelBufferIndex].push(ccEvent);else if(4<=wm._nrpnBuffer[channelBufferIndex].length&&wm._nrpnBuffer[channelBufferIndex].length<=5&&ccEvent.controller.number===wm.MIDI_NRPN_MESSAGES.paramlsb&&ccEvent.value===wm.MIDI_NRPN_MESSAGES.nullactiveparameter){wm._nrpnBuffer[channelBufferIndex].push(ccEvent);var rawData=[];wm._nrpnBuffer[channelBufferIndex].forEach(function(ev){rawData.push(ev.data)});var nrpnNumber=wm._nrpnBuffer[channelBufferIndex][0].value<<7|wm._nrpnBuffer[channelBufferIndex][1].value,nrpnValue=wm._nrpnBuffer[channelBufferIndex][2].value;6===wm._nrpnBuffer[channelBufferIndex].length&&(nrpnValue=wm._nrpnBuffer[channelBufferIndex][2].value<<7|wm._nrpnBuffer[channelBufferIndex][3].value);var nrpnControllerType=\"\";switch(wm._nrpnBuffer[channelBufferIndex][2].controller.number){case wm.MIDI_NRPN_MESSAGES.entrymsb:nrpnControllerType=wm._nrpnTypes[0];break;case wm.MIDI_NRPN_MESSAGES.increment:nrpnControllerType=wm._nrpnTypes[1];break;case wm.MIDI_NRPN_MESSAGES.decrement:nrpnControllerType=wm._nrpnTypes[2];break;default:throw new Error(\"The NPRN type was unidentifiable.\")}var nrpnEvent={timestamp:ccEvent.timestamp,channel:ccEvent.channel,type:\"nrpn\",data:rawData,controller:{number:nrpnNumber,type:nrpnControllerType,name:\"Non-Registered Parameter \"+nrpnNumber},value:nrpnValue};wm._nrpnBuffer[channelBufferIndex]=[],this._userHandlers.channel[nrpnEvent.type]&&this._userHandlers.channel[nrpnEvent.type][nrpnEvent.channel]&&this._userHandlers.channel[nrpnEvent.type][nrpnEvent.channel].forEach(function(callback){callback(nrpnEvent)})}else wm._nrpnBuffer[channelBufferIndex]=[];else wm._nrpnBuffer[channelBufferIndex].push(ccEvent)}},Input.prototype._parseChannelEvent=function(e){var data1,data2,command=e.data[0]>>4,channel=1+(15&e.data[0]);1<e.data.length&&(data1=e.data[1],data2=2<e.data.length?e.data[2]:void 0);var event={target:this,data:e.data,timestamp:e.timeStamp,channel:channel};command===wm.MIDI_CHANNEL_MESSAGES.noteoff||command===wm.MIDI_CHANNEL_MESSAGES.noteon&&0===data2?(event.type=\"noteoff\",event.note={number:data1,name:wm._notes[data1%12],octave:wm.getOctave(data1)},event.velocity=data2/127,event.rawVelocity=data2):command===wm.MIDI_CHANNEL_MESSAGES.noteon?(event.type=\"noteon\",event.note={number:data1,name:wm._notes[data1%12],octave:wm.getOctave(data1)},event.velocity=data2/127,event.rawVelocity=data2):command===wm.MIDI_CHANNEL_MESSAGES.keyaftertouch?(event.type=\"keyaftertouch\",event.note={number:data1,name:wm._notes[data1%12],octave:wm.getOctave(data1)},event.value=data2/127):command===wm.MIDI_CHANNEL_MESSAGES.controlchange&&0<=data1&&data1<=119?(event.type=\"controlchange\",event.controller={number:data1,name:this.getCcNameByNumber(data1)},event.value=data2):command===wm.MIDI_CHANNEL_MESSAGES.channelmode&&120<=data1&&data1<=127?(event.type=\"channelmode\",event.controller={number:data1,name:this.getChannelModeByNumber(data1)},event.value=data2):command===wm.MIDI_CHANNEL_MESSAGES.programchange?(event.type=\"programchange\",event.value=data1):command===wm.MIDI_CHANNEL_MESSAGES.channelaftertouch?(event.type=\"channelaftertouch\",event.value=data1/127):command===wm.MIDI_CHANNEL_MESSAGES.pitchbend?(event.type=\"pitchbend\",event.value=((data2<<7)+data1-8192)/8192):event.type=\"unknownchannelmessage\",this._userHandlers.channel[event.type]&&this._userHandlers.channel[event.type][channel]&&this._userHandlers.channel[event.type][channel].forEach(function(callback){callback(event)})},Input.prototype.getCcNameByNumber=function(number){if(!(0<=(number=Math.floor(number))&&number<=119))throw new RangeError(\"The control change number must be between 0 and 119.\");for(var cc in wm.MIDI_CONTROL_CHANGE_MESSAGES)if(Object.prototype.hasOwnProperty.call(wm.MIDI_CONTROL_CHANGE_MESSAGES,cc)&&number===wm.MIDI_CONTROL_CHANGE_MESSAGES[cc])return cc},Input.prototype.getChannelModeByNumber=function(number){if(!(120<=(number=Math.floor(number))&&status<=127))throw new RangeError(\"The control change number must be between 120 and 127.\");for(var cm in wm.MIDI_CHANNEL_MODE_MESSAGES)if(Object.prototype.hasOwnProperty.call(wm.MIDI_CHANNEL_MODE_MESSAGES,cm)&&number===wm.MIDI_CHANNEL_MODE_MESSAGES[cm])return cm},Input.prototype._parseSystemEvent=function(e){var command=e.data[0],event={target:this,data:e.data,timestamp:e.timeStamp};command===wm.MIDI_SYSTEM_MESSAGES.sysex?event.type=\"sysex\":command===wm.MIDI_SYSTEM_MESSAGES.timecode?event.type=\"timecode\":command===wm.MIDI_SYSTEM_MESSAGES.songposition?event.type=\"songposition\":command===wm.MIDI_SYSTEM_MESSAGES.songselect?(event.type=\"songselect\",event.song=e.data[1]):command===wm.MIDI_SYSTEM_MESSAGES.tuningrequest?event.type=\"tuningrequest\":command===wm.MIDI_SYSTEM_MESSAGES.clock?event.type=\"clock\":command===wm.MIDI_SYSTEM_MESSAGES.start?event.type=\"start\":command===wm.MIDI_SYSTEM_MESSAGES.continue?event.type=\"continue\":command===wm.MIDI_SYSTEM_MESSAGES.stop?event.type=\"stop\":command===wm.MIDI_SYSTEM_MESSAGES.activesensing?event.type=\"activesensing\":command===wm.MIDI_SYSTEM_MESSAGES.reset?event.type=\"reset\":event.type=\"unknownsystemmessage\",this._userHandlers.system[event.type]&&this._userHandlers.system[event.type].forEach(function(callback){callback(event)})},Output.prototype.send=function(status,data,timestamp){if(!(128<=status&&status<=255))throw new RangeError(\"The status byte must be an integer between 128 (0x80) and 255 (0xFF).\");void 0===data&&(data=[]),Array.isArray(data)||(data=[data]);var message=[];return data.forEach(function(item){var parsed=Math.floor(item);if(!(0<=parsed&&parsed<=255))throw new RangeError(\"Data bytes must be integers between 0 (0x00) and 255 (0xFF).\");message.push(parsed)}),this._midiOutput.send([status].concat(message),parseFloat(timestamp)||0),this},Output.prototype.sendSysex=function(manufacturer,data,options){if(!wm.sysexEnabled)throw new Error(\"Sysex message support must first be activated.\");return options=options||{},manufacturer=[].concat(manufacturer),data.forEach(function(item){if(item<0||127<item)throw new RangeError(\"The data bytes of a sysex message must be integers between 0 (0x00) and 127 (0x7F).\")}),data=manufacturer.concat(data,wm.MIDI_SYSTEM_MESSAGES.sysexend),this.send(wm.MIDI_SYSTEM_MESSAGES.sysex,data,this._parseTimeParameter(options.time)),this},Output.prototype.sendTimecodeQuarterFrame=function(value,options){return options=options||{},this.send(wm.MIDI_SYSTEM_MESSAGES.timecode,value,this._parseTimeParameter(options.time)),this},Output.prototype.sendSongPosition=function(value,options){options=options||{};var msb=(value=Math.floor(value)||0)>>7&127,lsb=127&value;return this.send(wm.MIDI_SYSTEM_MESSAGES.songposition,[msb,lsb],this._parseTimeParameter(options.time)),this},Output.prototype.sendSongSelect=function(value,options){if(options=options||{},!(0<=(value=Math.floor(value))&&value<=127))throw new RangeError(\"The song number must be between 0 and 127.\");return this.send(wm.MIDI_SYSTEM_MESSAGES.songselect,[value],this._parseTimeParameter(options.time)),this},Output.prototype.sendTuningRequest=function(options){return options=options||{},this.send(wm.MIDI_SYSTEM_MESSAGES.tuningrequest,void 0,this._parseTimeParameter(options.time)),this},Output.prototype.sendClock=function(options){return options=options||{},this.send(wm.MIDI_SYSTEM_MESSAGES.clock,void 0,this._parseTimeParameter(options.time)),this},Output.prototype.sendStart=function(options){return options=options||{},this.send(wm.MIDI_SYSTEM_MESSAGES.start,void 0,this._parseTimeParameter(options.time)),this},Output.prototype.sendContinue=function(options){return options=options||{},this.send(wm.MIDI_SYSTEM_MESSAGES.continue,void 0,this._parseTimeParameter(options.time)),this},Output.prototype.sendStop=function(options){return options=options||{},this.send(wm.MIDI_SYSTEM_MESSAGES.stop,void 0,this._parseTimeParameter(options.time)),this},Output.prototype.sendActiveSensing=function(options){return options=options||{},this.send(wm.MIDI_SYSTEM_MESSAGES.activesensing,[],this._parseTimeParameter(options.time)),this},Output.prototype.sendReset=function(options){return options=options||{},this.send(wm.MIDI_SYSTEM_MESSAGES.reset,void 0,this._parseTimeParameter(options.time)),this},Output.prototype.stopNote=function(note,channel,options){if(\"all\"===note)return this.sendChannelMode(\"allnotesoff\",0,channel,options);var nVelocity=64;return(options=options||{}).rawVelocity?!isNaN(options.velocity)&&0<=options.velocity&&options.velocity<=127&&(nVelocity=options.velocity):!isNaN(options.velocity)&&0<=options.velocity&&options.velocity<=1&&(nVelocity=127*options.velocity),this._convertNoteToArray(note).forEach(function(item){wm.toMIDIChannels(channel).forEach(function(ch){this.send((wm.MIDI_CHANNEL_MESSAGES.noteoff<<4)+(ch-1),[item,Math.round(nVelocity)],this._parseTimeParameter(options.time))}.bind(this))}.bind(this)),this},Output.prototype.playNote=function(note,channel,options){var time,nVelocity=64;if((options=options||{}).rawVelocity?!isNaN(options.velocity)&&0<=options.velocity&&options.velocity<=127&&(nVelocity=options.velocity):!isNaN(options.velocity)&&0<=options.velocity&&options.velocity<=1&&(nVelocity=127*options.velocity),time=this._parseTimeParameter(options.time),this._convertNoteToArray(note).forEach(function(item){wm.toMIDIChannels(channel).forEach(function(ch){this.send((wm.MIDI_CHANNEL_MESSAGES.noteon<<4)+(ch-1),[item,Math.round(nVelocity)],time)}.bind(this))}.bind(this)),!isNaN(options.duration)){options.duration<=0&&(options.duration=0);var nRelease=64;options.rawVelocity?!isNaN(options.release)&&0<=options.release&&options.release<=127&&(nRelease=options.release):!isNaN(options.release)&&0<=options.release&&options.release<=1&&(nRelease=127*options.release),this._convertNoteToArray(note).forEach(function(item){wm.toMIDIChannels(channel).forEach(function(ch){this.send((wm.MIDI_CHANNEL_MESSAGES.noteoff<<4)+(ch-1),[item,Math.round(nRelease)],(time||wm.time)+options.duration)}.bind(this))}.bind(this))}return this},Output.prototype.sendKeyAftertouch=function(note,channel,pressure,options){var that=this;if(options=options||{},channel<1||16<channel)throw new RangeError(\"The channel must be between 1 and 16.\");(isNaN(pressure)||pressure<0||1<pressure)&&(pressure=.5);var nPressure=Math.round(127*pressure);return this._convertNoteToArray(note).forEach(function(item){wm.toMIDIChannels(channel).forEach(function(ch){that.send((wm.MIDI_CHANNEL_MESSAGES.keyaftertouch<<4)+(ch-1),[item,nPressure],that._parseTimeParameter(options.time))})}),this},Output.prototype.sendControlChange=function(controller,value,channel,options){if(options=options||{},\"string\"==typeof controller){if(void 0===(controller=wm.MIDI_CONTROL_CHANGE_MESSAGES[controller]))throw new TypeError(\"Invalid controller name.\")}else if(!(0<=(controller=Math.floor(controller))&&controller<=119))throw new RangeError(\"Controller numbers must be between 0 and 119.\");if(!(0<=(value=Math.floor(value)||0)&&value<=127))throw new RangeError(\"Controller value must be between 0 and 127.\");return wm.toMIDIChannels(channel).forEach(function(ch){this.send((wm.MIDI_CHANNEL_MESSAGES.controlchange<<4)+(ch-1),[controller,value],this._parseTimeParameter(options.time))}.bind(this)),this},Output.prototype._selectRegisteredParameter=function(parameter,channel,time){var that=this;if(parameter[0]=Math.floor(parameter[0]),!(0<=parameter[0]&¶meter[0]<=127))throw new RangeError(\"The control65 value must be between 0 and 127\");if(parameter[1]=Math.floor(parameter[1]),!(0<=parameter[1]&¶meter[1]<=127))throw new RangeError(\"The control64 value must be between 0 and 127\");return wm.toMIDIChannels(channel).forEach(function(){that.sendControlChange(101,parameter[0],channel,{time:time}),that.sendControlChange(100,parameter[1],channel,{time:time})}),this},Output.prototype._selectNonRegisteredParameter=function(parameter,channel,time){var that=this;if(parameter[0]=Math.floor(parameter[0]),!(0<=parameter[0]&¶meter[0]<=127))throw new RangeError(\"The control63 value must be between 0 and 127\");if(parameter[1]=Math.floor(parameter[1]),!(0<=parameter[1]&¶meter[1]<=127))throw new RangeError(\"The control62 value must be between 0 and 127\");return wm.toMIDIChannels(channel).forEach(function(){that.sendControlChange(99,parameter[0],channel,{time:time}),that.sendControlChange(98,parameter[1],channel,{time:time})}),this},Output.prototype._setCurrentRegisteredParameter=function(data,channel,time){var that=this;if((data=[].concat(data))[0]=Math.floor(data[0]),!(0<=data[0]&&data[0]<=127))throw new RangeError(\"The msb value must be between 0 and 127\");return wm.toMIDIChannels(channel).forEach(function(){that.sendControlChange(6,data[0],channel,{time:time})}),data[1]=Math.floor(data[1]),0<=data[1]&&data[1]<=127&&wm.toMIDIChannels(channel).forEach(function(){that.sendControlChange(38,data[1],channel,{time:time})}),this},Output.prototype._deselectRegisteredParameter=function(channel,time){var that=this;return wm.toMIDIChannels(channel).forEach(function(){that.sendControlChange(101,127,channel,{time:time}),that.sendControlChange(100,127,channel,{time:time})}),this},Output.prototype.setRegisteredParameter=function(parameter,data,channel,options){var that=this;if(options=options||{},!Array.isArray(parameter)){if(!wm.MIDI_REGISTERED_PARAMETER[parameter])throw new Error(\"The specified parameter is not available.\");parameter=wm.MIDI_REGISTERED_PARAMETER[parameter]}return wm.toMIDIChannels(channel).forEach(function(){that._selectRegisteredParameter(parameter,channel,options.time),that._setCurrentRegisteredParameter(data,channel,options.time),that._deselectRegisteredParameter(channel,options.time)}),this},Output.prototype.setNonRegisteredParameter=function(parameter,data,channel,options){var that=this;if(options=options||{},!(0<=parameter[0]&¶meter[0]<=127&&0<=parameter[1]&¶meter[1]<=127))throw new Error(\"Position 0 and 1 of the 2-position parameter array must both be between 0 and 127.\");return data=[].concat(data),wm.toMIDIChannels(channel).forEach(function(){that._selectNonRegisteredParameter(parameter,channel,options.time),that._setCurrentRegisteredParameter(data,channel,options.time),that._deselectRegisteredParameter(channel,options.time)}),this},Output.prototype.incrementRegisteredParameter=function(parameter,channel,options){var that=this;if(options=options||{},!Array.isArray(parameter)){if(!wm.MIDI_REGISTERED_PARAMETER[parameter])throw new Error(\"The specified parameter is not available.\");parameter=wm.MIDI_REGISTERED_PARAMETER[parameter]}return wm.toMIDIChannels(channel).forEach(function(){that._selectRegisteredParameter(parameter,channel,options.time),that.sendControlChange(96,0,channel,{time:options.time}),that._deselectRegisteredParameter(channel,options.time)}),this},Output.prototype.decrementRegisteredParameter=function(parameter,channel,options){if(options=options||{},!Array.isArray(parameter)){if(!wm.MIDI_REGISTERED_PARAMETER[parameter])throw new TypeError(\"The specified parameter is not available.\");parameter=wm.MIDI_REGISTERED_PARAMETER[parameter]}return wm.toMIDIChannels(channel).forEach(function(){this._selectRegisteredParameter(parameter,channel,options.time),this.sendControlChange(97,0,channel,{time:options.time}),this._deselectRegisteredParameter(channel,options.time)}.bind(this)),this},Output.prototype.setPitchBendRange=function(semitones,cents,channel,options){var that=this;if(options=options||{},!(0<=(semitones=Math.floor(semitones)||0)&&semitones<=127))throw new RangeError(\"The semitones value must be between 0 and 127\");if(!(0<=(cents=Math.floor(cents)||0)&¢s<=127))throw new RangeError(\"The cents value must be between 0 and 127\");return wm.toMIDIChannels(channel).forEach(function(){that.setRegisteredParameter(\"pitchbendrange\",[semitones,cents],channel,{time:options.time})}),this},Output.prototype.setModulationRange=function(semitones,cents,channel,options){var that=this;if(options=options||{},!(0<=(semitones=Math.floor(semitones)||0)&&semitones<=127))throw new RangeError(\"The semitones value must be between 0 and 127\");if(!(0<=(cents=Math.floor(cents)||0)&¢s<=127))throw new RangeError(\"The cents value must be between 0 and 127\");return wm.toMIDIChannels(channel).forEach(function(){that.setRegisteredParameter(\"modulationrange\",[semitones,cents],channel,{time:options.time})}),this},Output.prototype.setMasterTuning=function(value,channel,options){var that=this;if(options=options||{},(value=parseFloat(value)||0)<=-65||64<=value)throw new RangeError(\"The value must be a decimal number larger than -65 and smaller than 64.\");var coarse=Math.floor(value)+64,fine=value-Math.floor(value),msb=(fine=Math.round((fine+1)/2*16383))>>7&127,lsb=127&fine;return wm.toMIDIChannels(channel).forEach(function(){that.setRegisteredParameter(\"channelcoarsetuning\",coarse,channel,{time:options.time}),that.setRegisteredParameter(\"channelfinetuning\",[msb,lsb],channel,{time:options.time})}),this},Output.prototype.setTuningProgram=function(value,channel,options){var that=this;if(options=options||{},!(0<=(value=Math.floor(value))&&value<=127))throw new RangeError(\"The program value must be between 0 and 127\");return wm.toMIDIChannels(channel).forEach(function(){that.setRegisteredParameter(\"tuningprogram\",value,channel,{time:options.time})}),this},Output.prototype.setTuningBank=function(value,channel,options){var that=this;if(options=options||{},!(0<=(value=Math.floor(value)||0)&&value<=127))throw new RangeError(\"The bank value must be between 0 and 127\");return wm.toMIDIChannels(channel).forEach(function(){that.setRegisteredParameter(\"tuningbank\",value,channel,{time:options.time})}),this},Output.prototype.sendChannelMode=function(command,value,channel,options){if(options=options||{},\"string\"==typeof command){if(!(command=wm.MIDI_CHANNEL_MODE_MESSAGES[command]))throw new TypeError(\"Invalid channel mode message name.\")}else if(!(120<=(command=Math.floor(command))&&command<=127))throw new RangeError(\"Channel mode numerical identifiers must be between 120 and 127.\");if((value=Math.floor(value)||0)<0||127<value)throw new RangeError(\"Value must be an integer between 0 and 127.\");return wm.toMIDIChannels(channel).forEach(function(ch){this.send((wm.MIDI_CHANNEL_MESSAGES.channelmode<<4)+(ch-1),[command,value],this._parseTimeParameter(options.time))}.bind(this)),this},Output.prototype.sendProgramChange=function(program,channel,options){var that=this;if(options=options||{},program=Math.floor(program),isNaN(program)||program<0||127<program)throw new RangeError(\"Program numbers must be between 0 and 127.\");return wm.toMIDIChannels(channel).forEach(function(ch){that.send((wm.MIDI_CHANNEL_MESSAGES.programchange<<4)+(ch-1),[program],that._parseTimeParameter(options.time))}),this},Output.prototype.sendChannelAftertouch=function(pressure,channel,options){var that=this;options=options||{},pressure=parseFloat(pressure),(isNaN(pressure)||pressure<0||1<pressure)&&(pressure=.5);var nPressure=Math.round(127*pressure);return wm.toMIDIChannels(channel).forEach(function(ch){that.send((wm.MIDI_CHANNEL_MESSAGES.channelaftertouch<<4)+(ch-1),[nPressure],that._parseTimeParameter(options.time))}),this},Output.prototype.sendPitchBend=function(bend,channel,options){var that=this;if(options=options||{},isNaN(bend)||bend<-1||1<bend)throw new RangeError(\"Pitch bend value must be between -1 and 1.\");var nLevel=Math.round((bend+1)/2*16383),msb=nLevel>>7&127,lsb=127&nLevel;return wm.toMIDIChannels(channel).forEach(function(ch){that.send((wm.MIDI_CHANNEL_MESSAGES.pitchbend<<4)+(ch-1),[lsb,msb],that._parseTimeParameter(options.time))}),this},Output.prototype._parseTimeParameter=function(time){var value,parsed=parseFloat(time);return\"string\"==typeof time&&\"+\"===time.substring(0,1)?parsed&&0<parsed&&(value=wm.time+parsed):parsed>wm.time&&(value=parsed),value},Output.prototype._convertNoteToArray=function(note){var notes=[];return Array.isArray(note)||(note=[note]),note.forEach(function(item){notes.push(wm.guessNoteNumber(item))}),notes},\"function\"==typeof define&&\"object\"==typeof define.amd?define([],function(){return wm}):\"undefined\"!=typeof module&&module.exports?module.exports=wm:scope.WebMidi||(scope.WebMidi=wm)}(this);","/**\r\n * Fill a string with a repeated character\r\n *\r\n * @param character\r\n * @param repetition\r\n */\r\nconst fillStr = (s, n) => Array(Math.abs(n) + 1).join(s);\r\nfunction deprecate(original, alternative, fn) {\r\n return function (...args) {\r\n // tslint:disable-next-line\r\n console.warn(`${original} is deprecated. Use ${alternative}.`);\r\n return fn.apply(this, args);\r\n };\r\n}\n\nfunction isNamed(src) {\r\n return src !== null && typeof src === \"object\" && typeof src.name === \"string\"\r\n ? true\r\n : false;\r\n}\n\nfunction isPitch(pitch) {\r\n return pitch !== null &&\r\n typeof pitch === \"object\" &&\r\n typeof pitch.step === \"number\" &&\r\n typeof pitch.alt === \"number\"\r\n ? true\r\n : false;\r\n}\r\n// The number of fifths of [C, D, E, F, G, A, B]\r\nconst FIFTHS = [0, 2, 4, -1, 1, 3, 5];\r\n// The number of octaves it span each step\r\nconst STEPS_TO_OCTS = FIFTHS.map((fifths) => Math.floor((fifths * 7) / 12));\r\nfunction encode(pitch) {\r\n const { step, alt, oct, dir = 1 } = pitch;\r\n const f = FIFTHS[step] + 7 * alt;\r\n if (oct === undefined) {\r\n return [dir * f];\r\n }\r\n const o = oct - STEPS_TO_OCTS[step] - 4 * alt;\r\n return [dir * f, dir * o];\r\n}\r\n// We need to get the steps from fifths\r\n// Fifths for CDEFGAB are [ 0, 2, 4, -1, 1, 3, 5 ]\r\n// We add 1 to fifths to avoid negative numbers, so:\r\n// for [\"F\", \"C\", \"G\", \"D\", \"A\", \"E\", \"B\"] we have:\r\nconst FIFTHS_TO_STEPS = [3, 0, 4, 1, 5, 2, 6];\r\nfunction decode(coord) {\r\n const [f, o, dir] = coord;\r\n const step = FIFTHS_TO_STEPS[unaltered(f)];\r\n const alt = Math.floor((f + 1) / 7);\r\n if (o === undefined) {\r\n return { step, alt, dir };\r\n }\r\n const oct = o + 4 * alt + STEPS_TO_OCTS[step];\r\n return { step, alt, oct, dir };\r\n}\r\n// Return the number of fifths as if it were unaltered\r\nfunction unaltered(f) {\r\n const i = (f + 1) % 7;\r\n return i < 0 ? 7 + i : i;\r\n}\n\nconst NoNote = { empty: true, name: \"\", pc: \"\", acc: \"\" };\r\nconst cache = new Map();\r\nconst stepToLetter = (step) => \"CDEFGAB\".charAt(step);\r\nconst altToAcc = (alt) => alt < 0 ? fillStr(\"b\", -alt) : fillStr(\"#\", alt);\r\nconst accToAlt = (acc) => acc[0] === \"b\" ? -acc.length : acc.length;\r\n/**\r\n * Given a note literal (a note name or a note object), returns the Note object\r\n * @example\r\n * note('Bb4') // => { name: \"Bb4\", midi: 70, chroma: 10, ... }\r\n */\r\nfunction note(src) {\r\n const cached = cache.get(src);\r\n if (cached) {\r\n return cached;\r\n }\r\n const value = typeof src === \"string\"\r\n ? parse(src)\r\n : isPitch(src)\r\n ? note(pitchName(src))\r\n : isNamed(src)\r\n ? note(src.name)\r\n : NoNote;\r\n cache.set(src, value);\r\n return value;\r\n}\r\nconst REGEX = /^([a-gA-G]?)(#{1,}|b{1,}|x{1,}|)(-?\\d*)\\s*(.*)$/;\r\n/**\r\n * @private\r\n */\r\nfunction tokenizeNote(str) {\r\n const m = REGEX.exec(str);\r\n return [m[1].toUpperCase(), m[2].replace(/x/g, \"##\"), m[3], m[4]];\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction coordToNote(noteCoord) {\r\n return note(decode(noteCoord));\r\n}\r\nconst mod = (n, m) => ((n % m) + m) % m;\r\nconst SEMI = [0, 2, 4, 5, 7, 9, 11];\r\nfunction parse(noteName) {\r\n const tokens = tokenizeNote(noteName);\r\n if (tokens[0] === \"\" || tokens[3] !== \"\") {\r\n return NoNote;\r\n }\r\n const letter = tokens[0];\r\n const acc = tokens[1];\r\n const octStr = tokens[2];\r\n const step = (letter.charCodeAt(0) + 3) % 7;\r\n const alt = accToAlt(acc);\r\n const oct = octStr.length ? +octStr : undefined;\r\n const coord = encode({ step, alt, oct });\r\n const name = letter + acc + octStr;\r\n const pc = letter + acc;\r\n const chroma = (SEMI[step] + alt + 120) % 12;\r\n const height = oct === undefined\r\n ? mod(SEMI[step] + alt, 12) - 12 * 99\r\n : SEMI[step] + alt + 12 * (oct + 1);\r\n const midi = height >= 0 && height <= 127 ? height : null;\r\n const freq = oct === undefined ? null : Math.pow(2, (height - 69) / 12) * 440;\r\n return {\r\n empty: false,\r\n acc,\r\n alt,\r\n chroma,\r\n coord,\r\n freq,\r\n height,\r\n letter,\r\n midi,\r\n name,\r\n oct,\r\n pc,\r\n step,\r\n };\r\n}\r\nfunction pitchName(props) {\r\n const { step, alt, oct } = props;\r\n const letter = stepToLetter(step);\r\n if (!letter) {\r\n return \"\";\r\n }\r\n const pc = letter + altToAcc(alt);\r\n return oct || oct === 0 ? pc + oct : pc;\r\n}\n\nconst NoInterval = { empty: true, name: \"\", acc: \"\" };\r\n// shorthand tonal notation (with quality after number)\r\nconst INTERVAL_TONAL_REGEX = \"([-+]?\\\\d+)(d{1,4}|m|M|P|A{1,4})\";\r\n// standard shorthand notation (with quality before number)\r\nconst INTERVAL_SHORTHAND_REGEX = \"(AA|A|P|M|m|d|dd)([-+]?\\\\d+)\";\r\nconst REGEX$1 = new RegExp(\"^\" + INTERVAL_TONAL_REGEX + \"|\" + INTERVAL_SHORTHAND_REGEX + \"$\");\r\n/**\r\n * @private\r\n */\r\nfunction tokenizeInterval(str) {\r\n const m = REGEX$1.exec(`${str}`);\r\n if (m === null) {\r\n return [\"\", \"\"];\r\n }\r\n return m[1] ? [m[1], m[2]] : [m[4], m[3]];\r\n}\r\nconst cache$1 = {};\r\n/**\r\n * Get interval properties. It returns an object with:\r\n *\r\n * - name: the interval name\r\n * - num: the interval number\r\n * - type: 'perfectable' or 'majorable'\r\n * - q: the interval quality (d, m, M, A)\r\n * - dir: interval direction (1 ascending, -1 descending)\r\n * - simple: the simplified number\r\n * - semitones: the size in semitones\r\n * - chroma: the interval chroma\r\n *\r\n * @param {string} interval - the interval name\r\n * @return {Object} the interval properties\r\n *\r\n * @example\r\n * import { interval } from '@tonaljs/core'\r\n * interval('P5').semitones // => 7\r\n * interval('m3').type // => 'majorable'\r\n */\r\nfunction interval(src) {\r\n return typeof src === \"string\"\r\n ? cache$1[src] || (cache$1[src] = parse$1(src))\r\n : isPitch(src)\r\n ? interval(pitchName$1(src))\r\n : isNamed(src)\r\n ? interval(src.name)\r\n : NoInterval;\r\n}\r\nconst SIZES = [0, 2, 4, 5, 7, 9, 11];\r\nconst TYPES = \"PMMPPMM\";\r\nfunction parse$1(str) {\r\n const tokens = tokenizeInterval(str);\r\n if (tokens[0] === \"\") {\r\n return NoInterval;\r\n }\r\n const num = +tokens[0];\r\n const q = tokens[1];\r\n const step = (Math.abs(num) - 1) % 7;\r\n const t = TYPES[step];\r\n if (t === \"M\" && q === \"P\") {\r\n return NoInterval;\r\n }\r\n const type = t === \"M\" ? \"majorable\" : \"perfectable\";\r\n const name = \"\" + num + q;\r\n const dir = num < 0 ? -1 : 1;\r\n const simple = num === 8 || num === -8 ? num : dir * (step + 1);\r\n const alt = qToAlt(type, q);\r\n const oct = Math.floor((Math.abs(num) - 1) / 7);\r\n const semitones = dir * (SIZES[step] + alt + 12 * oct);\r\n const chroma = (((dir * (SIZES[step] + alt)) % 12) + 12) % 12;\r\n const coord = encode({ step, alt, oct, dir });\r\n return {\r\n empty: false,\r\n name,\r\n num,\r\n q,\r\n step,\r\n alt,\r\n dir,\r\n type,\r\n simple,\r\n semitones,\r\n chroma,\r\n coord,\r\n oct,\r\n };\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction coordToInterval(coord) {\r\n const [f, o = 0] = coord;\r\n const isDescending = f * 7 + o * 12 < 0;\r\n const ivl = isDescending ? [-f, -o, -1] : [f, o, 1];\r\n return interval(decode(ivl));\r\n}\r\nfunction qToAlt(type, q) {\r\n return (q === \"M\" && type === \"majorable\") ||\r\n (q === \"P\" && type === \"perfectable\")\r\n ? 0\r\n : q === \"m\" && type === \"majorable\"\r\n ? -1\r\n : /^A+$/.test(q)\r\n ? q.length\r\n : /^d+$/.test(q)\r\n ? -1 * (type === \"perfectable\" ? q.length : q.length + 1)\r\n : 0;\r\n}\r\n// return the interval name of a pitch\r\nfunction pitchName$1(props) {\r\n const { step, alt, oct = 0, dir } = props;\r\n if (!dir) {\r\n return \"\";\r\n }\r\n const num = step + 1 + 7 * oct;\r\n const d = dir < 0 ? \"-\" : \"\";\r\n const type = TYPES[step] === \"M\" ? \"majorable\" : \"perfectable\";\r\n const name = d + num + altToQ(type, alt);\r\n return name;\r\n}\r\nfunction altToQ(type, alt) {\r\n if (alt === 0) {\r\n return type === \"majorable\" ? \"M\" : \"P\";\r\n }\r\n else if (alt === -1 && type === \"majorable\") {\r\n return \"m\";\r\n }\r\n else if (alt > 0) {\r\n return fillStr(\"A\", alt);\r\n }\r\n else {\r\n return fillStr(\"d\", type === \"perfectable\" ? alt : alt + 1);\r\n }\r\n}\n\n/**\r\n * Transpose a note by an interval.\r\n *\r\n * @param {string} note - the note or note name\r\n * @param {string} interval - the interval or interval name\r\n * @return {string} the transposed note name or empty string if not valid notes\r\n * @example\r\n * import { tranpose } from \"@tonaljs/core\"\r\n * transpose(\"d3\", \"3M\") // => \"F#3\"\r\n * transpose(\"D\", \"3M\") // => \"F#\"\r\n * [\"C\", \"D\", \"E\", \"F\", \"G\"].map(pc => transpose(pc, \"M3)) // => [\"E\", \"F#\", \"G#\", \"A\", \"B\"]\r\n */\r\nfunction transpose(noteName, intervalName) {\r\n const note$1 = note(noteName);\r\n const interval$1 = interval(intervalName);\r\n if (note$1.empty || interval$1.empty) {\r\n return \"\";\r\n }\r\n const noteCoord = note$1.coord;\r\n const intervalCoord = interval$1.coord;\r\n const tr = noteCoord.length === 1\r\n ? [noteCoord[0] + intervalCoord[0]]\r\n : [noteCoord[0] + intervalCoord[0], noteCoord[1] + intervalCoord[1]];\r\n return coordToNote(tr).name;\r\n}\r\n/**\r\n * Find the interval distance between two notes or coord classes.\r\n *\r\n * To find distance between coord classes, both notes must be coord classes and\r\n * the interval is always ascending\r\n *\r\n * @param {Note|string} from - the note or note name to calculate distance from\r\n * @param {Note|string} to - the note or note name to calculate distance to\r\n * @return {string} the interval name or empty string if not valid notes\r\n *\r\n */\r\nfunction distance(fromNote, toNote) {\r\n const from = note(fromNote);\r\n const to = note(toNote);\r\n if (from.empty || to.empty) {\r\n return \"\";\r\n }\r\n const fcoord = from.coord;\r\n const tcoord = to.coord;\r\n const fifths = tcoord[0] - fcoord[0];\r\n const octs = fcoord.length === 2 && tcoord.length === 2\r\n ? tcoord[1] - fcoord[1]\r\n : -Math.floor((fifths * 7) / 12);\r\n return coordToInterval([fifths, octs]).name;\r\n}\n\nexport { accToAlt, altToAcc, coordToInterval, coordToNote, decode, deprecate, distance, encode, fillStr, interval, isNamed, isPitch, note, stepToLetter, tokenizeInterval, tokenizeNote, transpose };\n//# sourceMappingURL=index.es.js.map\n","// ascending range\r\nfunction ascR(b, n) {\r\n const a = [];\r\n // tslint:disable-next-line:curly\r\n for (; n--; a[n] = n + b)\r\n ;\r\n return a;\r\n}\r\n// descending range\r\nfunction descR(b, n) {\r\n const a = [];\r\n // tslint:disable-next-line:curly\r\n for (; n--; a[n] = b - n)\r\n ;\r\n return a;\r\n}\r\n/**\r\n * Creates a numeric range\r\n *\r\n * @param {number} from\r\n * @param {number} to\r\n * @return {Array<number>}\r\n *\r\n * @example\r\n * range(-2, 2) // => [-2, -1, 0, 1, 2]\r\n * range(2, -2) // => [2, 1, 0, -1, -2]\r\n */\r\nfunction range(from, to) {\r\n return from < to ? ascR(from, to - from + 1) : descR(from, from - to + 1);\r\n}\r\n/**\r\n * Rotates a list a number of times. It\"s completly agnostic about the\r\n * contents of the list.\r\n *\r\n * @param {Integer} times - the number of rotations\r\n * @param {Array} collection\r\n * @return {Array} the rotated collection\r\n *\r\n * @example\r\n * rotate(1, [1, 2, 3]) // => [2, 3, 1]\r\n */\r\nfunction rotate(times, arr) {\r\n const len = arr.length;\r\n const n = ((times % len) + len) % len;\r\n return arr.slice(n, len).concat(arr.slice(0, n));\r\n}\r\n/**\r\n * Return a copy of the collection with the null values removed\r\n * @function\r\n * @param {Array} collection\r\n * @return {Array}\r\n *\r\n * @example\r\n * compact([\"a\", \"b\", null, \"c\"]) // => [\"a\", \"b\", \"c\"]\r\n */\r\nfunction compact(arr) {\r\n return arr.filter((n) => n === 0 || n);\r\n}\r\n/**\r\n * Randomizes the order of the specified collection in-place, using the Fisher–Yates shuffle.\r\n *\r\n * @function\r\n * @param {Array} collection\r\n * @return {Array} the collection shuffled\r\n *\r\n * @example\r\n * shuffle([\"C\", \"D\", \"E\", \"F\"]) // => [...]\r\n */\r\nfunction shuffle(arr, rnd = Math.random) {\r\n let i;\r\n let t;\r\n let m = arr.length;\r\n while (m) {\r\n i = Math.floor(rnd() * m--);\r\n t = arr[m];\r\n arr[m] = arr[i];\r\n arr[i] = t;\r\n }\r\n return arr;\r\n}\r\n/**\r\n * Get all permutations of an collection\r\n *\r\n * @param {Array} collection - the collection\r\n * @return {Array<Array>} an collection with all the permutations\r\n * @example\r\n * permutations([\"a\", \"b\", \"c\"])) // =>\r\n * [\r\n * [\"a\", \"b\", \"c\"],\r\n * [\"b\", \"a\", \"c\"],\r\n * [\"b\", \"c\", \"a\"],\r\n * [\"a\", \"c\", \"b\"],\r\n * [\"c\", \"a\", \"b\"],\r\n * [\"c\", \"b\", \"a\"]\r\n * ]\r\n */\r\nfunction permutations(arr) {\r\n if (arr.length === 0) {\r\n return [[]];\r\n }\r\n return permutations(arr.slice(1)).reduce((acc, perm) => {\r\n return acc.concat(arr.map((e, pos) => {\r\n const newPerm = perm.slice();\r\n newPerm.splice(pos, 0, arr[0]);\r\n return newPerm;\r\n }));\r\n }, []);\r\n}\r\nvar index = {\r\n compact,\r\n permutations,\r\n range,\r\n rotate,\r\n shuffle,\r\n};\n\nexport default index;\nexport { compact, permutations, range, rotate, shuffle };\n//# sourceMappingURL=index.es.js.map\n","import { range, compact, rotate } from '@tonaljs/collection';\nimport { deprecate, note, interval } from '@tonaljs/core';\n\nconst EmptyPcset = {\r\n empty: true,\r\n name: \"\",\r\n setNum: 0,\r\n chroma: \"000000000000\",\r\n normalized: \"000000000000\",\r\n intervals: [],\r\n};\r\n// UTILITIES\r\nconst setNumToChroma = (num) => Number(num).toString(2);\r\nconst chromaToNumber = (chroma) => parseInt(chroma, 2);\r\nconst REGEX = /^[01]{12}$/;\r\nfunction isChroma(set) {\r\n return REGEX.test(set);\r\n}\r\nconst isPcsetNum = (set) => typeof set === \"number\" && set >= 0 && set <= 4095;\r\nconst isPcset = (set) => set && isChroma(set.chroma);\r\nconst cache = { [EmptyPcset.chroma]: EmptyPcset };\r\n/**\r\n * Get the pitch class set of a collection of notes or set number or chroma\r\n */\r\nfunction get(src) {\r\n const chroma = isChroma(src)\r\n ? src\r\n : isPcsetNum(src)\r\n ? setNumToChroma(src)\r\n : Array.isArray(src)\r\n ? listToChroma(src)\r\n : isPcset(src)\r\n ? src.chroma\r\n : EmptyPcset.chroma;\r\n return (cache[chroma] = cache[chroma] || chromaToPcset(chroma));\r\n}\r\n/**\r\n * Use Pcset.properties\r\n * @function\r\n * @deprecated\r\n */\r\nconst pcset = deprecate(\"Pcset.pcset\", \"Pcset.get\", get);\r\n/**\r\n * Get pitch class set chroma\r\n * @function\r\n * @example\r\n * Pcset.chroma([\"c\", \"d\", \"e\"]); //=> \"101010000000\"\r\n */\r\nconst chroma = (set) => get(set).chroma;\r\n/**\r\n * Get intervals (from C) of a set\r\n * @function\r\n * @example\r\n * Pcset.intervals([\"c\", \"d\", \"e\"]); //=>\r\n */\r\nconst intervals = (set) => get(set).intervals;\r\n/**\r\n * Get pitch class set number\r\n * @function\r\n * @example\r\n * Pcset.num([\"c\", \"d\", \"e\"]); //=> 2192\r\n */\r\nconst num = (set) => get(set).setNum;\r\nconst IVLS = [\r\n \"1P\",\r\n \"2m\",\r\n \"2M\",\r\n \"3m\",\r\n \"3M\",\r\n \"4P\",\r\n \"5d\",\r\n \"5P\",\r\n \"6m\",\r\n \"6M\",\r\n \"7m\",\r\n \"7M\",\r\n];\r\n/**\r\n * @private\r\n * Get the intervals of a pcset *starting from C*\r\n * @param {Set} set - the pitch class set\r\n * @return {IntervalName[]} an array of interval names or an empty array\r\n * if not a valid pitch class set\r\n */\r\nfunction chromaToIntervals(chroma) {\r\n const intervals = [];\r\n for (let i = 0; i < 12; i++) {\r\n // tslint:disable-next-line:curly\r\n if (chroma.charAt(i) === \"1\")\r\n intervals.push(IVLS[i]);\r\n }\r\n return intervals;\r\n}\r\n/**\r\n * Get a list of all possible pitch class sets (all possible chromas) *having\r\n * C as root*. There are 2048 different chromas. If you want them with another\r\n * note you have to transpose it\r\n *\r\n * @see http://allthescales.org/\r\n * @return {Array<PcsetChroma>} an array of possible chromas from '10000000000' to '11111111111'\r\n */\r\nfunction chromas() {\r\n return range(2048, 4095).map(setNumToChroma);\r\n}\r\n/**\r\n * Given a a list of notes or a pcset chroma, produce the rotations\r\n * of the chroma discarding the ones that starts with \"0\"\r\n *\r\n * This is used, for example, to get all the modes of a scale.\r\n *\r\n * @param {Array|string} set - the list of notes or pitchChr of the set\r\n * @param {boolean} normalize - (Optional, true by default) remove all\r\n * the rotations that starts with \"0\"\r\n * @return {Array<string>} an array with all the modes of the chroma\r\n *\r\n * @example\r\n * Pcset.modes([\"C\", \"D\", \"E\"]).map(Pcset.intervals)\r\n */\r\nfunction modes(set, normalize = true) {\r\n const pcs = get(set);\r\n const binary = pcs.chroma.split(\"\");\r\n return compact(binary.map((_, i) => {\r\n const r = rotate(i, binary);\r\n return normalize && r[0] === \"0\" ? null : r.join(\"\");\r\n }));\r\n}\r\n/**\r\n * Test if two pitch class sets are numentical\r\n *\r\n * @param {Array|string} set1 - one of the pitch class sets\r\n * @param {Array|string} set2 - the other pitch class set\r\n * @return {boolean} true if they are equal\r\n * @example\r\n * Pcset.isEqual([\"c2\", \"d3\"], [\"c5\", \"d2\"]) // => true\r\n */\r\nfunction isEqual(s1, s2) {\r\n return get(s1).setNum === get(s2).setNum;\r\n}\r\n/**\r\n * Create a function that test if a collection of notes is a\r\n * subset of a given set\r\n *\r\n * The function is curryfied.\r\n *\r\n * @param {PcsetChroma|NoteName[]} set - the superset to test against (chroma or\r\n * list of notes)\r\n * @return{function(PcsetChroma|NoteNames[]): boolean} a function accepting a set\r\n * to test against (chroma or list of notes)\r\n * @example\r\n * const inCMajor = Pcset.isSubsetOf([\"C\", \"E\", \"G\"])\r\n * inCMajor([\"e6\", \"c4\"]) // => true\r\n * inCMajor([\"e6\", \"c4\", \"d3\"]) // => false\r\n */\r\nfunction isSubsetOf(set) {\r\n const s = get(set).setNum;\r\n return (notes) => {\r\n const o = get(notes).setNum;\r\n // tslint:disable-next-line: no-bitwise\r\n return s && s !== o && (o & s) === o;\r\n };\r\n}\r\n/**\r\n * Create a function that test if a collection of notes is a\r\n * superset of a given set (it contains all notes and at least one more)\r\n *\r\n * @param {Set} set - an array of notes or a chroma set string to test against\r\n * @return {(subset: Set): boolean} a function that given a set\r\n * returns true if is a subset of the first one\r\n * @example\r\n * const extendsCMajor = Pcset.isSupersetOf([\"C\", \"E\", \"G\"])\r\n * extendsCMajor([\"e6\", \"a\", \"c4\", \"g2\"]) // => true\r\n * extendsCMajor([\"c6\", \"e4\", \"g3\"]) // => false\r\n */\r\nfunction isSupersetOf(set) {\r\n const s = get(set).setNum;\r\n return (notes) => {\r\n const o = get(notes).setNum;\r\n // tslint:disable-next-line: no-bitwise\r\n return s && s !== o && (o | s) === o;\r\n };\r\n}\r\n/**\r\n * Test if a given pitch class set includes a note\r\n *\r\n * @param {Array<string>} set - the base set to test against\r\n * @param {string} note - the note to test\r\n * @return {boolean} true if the note is included in the pcset\r\n *\r\n * Can be partially applied\r\n *\r\n * @example\r\n * const isNoteInCMajor = isNoteIncludedIn(['C', 'E', 'G'])\r\n * isNoteInCMajor('C4') // => true\r\n * isNoteInCMajor('C#4') // => false\r\n */\r\nfunction isNoteIncludedIn(set) {\r\n const s = get(set);\r\n return (noteName) => {\r\n const n = note(noteName);\r\n return s && !n.empty && s.chroma.charAt(n.chroma) === \"1\";\r\n };\r\n}\r\n/** @deprecated use: isNoteIncludedIn */\r\nconst includes = isNoteIncludedIn;\r\n/**\r\n * Filter a list with a pitch class set\r\n *\r\n * @param {Array|string} set - the pitch class set notes\r\n * @param {Array|string} notes - the note list to be filtered\r\n * @return {Array} the filtered notes\r\n *\r\n * @example\r\n * Pcset.filter([\"C\", \"D\", \"E\"], [\"c2\", \"c#2\", \"d2\", \"c3\", \"c#3\", \"d3\"]) // => [ \"c2\", \"d2\", \"c3\", \"d3\" ])\r\n * Pcset.filter([\"C2\"], [\"c2\", \"c#2\", \"d2\", \"c3\", \"c#3\", \"d3\"]) // => [ \"c2\", \"c3\" ])\r\n */\r\nfunction filter(set) {\r\n const isIncluded = isNoteIncludedIn(set);\r\n return (notes) => {\r\n return notes.filter(isIncluded);\r\n };\r\n}\r\nvar index = {\r\n get,\r\n chroma,\r\n num,\r\n intervals,\r\n chromas,\r\n isSupersetOf,\r\n isSubsetOf,\r\n isNoteIncludedIn,\r\n isEqual,\r\n filter,\r\n modes,\r\n // deprecated\r\n pcset,\r\n};\r\n//// PRIVATE ////\r\nfunction chromaRotations(chroma) {\r\n const binary = chroma.split(\"\");\r\n return binary.map((_, i) => rotate(i, binary).join(\"\"));\r\n}\r\nfunction chromaToPcset(chroma) {\r\n const setNum = chromaToNumber(chroma);\r\n const normalizedNum = chromaRotations(chroma)\r\n .map(chromaToNumber)\r\n .filter((n) => n >= 2048)\r\n .sort()[0];\r\n const normalized = setNumToChroma(normalizedNum);\r\n const intervals = chromaToIntervals(chroma);\r\n return {\r\n empty: false,\r\n name: \"\",\r\n setNum,\r\n chroma,\r\n normalized,\r\n intervals,\r\n };\r\n}\r\nfunction listToChroma(set) {\r\n if (set.length === 0) {\r\n return EmptyPcset.chroma;\r\n }\r\n let pitch;\r\n const binary = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\r\n // tslint:disable-next-line:prefer-for-of\r\n for (let i = 0; i < set.length; i++) {\r\n pitch = note(set[i]);\r\n // tslint:disable-next-line: curly\r\n if (pitch.empty)\r\n pitch = interval(set[i]);\r\n // tslint:disable-next-line: curly\r\n if (!pitch.empty)\r\n binary[pitch.chroma] = 1;\r\n }\r\n return binary.join(\"\");\r\n}\n\nexport default index;\nexport { EmptyPcset, chromaToIntervals, chromas, filter, get, includes, isEqual, isNoteIncludedIn, isSubsetOf, isSupersetOf, modes, pcset };\n//# sourceMappingURL=index.es.js.map\n","import { deprecate } from '@tonaljs/core';\nimport { get as get$1, EmptyPcset } from '@tonaljs/pcset';\n\n/**\r\n * @private\r\n * Chord List\r\n * Source: https://en.wikibooks.org/wiki/Music_Theory/Complete_List_of_Chord_Patterns\r\n * Format: [\"intervals\", \"full name\", \"abrv1 abrv2\"]\r\n */\r\nconst CHORDS = [\r\n // ==Major==\r\n [\"1P 3M 5P\", \"major\", \"M ^ \"],\r\n [\"1P 3M 5P 7M\", \"major seventh\", \"maj7 Δ ma7 M7 Maj7 ^7\"],\r\n [\"1P 3M 5P 7M 9M\", \"major ninth\", \"maj9 Δ9 ^9\"],\r\n [\"1P 3M 5P 7M 9M 13M\", \"major thirteenth\", \"maj13 Maj13 ^13\"],\r\n [\"1P 3M 5P 6M\", \"sixth\", \"6 add6 add13 M6\"],\r\n [\"1P 3M 5P 6M 9M\", \"sixth/ninth\", \"6/9 69 M69\"],\r\n [\"1P 3M 6m 7M\", \"major seventh flat sixth\", \"M7b6 ^7b6\"],\r\n [\r\n \"1P 3M 5P 7M 11A\",\r\n \"major seventh sharp eleventh\",\r\n \"maj#4 Δ#4 Δ#11 M7#11 ^7#11 maj7#11\",\r\n ],\r\n // ==Minor==\r\n // '''Normal'''\r\n [\"1P 3m 5P\", \"minor\", \"m min -\"],\r\n [\"1P 3m 5P 7m\", \"minor seventh\", \"m7 min7 mi7 -7\"],\r\n [\r\n \"1P 3m 5P 7M\",\r\n \"minor/major seventh\",\r\n \"m/ma7 m/maj7 mM7 mMaj7 m/M7 -Δ7 mΔ -^7\",\r\n ],\r\n [\"1P 3m 5P 6M\", \"minor sixth\", \"m6 -6\"],\r\n [\"1P 3m 5P 7m 9M\", \"minor ninth\", \"m9 -9\"],\r\n [\"1P 3m 5P 7M 9M\", \"minor/major ninth\", \"mM9 mMaj9 -^9\"],\r\n [\"1P 3m 5P 7m 9M 11P\", \"minor eleventh\", \"m11 -11\"],\r\n [\"1P 3m 5P 7m 9M 13M\", \"minor thirteenth\", \"m13 -13\"],\r\n // '''Diminished'''\r\n [\"1P 3m 5d\", \"diminished\", \"dim ° o\"],\r\n [\"1P 3m 5d 7d\", \"diminished seventh\", \"dim7 °7 o7\"],\r\n [\"1P 3m 5d 7m\", \"half-diminished\", \"m7b5 ø -7b5 h7 h\"],\r\n // ==Dominant/Seventh==\r\n // '''Normal'''\r\n [\"1P 3M 5P 7m\", \"dominant seventh\", \"7 dom\"],\r\n [\"1P 3M 5P 7m 9M\", \"dominant ninth\", \"9\"],\r\n [\"1P 3M 5P 7m 9M 13M\", \"dominant thirteenth\", \"13\"],\r\n [\"1P 3M 5P 7m 11A\", \"lydian dominant seventh\", \"7#11 7#4\"],\r\n // '''Altered'''\r\n [\"1P 3M 5P 7m 9m\", \"dominant flat ninth\", \"7b9\"],\r\n [\"1P 3M 5P 7m 9A\", \"dominant sharp ninth\", \"7#9\"],\r\n [\"1P 3M 7m 9m\", \"altered\", \"alt7\"],\r\n // '''Suspended'''\r\n [\"1P 4P 5P\", \"suspended fourth\", \"sus4 sus\"],\r\n [\"1P 2M 5P\", \"suspended second\", \"sus2\"],\r\n [\"1P 4P 5P 7m\", \"suspended fourth seventh\", \"7sus4 7sus\"],\r\n [\"1P 5P 7m 9M 11P\", \"eleventh\", \"11\"],\r\n [\r\n \"1P 4P 5P 7m 9m\",\r\n \"suspended fourth flat ninth\",\r\n \"b9sus phryg 7b9sus 7b9sus4\",\r\n ],\r\n // ==Other==\r\n [\"1P 5P\", \"fifth\", \"5\"],\r\n [\"1P 3M 5A\", \"augmented\", \"aug + +5 ^#5\"],\r\n [\"1P 3m 5A\", \"minor augmented\", \"m#5 -#5 m+\"],\r\n [\"1P 3M 5A 7M\", \"augmented seventh\", \"maj7#5 maj7+5 +maj7 ^7#5\"],\r\n [\r\n \"1P 3M 5P 7M 9M 11A\",\r\n \"major sharp eleventh (lydian)\",\r\n \"maj9#11 Δ9#11 ^9#11\",\r\n ],\r\n // ==Legacy==\r\n [\"1P 2M 4P 5P\", \"\", \"sus24 sus4add9\"],\r\n [\"1P 3M 5A 7M 9M\", \"\", \"maj9#5 Maj9#5\"],\r\n [\"1P 3M 5A 7m\", \"\", \"7#5 +7 7+ 7aug aug7\"],\r\n [\"1P 3M 5A 7m 9A\", \"\", \"7#5#9 7#9#5 7alt\"],\r\n [\"1P 3M 5A 7m 9M\", \"\", \"9#5 9+\"],\r\n [\"1P 3M 5A 7m 9M 11A\", \"\", \"9#5#11\"],\r\n [\"1P 3M 5A 7m 9m\", \"\", \"7#5b9 7b9#5\"],\r\n [\"1P 3M 5A 7m 9m 11A\", \"\", \"7#5b9#11\"],\r\n [\"1P 3M 5A 9A\", \"\", \"+add#9\"],\r\n [\"1P 3M 5A 9M\", \"\", \"M#5add9 +add9\"],\r\n [\"1P 3M 5P 6M 11A\", \"\", \"M6#11 M6b5 6#11 6b5\"],\r\n [\"1P 3M 5P 6M 7M 9M\", \"\", \"M7add13\"],\r\n [\"1P 3M 5P 6M 9M 11A\", \"\", \"69#11\"],\r\n [\"1P 3m 5P 6M 9M\", \"\", \"m69 -69\"],\r\n [\"1P 3M 5P 6m 7m\", \"\", \"7b6\"],\r\n [\"1P 3M 5P 7M 9A 11A\", \"\", \"maj7#9#11\"],\r\n [\"1P 3M 5P 7M 9M 11A 13M\", \"\", \"M13#11 maj13#11 M13+4 M13#4\"],\r\n [\"1P 3M 5P 7M 9m\", \"\", \"M7b9\"],\r\n [\"1P 3M 5P 7m 11A 13m\", \"\", \"7#11b13 7b5b13\"],\r\n [\"1P 3M 5P 7m 13M\", \"\", \"7add6 67 7add13\"],\r\n [\"1P 3M 5P 7m 9A 11A\", \"\", \"7#9#11 7b5#9 7#9b5\"],\r\n [\"1P 3M 5P 7m 9A 11A 13M\", \"\", \"13#9#11\"],\r\n [\"1P 3M 5P 7m 9A 11A 13m\", \"\", \"7#9#11b13\"],\r\n [\"1P 3M 5P 7m 9A 13M\", \"\", \"13#9\"],\r\n [\"1P 3M 5P 7m 9A 13m\", \"\", \"7#9b13\"],\r\n [\"1P 3M 5P 7m 9M 11A\", \"\", \"9#11 9+4 9#4\"],\r\n [\"1P 3M 5P 7m 9M 11A 13M\", \"\", \"13#11 13+4 13#4\"],\r\n [\"1P 3M 5P 7m 9M 11A 13m\", \"\", \"9#11b13 9b5b13\"],\r\n [\"1P 3M 5P 7m 9m 11A\", \"\", \"7b9#11 7b5b9 7b9b5\"],\r\n [\"1P 3M 5P 7m 9m 11A 13M\", \"\", \"13b9#11\"],\r\n [\"1P 3M 5P 7m 9m 11A 13m\", \"\", \"7b9b13#11 7b9#11b13 7b5b9b13\"],\r\n [\"1P 3M 5P 7m 9m 13M\", \"\", \"13b9\"],\r\n [\"1P 3M 5P 7m 9m 13m\", \"\", \"7b9b13\"],\r\n [\"1P 3M 5P 7m 9m 9A\", \"\", \"7b9#9\"],\r\n [\"1P 3M 5P 9M\", \"\", \"Madd9 2 add9 add2\"],\r\n [\"1P 3M 5P 9m\", \"\", \"Maddb9\"],\r\n [\"1P 3M 5d\", \"\", \"Mb5\"],\r\n [\"1P 3M 5d 6M 7m 9M\", \"\", \"13b5\"],\r\n [\"1P 3M 5d 7M\", \"\", \"M7b5\"],\r\n [\"1P 3M 5d 7M 9M\", \"\", \"M9b5\"],\r\n [\"1P 3M 5d 7m\", \"\", \"7b5\"],\r\n [\"1P 3M 5d 7m 9M\", \"\", \"9b5\"],\r\n [\"1P 3M 7m\", \"\", \"7no5\"],\r\n [\"1P 3M 7m 13m\", \"\", \"7b13\"],\r\n [\"1P 3M 7m 9M\", \"\", \"9no5\"],\r\n [\"1P 3M 7m 9M 13M\", \"\", \"13no5\"],\r\n [\"1P 3M 7m 9M 13m\", \"\", \"9b13\"],\r\n [\"1P 3m 4P 5P\", \"\", \"madd4\"],\r\n [\"1P 3m 5P 6m 7M\", \"\", \"mMaj7b6\"],\r\n [\"1P 3m 5P 6m 7M 9M\", \"\", \"mMaj9b6\"],\r\n [\"1P 3m 5P 7m 11P\", \"\", \"m7add11 m7add4\"],\r\n [\"1P 3m 5P 9M\", \"\", \"madd9\"],\r\n [\"1P 3m 5d 6M 7M\", \"\", \"o7M7\"],\r\n [\"1P 3m 5d 7M\", \"\", \"oM7\"],\r\n [\"1P 3m 6m 7M\", \"\", \"mb6M7\"],\r\n [\"1P 3m 6m 7m\", \"\", \"m7#5\"],\r\n [\"1P 3m 6m 7m 9M\", \"\", \"m9#5\"],\r\n [\"1P 3m 5A 7m 9M 11P\", \"\", \"m11A\"],\r\n [\"1P 3m 6m 9m\", \"\", \"mb6b9\"],\r\n [\"1P 2M 3m 5d 7m\", \"\", \"m9b5\"],\r\n [\"1P 4P 5A 7M\", \"\", \"M7#5sus4\"],\r\n [\"1P 4P 5A 7M 9M\", \"\", \"M9#5sus4\"],\r\n [\"1P 4P 5A 7m\", \"\", \"7#5sus4\"],\r\n [\"1P 4P 5P 7M\", \"\", \"M7sus4\"],\r\n [\"1P 4P 5P 7M 9M\", \"\", \"M9sus4\"],\r\n [\"1P 4P 5P 7m 9M\", \"\", \"9sus4 9sus\"],\r\n [\"1P 4P 5P 7m 9M 13M\", \"\", \"13sus4 13sus\"],\r\n [\"1P 4P 5P 7m 9m 13m\", \"\", \"7sus4b9b13 7b9b13sus4\"],\r\n [\"1P 4P 7m 10m\", \"\", \"4 quartal\"],\r\n [\"1P 5P 7m 9m 11P\", \"\", \"11b9\"],\r\n];\n\nconst NoChordType = {\r\n ...EmptyPcset,\r\n name: \"\",\r\n quality: \"Unknown\",\r\n intervals: [],\r\n aliases: [],\r\n};\r\nlet dictionary = [];\r\nlet index = {};\r\n/**\r\n * Given a chord name or chroma, return the chord properties\r\n * @param {string} source - chord name or pitch class set chroma\r\n * @example\r\n * import { get } from 'tonaljs/chord-type'\r\n * get('major') // => { name: 'major', ... }\r\n */\r\nfunction get(type) {\r\n return index[type] || NoChordType;\r\n}\r\nconst chordType = deprecate(\"ChordType.chordType\", \"ChordType.get\", get);\r\n/**\r\n * Get all chord (long) names\r\n */\r\nfunction names() {\r\n return dictionary.map((chord) => chord.name).filter((x) => x);\r\n}\r\n/**\r\n * Get all chord symbols\r\n */\r\nfunction symbols() {\r\n return dictionary.map((chord) => chord.aliases[0]).filter((x) => x);\r\n}\r\n/**\r\n * Keys used to reference chord types\r\n */\r\nfunction keys() {\r\n return Object.keys(index);\r\n}\r\n/**\r\n * Return a list of all chord types\r\n */\r\nfunction all() {\r\n return dictionary.slice();\r\n}\r\nconst entries = deprecate(\"ChordType.entries\", \"ChordType.all\", all);\r\n/**\r\n * Clear the dictionary\r\n */\r\nfunction removeAll() {\r\n dictionary = [];\r\n index = {};\r\n}\r\n/**\r\n * Add a chord to the dictionary.\r\n * @param intervals\r\n * @param aliases\r\n * @param [fullName]\r\n */\r\nfunction add(intervals, aliases, fullName) {\r\n const quality = getQuality(intervals);\r\n const chord = {\r\n ...get$1(intervals),\r\n name: fullName || \"\",\r\n quality,\r\n intervals,\r\n aliases,\r\n };\r\n dictionary.push(chord);\r\n if (chord.name) {\r\n index[chord.name] = chord;\r\n }\r\n index[chord.setNum] = chord;\r\n index[chord.chroma] = chord;\r\n chord.aliases.forEach((alias) => addAlias(chord, alias));\r\n}\r\nfunction addAlias(chord, alias) {\r\n index[alias] = chord;\r\n}\r\nfunction getQuality(intervals) {\r\n const has = (interval) => intervals.indexOf(interval) !== -1;\r\n return has(\"5A\")\r\n ? \"Augmented\"\r\n : has(\"3M\")\r\n ? \"Major\"\r\n : has(\"5d\")\r\n ? \"Diminished\"\r\n : has(\"3m\")\r\n ? \"Minor\"\r\n : \"Unknown\";\r\n}\r\nCHORDS.forEach(([ivls, fullName, names]) => add(ivls.split(\" \"), names.split(\" \"), fullName));\r\ndictionary.sort((a, b) => a.setNum - b.setNum);\r\nvar index$1 = {\r\n names,\r\n symbols,\r\n get,\r\n all,\r\n add,\r\n removeAll,\r\n keys,\r\n // deprecated\r\n entries,\r\n chordType,\r\n};\n\nexport default index$1;\nexport { add, addAlias, all, chordType, entries, get, keys, names, removeAll, symbols };\n//# sourceMappingURL=index.es.js.map\n","import { deprecate } from '@tonaljs/core';\nimport { EmptyPcset, get as get$1 } from '@tonaljs/pcset';\n\n// SCALES\r\n// Format: [\"intervals\", \"name\", \"alias1\", \"alias2\", ...]\r\nconst SCALES = [\r\n // 5-note scales\r\n [\"1P 2M 3M 5P 6M\", \"major pentatonic\", \"pentatonic\"],\r\n [\"1P 3M 4P 5P 7M\", \"ionian pentatonic\"],\r\n [\"1P 3M 4P 5P 7m\", \"mixolydian pentatonic\", \"indian\"],\r\n [\"1P 2M 4P 5P 6M\", \"ritusen\"],\r\n [\"1P 2M 4P 5P 7m\", \"egyptian\"],\r\n [\"1P 3M 4P 5d 7m\", \"neopolitan major pentatonic\"],\r\n [\"1P 3m 4P 5P 6m\", \"vietnamese 1\"],\r\n [\"1P 2m 3m 5P 6m\", \"pelog\"],\r\n [\"1P 2m 4P 5P 6m\", \"kumoijoshi\"],\r\n [\"1P 2M 3m 5P 6m\", \"hirajoshi\"],\r\n [\"1P 2m 4P 5d 7m\", \"iwato\"],\r\n [\"1P 2m 4P 5P 7m\", \"in-sen\"],\r\n [\"1P 3M 4A 5P 7M\", \"lydian pentatonic\", \"chinese\"],\r\n [\"1P 3m 4P 6m 7m\", \"malkos raga\"],\r\n [\"1P 3m 4P 5d 7m\", \"locrian pentatonic\", \"minor seven flat five pentatonic\"],\r\n [\"1P 3m 4P 5P 7m\", \"minor pentatonic\", \"vietnamese 2\"],\r\n [\"1P 3m 4P 5P 6M\", \"minor six pentatonic\"],\r\n [\"1P 2M 3m 5P 6M\", \"flat three pentatonic\", \"kumoi\"],\r\n [\"1P 2M 3M 5P 6m\", \"flat six pentatonic\"],\r\n [\"1P 2m 3M 5P 6M\", \"scriabin\"],\r\n [\"1P 3M 5d 6m 7m\", \"whole tone pentatonic\"],\r\n [\"1P 3M 4A 5A 7M\", \"lydian #5P pentatonic\"],\r\n [\"1P 3M 4A 5P 7m\", \"lydian dominant pentatonic\"],\r\n [\"1P 3m 4P 5P 7M\", \"minor #7M pentatonic\"],\r\n [\"1P 3m 4d 5d 7m\", \"super locrian pentatonic\"],\r\n // 6-note scales\r\n [\"1P 2M 3m 4P 5P 7M\", \"minor hexatonic\"],\r\n [\"1P 2A 3M 5P 5A 7M\", \"augmented\"],\r\n [\"1P 2M 3m 3M 5P 6M\", \"major blues\"],\r\n [\"1P 2M 4P 5P 6M 7m\", \"piongio\"],\r\n [\"1P 2m 3M 4A 6M 7m\", \"prometheus neopolitan\"],\r\n [\"1P 2M 3M 4A 6M 7m\", \"prometheus\"],\r\n [\"1P 2m 3M 5d 6m 7m\", \"mystery #1\"],\r\n [\"1P 2m 3M 4P 5A 6M\", \"six tone symmetric\"],\r\n [\"1P 2M 3M 4A 5A 7m\", \"whole tone\", \"messiaen's mode #1\"],\r\n [\"1P 2m 4P 4A 5P 7M\", \"messiaen's mode #5\"],\r\n [\"1P 3m 4P 5d 5P 7m\", \"minor blues\", \"blues\"],\r\n // 7-note scales\r\n [\"1P 2M 3M 4P 5d 6m 7m\", \"locrian major\", \"arabian\"],\r\n [\"1P 2m 3M 4A 5P 6m 7M\", \"double harmonic lydian\"],\r\n [\"1P 2M 3m 4P 5P 6m 7M\", \"harmonic minor\"],\r\n [\r\n \"1P 2m 3m 4d 5d 6m 7m\",\r\n \"altered\",\r\n \"super locrian\",\r\n \"diminished whole tone\",\r\n \"pomeroy\",\r\n ],\r\n [\"1P 2M 3m 4P 5d 6m 7m\", \"locrian #2\", \"half-diminished\", \"aeolian b5\"],\r\n [\r\n \"1P 2M 3M 4P 5P 6m 7m\",\r\n \"mixolydian b6\",\r\n \"melodic minor fifth mode\",\r\n \"hindu\",\r\n ],\r\n [\"1P 2M 3M 4A 5P 6M 7m\", \"lydian dominant\", \"lydian b7\", \"overtone\"],\r\n [\"1P 2M 3M 4A 5P 6M 7M\", \"lydian\"],\r\n [\"1P 2M 3M 4A 5A 6M 7M\", \"lydian augmented\"],\r\n [\r\n \"1P 2m 3m 4P 5P 6M 7m\",\r\n \"dorian b2\",\r\n \"phrygian #6\",\r\n \"melodic minor second mode\",\r\n ],\r\n [\"1P 2M 3m 4P 5P 6M 7M\", \"melodic minor\"],\r\n [\"1P 2m 3m 4P 5d 6m 7m\", \"locrian\"],\r\n [\r\n \"1P 2m 3m 4d 5d 6m 7d\",\r\n \"ultralocrian\",\r\n \"superlocrian bb7\",\r\n \"·superlocrian diminished\",\r\n ],\r\n [\"1P 2m 3m 4P 5d 6M 7m\", \"locrian 6\", \"locrian natural 6\", \"locrian sharp 6\"],\r\n [\"1P 2A 3M 4P 5P 5A 7M\", \"augmented heptatonic\"],\r\n [\"1P 2M 3m 5d 5P 6M 7m\", \"romanian minor\"],\r\n [\"1P 2M 3m 4A 5P 6M 7m\", \"dorian #4\"],\r\n [\"1P 2M 3m 4A 5P 6M 7M\", \"lydian diminished\"],\r\n [\"1P 2m 3m 4P 5P 6m 7m\", \"phrygian\"],\r\n [\"1P 2M 3M 4A 5A 7m 7M\", \"leading whole tone\"],\r\n [\"1P 2M 3M 4A 5P 6m 7m\", \"lydian minor\"],\r\n [\"1P 2m 3M 4P 5P 6m 7m\", \"phrygian dominant\", \"spanish\", \"phrygian major\"],\r\n [\"1P 2m 3m 4P 5P 6m 7M\", \"balinese\"],\r\n [\"1P 2m 3m 4P 5P 6M 7M\", \"neopolitan major\"],\r\n [\"1P 2M 3m 4P 5P 6m 7m\", \"aeolian\", \"minor\"],\r\n [\"1P 2M 3M 4P 5P 6m 7M\", \"harmonic major\"],\r\n [\"1P 2m 3M 4P 5P 6m 7M\", \"double harmonic major\", \"gypsy\"],\r\n [\"1P 2M 3m 4P 5P 6M 7m\", \"dorian\"],\r\n [\"1P 2M 3m 4A 5P 6m 7M\", \"hungarian minor\"],\r\n [\"1P 2A 3M 4A 5P 6M 7m\", \"hungarian major\"],\r\n [\"1P 2m 3M 4P 5d 6M 7m\", \"oriental\"],\r\n [\"1P 2m 3m 3M 4A 5P 7m\", \"flamenco\"],\r\n [\"1P 2m 3m 4A 5P 6m 7M\", \"todi raga\"],\r\n [\"1P 2M 3M 4P 5P 6M 7m\", \"mixolydian\", \"dominant\"],\r\n [\"1P 2m 3M 4P 5d 6m 7M\", \"persian\"],\r\n [\"1P 2M 3M 4P 5P 6M 7M\", \"major\", \"ionian\"],\r\n [\"1P 2m 3M 5d 6m 7m 7M\", \"enigmatic\"],\r\n [\r\n \"1P 2M 3M 4P 5A 6M 7M\",\r\n \"major augmented\",\r\n \"major #5\",\r\n \"ionian augmented\",\r\n \"ionian #5\",\r\n ],\r\n [\"1P 2A 3M 4A 5P 6M 7M\", \"lydian #9\"],\r\n // 8-note scales\r\n [\"1P 2m 2M 4P 4A 5P 6m 7M\", \"messiaen's mode #4\"],\r\n [\"1P 2m 3M 4P 4A 5P 6m 7M\", \"purvi raga\"],\r\n [\"1P 2m 3m 3M 4P 5P 6m 7m\", \"spanish heptatonic\"],\r\n [\"1P 2M 3M 4P 5P 6M 7m 7M\", \"bebop\"],\r\n [\"1P 2M 3m 3M 4P 5P 6M 7m\", \"bebop minor\"],\r\n [\"1P 2M 3M 4P 5P 5A 6M 7M\", \"bebop major\"],\r\n [\"1P 2m 3m 4P 5d 5P 6m 7m\", \"bebop locrian\"],\r\n [\"1P 2M 3m 4P 5P 6m 7m 7M\", \"minor bebop\"],\r\n [\"1P 2M 3m 4P 5d 6m 6M 7M\", \"diminished\", \"whole-half diminished\"],\r\n [\"1P 2M 3M 4P 5d 5P 6M 7M\", \"ichikosucho\"],\r\n [\"1P 2M 3m 4P 5P 6m 6M 7M\", \"minor six diminished\"],\r\n [\r\n \"1P 2m 3m 3M 4A 5P 6M 7m\",\r\n \"half-whole diminished\",\r\n \"dominant diminished\",\r\n \"messiaen's mode #2\",\r\n ],\r\n [\"1P 3m 3M 4P 5P 6M 7m 7M\", \"kafi raga\"],\r\n [\"1P 2M 3M 4P 4A 5A 6A 7M\", \"messiaen's mode #6\"],\r\n // 9-note scales\r\n [\"1P 2M 3m 3M 4P 5d 5P 6M 7m\", \"composite blues\"],\r\n [\"1P 2M 3m 3M 4A 5P 6m 7m 7M\", \"messiaen's mode #3\"],\r\n // 10-note scales\r\n [\"1P 2m 2M 3m 4P 4A 5P 6m 6M 7M\", \"messiaen's mode #7\"],\r\n // 12-note scales\r\n [\"1P 2m 2M 3m 3M 4P 5d 5P 6m 6M 7m 7M\", \"chromatic\"],\r\n];\n\nconst NoScaleType = {\r\n ...EmptyPcset,\r\n intervals: [],\r\n aliases: [],\r\n};\r\nlet dictionary = [];\r\nlet index = {};\r\nfunction names() {\r\n return dictionary.map((scale) => scale.name);\r\n}\r\n/**\r\n * Given a scale name or chroma, return the scale properties\r\n *\r\n * @param {string} type - scale name or pitch class set chroma\r\n * @example\r\n * import { get } from 'tonaljs/scale-type'\r\n * get('major') // => { name: 'major', ... }\r\n */\r\nfunction get(type) {\r\n return index[type] || NoScaleType;\r\n}\r\nconst scaleType = deprecate(\"ScaleDictionary.scaleType\", \"ScaleType.get\", get);\r\n/**\r\n * Return a list of all scale types\r\n */\r\nfunction all() {\r\n return dictionary.slice();\r\n}\r\nconst entries = deprecate(\"ScaleDictionary.entries\", \"ScaleType.all\", all);\r\n/**\r\n * Keys used to reference scale types\r\n */\r\nfunction keys() {\r\n return Object.keys(index);\r\n}\r\n/**\r\n * Clear the dictionary\r\n */\r\nfunction removeAll() {\r\n dictionary = [];\r\n index = {};\r\n}\r\n/**\r\n * Add a scale into dictionary\r\n * @param intervals\r\n * @param name\r\n * @param aliases\r\n */\r\nfunction add(intervals, name, aliases = []) {\r\n const scale = { ...get$1(intervals), name, intervals, aliases };\r\n dictionary.push(scale);\r\n index[scale.name] = scale;\r\n index[scale.setNum] = scale;\r\n index[scale.chroma] = scale;\r\n scale.aliases.forEach((alias) => addAlias(scale, alias));\r\n return scale;\r\n}\r\nfunction addAlias(scale, alias) {\r\n index[alias] = scale;\r\n}\r\nSCALES.forEach(([ivls, name, ...aliases]) => add(ivls.split(\" \"), name, aliases));\r\nvar index$1 = {\r\n names,\r\n get,\r\n all,\r\n add,\r\n removeAll,\r\n keys,\r\n // deprecated\r\n entries,\r\n scaleType,\r\n};\n\nexport default index$1;\nexport { NoScaleType, add, addAlias, all, entries, get, keys, names, removeAll, scaleType };\n//# sourceMappingURL=index.es.js.map\n","import { detect } from '@tonaljs/chord-detect';\nexport { detect } from '@tonaljs/chord-detect';\nimport { get as get$1, all as all$1 } from '@tonaljs/chord-type';\nimport { tokenizeNote, note, distance, transpose as transpose$1, deprecate } from '@tonaljs/core';\nimport { isSupersetOf, isSubsetOf } from '@tonaljs/pcset';\nimport { all } from '@tonaljs/scale-type';\n\nconst NoChord = {\r\n empty: true,\r\n name: \"\",\r\n symbol: \"\",\r\n root: \"\",\r\n rootDegree: 0,\r\n type: \"\",\r\n tonic: null,\r\n setNum: NaN,\r\n quality: \"Unknown\",\r\n chroma: \"\",\r\n normalized: \"\",\r\n aliases: [],\r\n notes: [],\r\n intervals: [],\r\n};\r\n// 6, 64, 7, 9, 11 and 13 are consider part of the chord\r\n// (see https://github.com/danigb/tonal/issues/55)\r\nconst NUM_TYPES = /^(6|64|7|9|11|13)$/;\r\n/**\r\n * Tokenize a chord name. It returns an array with the tonic and chord type\r\n * If not tonic is found, all the name is considered the chord name.\r\n *\r\n * This function does NOT check if the chord type exists or not. It only tries\r\n * to split the tonic and chord type.\r\n *\r\n * @function\r\n * @param {string} name - the chord name\r\n * @return {Array} an array with [tonic, type]\r\n * @example\r\n * tokenize(\"Cmaj7\") // => [ \"C\", \"maj7\" ]\r\n * tokenize(\"C7\") // => [ \"C\", \"7\" ]\r\n * tokenize(\"mMaj7\") // => [ null, \"mMaj7\" ]\r\n * tokenize(\"Cnonsense\") // => [ null, \"nonsense\" ]\r\n */\r\nfunction tokenize(name) {\r\n const [letter, acc, oct, type] = tokenizeNote(name);\r\n if (letter === \"\") {\r\n return [\"\", name];\r\n }\r\n // aug is augmented (see https://github.com/danigb/tonal/issues/55)\r\n if (letter === \"A\" && type === \"ug\") {\r\n return [\"\", \"aug\"];\r\n }\r\n // see: https://github.com/tonaljs/tonal/issues/70\r\n if (!type && (oct === \"4\" || oct === \"5\")) {\r\n return [letter + acc, oct];\r\n }\r\n if (NUM_TYPES.test(oct)) {\r\n return [letter + acc, oct + type];\r\n }\r\n else {\r\n return [letter + acc + oct, type];\r\n }\r\n}\r\n/**\r\n * Get a Chord from a chord name.\r\n */\r\nfunction get(src) {\r\n if (src === \"\") {\r\n return NoChord;\r\n }\r\n if (Array.isArray(src) && src.length === 2) {\r\n return getChord(src[1], src[0]);\r\n }\r\n else {\r\n const [tonic, type] = tokenize(src);\r\n const chord = getChord(type, tonic);\r\n return chord.empty ? getChord(src) : chord;\r\n }\r\n}\r\n/**\r\n * Get chord properties\r\n *\r\n * @param typeName - the chord type name\r\n * @param [tonic] - Optional tonic\r\n * @param [root] - Optional root (requires a tonic)\r\n */\r\nfunction getChord(typeName, optionalTonic, optionalRoot) {\r\n const type = get$1(typeName);\r\n const tonic = note(optionalTonic || \"\");\r\n const root = note(optionalRoot || \"\");\r\n if (type.empty ||\r\n (optionalTonic && tonic.empty) ||\r\n (optionalRoot && root.empty)) {\r\n return NoChord;\r\n }\r\n const rootInterval = distance(tonic.pc, root.pc);\r\n const rootDegree = type.intervals.indexOf(rootInterval) + 1;\r\n if (!root.empty && !rootDegree) {\r\n return NoChord;\r\n }\r\n const intervals = Array.from(type.intervals);\r\n for (let i = 1; i < rootDegree; i++) {\r\n const num = intervals[0][0];\r\n const quality = intervals[0][1];\r\n const newNum = parseInt(num, 10) + 7;\r\n intervals.push(`${newNum}${quality}`);\r\n intervals.shift();\r\n }\r\n const notes = tonic.empty\r\n ? []\r\n : intervals.map((i) => transpose$1(tonic, i));\r\n typeName = type.aliases.indexOf(typeName) !== -1 ? typeName : type.aliases[0];\r\n const symbol = `${tonic.empty ? \"\" : tonic.pc}${typeName}${root.empty || rootDegree <= 1 ? \"\" : \"/\" + root.pc}`;\r\n const name = `${optionalTonic ? tonic.pc + \" \" : \"\"}${type.name}${rootDegree > 1 && optionalRoot ? \" over \" + root.pc : \"\"}`;\r\n return {\r\n ...type,\r\n name,\r\n symbol,\r\n type: type.name,\r\n root: root.name,\r\n intervals,\r\n rootDegree,\r\n tonic: tonic.name,\r\n notes,\r\n };\r\n}\r\nconst chord = deprecate(\"Chord.chord\", \"Chord.get\", get);\r\n/**\r\n * Transpose a chord name\r\n *\r\n * @param {string} chordName - the chord name\r\n * @return {string} the transposed chord\r\n *\r\n * @example\r\n * transpose('Dm7', 'P4') // => 'Gm7\r\n */\r\nfunction transpose(chordName, interval) {\r\n const [tonic, type] = tokenize(chordName);\r\n if (!tonic) {\r\n return chordName;\r\n }\r\n return transpose$1(tonic, interval) + type;\r\n}\r\n/**\r\n * Get all scales where the given chord fits\r\n *\r\n * @example\r\n * chordScales('C7b9')\r\n * // => [\"phrygian dominant\", \"flamenco\", \"spanish heptatonic\", \"half-whole diminished\", \"chromatic\"]\r\n */\r\nfunction chordScales(name) {\r\n const s = get(name);\r\n const isChordIncluded = isSupersetOf(s.chroma);\r\n return all()\r\n .filter((scale) => isChordIncluded(scale.chroma))\r\n .map((scale) => scale.name);\r\n}\r\n/**\r\n * Get all chords names that are a superset of the given one\r\n * (has the same notes and at least one more)\r\n *\r\n * @function\r\n * @example\r\n * extended(\"CMaj7\")\r\n * // => [ 'Cmaj#4', 'Cmaj7#9#11', 'Cmaj9', 'CM7add13', 'Cmaj13', 'Cmaj9#11', 'CM13#11', 'CM7b9' ]\r\n */\r\nfunction extended(chordName) {\r\n const s = get(chordName);\r\n const isSuperset = isSupersetOf(s.chroma);\r\n return all$1()\r\n .filter((chord) => isSuperset(chord.chroma))\r\n .map((chord) => s.tonic + chord.aliases[0]);\r\n}\r\n/**\r\n * Find all chords names that are a subset of the given one\r\n * (has less notes but all from the given chord)\r\n *\r\n * @example\r\n */\r\nfunction reduced(chordName) {\r\n const s = get(chordName);\r\n const isSubset = isSubsetOf(s.chroma);\r\n return all$1()\r\n .filter((chord) => isSubset(chord.chroma))\r\n .map((chord) => s.tonic + chord.aliases[0]);\r\n}\r\nvar index = {\r\n getChord,\r\n get,\r\n detect,\r\n chordScales,\r\n extended,\r\n reduced,\r\n tokenize,\r\n transpose,\r\n // deprecate\r\n chord,\r\n};\n\nexport default index;\nexport { chord, chordScales, extended, get, getChord, reduced, tokenize, transpose };\n//# sourceMappingURL=index.es.js.map\n","// source: https://en.wikipedia.org/wiki/Note_value\r\nconst DATA = [\r\n [\r\n 0.125,\r\n \"dl\",\r\n [\"large\", \"duplex longa\", \"maxima\", \"octuple\", \"octuple whole\"],\r\n ],\r\n [0.25, \"l\", [\"long\", \"longa\"]],\r\n [0.5, \"d\", [\"double whole\", \"double\", \"breve\"]],\r\n [1, \"w\", [\"whole\", \"semibreve\"]],\r\n [2, \"h\", [\"half\", \"minim\"]],\r\n [4, \"q\", [\"quarter\", \"crotchet\"]],\r\n [8, \"e\", [\"eighth\", \"quaver\"]],\r\n [16, \"s\", [\"sixteenth\", \"semiquaver\"]],\r\n [32, \"t\", [\"thirty-second\", \"demisemiquaver\"]],\r\n [64, \"sf\", [\"sixty-fourth\", \"hemidemisemiquaver\"]],\r\n [128, \"h\", [\"hundred twenty-eighth\"]],\r\n [256, \"th\", [\"two hundred fifty-sixth\"]],\r\n];\n\nconst VALUES = [];\r\nDATA.forEach(([denominator, shorthand, names]) => add(denominator, shorthand, names));\r\nconst NoDuration = {\r\n empty: true,\r\n name: \"\",\r\n value: 0,\r\n fraction: [0, 0],\r\n shorthand: \"\",\r\n dots: \"\",\r\n names: [],\r\n};\r\nfunction names() {\r\n return VALUES.reduce((names, duration) => {\r\n duration.names.forEach((name) => names.push(name));\r\n return names;\r\n }, []);\r\n}\r\nfunction shorthands() {\r\n return VALUES.map((dur) => dur.shorthand);\r\n}\r\nconst REGEX = /^([^.]+)(\\.*)$/;\r\nfunction get(name) {\r\n const [_, simple, dots] = REGEX.exec(name) || [];\r\n const base = VALUES.find((dur) => dur.shorthand === simple || dur.names.includes(simple));\r\n if (!base) {\r\n return NoDuration;\r\n }\r\n const fraction = calcDots(base.fraction, dots.length);\r\n const value = fraction[0] / fraction[1];\r\n return { ...base, name, dots, value, fraction };\r\n}\r\nconst value = (name) => get(name).value;\r\nconst fraction = (name) => get(name).fraction;\r\nvar index = { names, shorthands, get, value, fraction };\r\n//// PRIVATE ////\r\nfunction add(denominator, shorthand, names) {\r\n VALUES.push({\r\n empty: false,\r\n dots: \"\",\r\n name: \"\",\r\n value: 1 / denominator,\r\n fraction: denominator < 1 ? [1 / denominator, 1] : [1, denominator],\r\n shorthand,\r\n names,\r\n });\r\n}\r\nfunction calcDots(fraction, dots) {\r\n const pow = Math.pow(2, dots);\r\n let numerator = fraction[0] * pow;\r\n let denominator = fraction[1] * pow;\r\n const base = numerator;\r\n // add fractions\r\n for (let i = 0; i < dots; i++) {\r\n numerator += base / Math.pow(2, i + 1);\r\n }\r\n // simplify\r\n while (numerator % 2 === 0 && denominator % 2 === 0) {\r\n numerator /= 2;\r\n denominator /= 2;\r\n }\r\n return [numerator, denominator];\r\n}\n\nexport default index;\nexport { fraction, get, names, shorthands, value };\n//# sourceMappingURL=index.es.js.map\n","import { interval, distance as distance$1, coordToInterval } from '@tonaljs/core';\n\n/**\r\n * Get the natural list of names\r\n */\r\nfunction names() {\r\n return \"1P 2M 3M 4P 5P 6m 7m\".split(\" \");\r\n}\r\n/**\r\n * Get properties of an interval\r\n *\r\n * @function\r\n * @example\r\n * Interval.get('P4') // => {\"alt\": 0, \"dir\": 1, \"name\": \"4P\", \"num\": 4, \"oct\": 0, \"q\": \"P\", \"semitones\": 5, \"simple\": 4, \"step\": 3, \"type\": \"perfectable\"}\r\n */\r\nconst get = interval;\r\n/**\r\n * Get name of an interval\r\n *\r\n * @function\r\n * @example\r\n * Interval.name('4P') // => \"4P\"\r\n * Interval.name('P4') // => \"4P\"\r\n * Interval.name('C4') // => \"\"\r\n */\r\nconst name = (name) => interval(name).name;\r\n/**\r\n * Get semitones of an interval\r\n * @function\r\n * @example\r\n * Interval.semitones('P4') // => 5\r\n */\r\nconst semitones = (name) => interval(name).semitones;\r\n/**\r\n * Get quality of an interval\r\n * @function\r\n * @example\r\n * Interval.quality('P4') // => \"P\"\r\n */\r\nconst quality = (name) => interval(name).q;\r\n/**\r\n * Get number of an interval\r\n * @function\r\n * @example\r\n * Interval.num('P4') // => 4\r\n */\r\nconst num = (name) => interval(name).num;\r\n/**\r\n * Get the simplified version of an interval.\r\n *\r\n * @function\r\n * @param {string} interval - the interval to simplify\r\n * @return {string} the simplified interval\r\n *\r\n * @example\r\n * Interval.simplify(\"9M\") // => \"2M\"\r\n * Interval.simplify(\"2M\") // => \"2M\"\r\n * Interval.simplify(\"-2M\") // => \"7m\"\r\n * [\"8P\", \"9M\", \"10M\", \"11P\", \"12P\", \"13M\", \"14M\", \"15P\"].map(Interval.simplify)\r\n * // => [ \"8P\", \"2M\", \"3M\", \"4P\", \"5P\", \"6M\", \"7M\", \"8P\" ]\r\n */\r\nfunction simplify(name) {\r\n const i = interval(name);\r\n return i.empty ? \"\" : i.simple + i.q;\r\n}\r\n/**\r\n * Get the inversion (https://en.wikipedia.org/wiki/Inversion_(music)#Intervals)\r\n * of an interval.\r\n *\r\n * @function\r\n * @param {string} interval - the interval to invert in interval shorthand\r\n * notation or interval array notation\r\n * @return {string} the inverted interval\r\n *\r\n * @example\r\n * Interval.invert(\"3m\") // => \"6M\"\r\n * Interval.invert(\"2M\") // => \"7m\"\r\n */\r\nfunction invert(name) {\r\n const i = interval(name);\r\n if (i.empty) {\r\n return \"\";\r\n }\r\n const step = (7 - i.step) % 7;\r\n const alt = i.type === \"perfectable\" ? -i.alt : -(i.alt + 1);\r\n return interval({ step, alt, oct: i.oct, dir: i.dir }).name;\r\n}\r\n// interval numbers\r\nconst IN = [1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7];\r\n// interval qualities\r\nconst IQ = \"P m M m M P d P m M m M\".split(\" \");\r\n/**\r\n * Get interval name from semitones number. Since there are several interval\r\n * names for the same number, the name it's arbitrary, but deterministic.\r\n *\r\n * @param {Integer} num - the number of semitones (can be negative)\r\n * @return {string} the interval name\r\n * @example\r\n * Interval.fromSemitones(7) // => \"5P\"\r\n * Interval.fromSemitones(-7) // => \"-5P\"\r\n */\r\nfunction fromSemitones(semitones) {\r\n const d = semitones < 0 ? -1 : 1;\r\n const n = Math.abs(semitones);\r\n const c = n % 12;\r\n const o = Math.floor(n / 12);\r\n return d * (IN[c] + 7 * o) + IQ[c];\r\n}\r\n/**\r\n * Find interval between two notes\r\n *\r\n * @example\r\n * Interval.distance(\"C4\", \"G4\"); // => \"5P\"\r\n */\r\nconst distance = distance$1;\r\n/**\r\n * Adds two intervals\r\n *\r\n * @function\r\n * @param {string} interval1\r\n * @param {string} interval2\r\n * @return {string} the added interval name\r\n * @example\r\n * Interval.add(\"3m\", \"5P\") // => \"7m\"\r\n */\r\nconst add = combinator((a, b) => [a[0] + b[0], a[1] + b[1]]);\r\n/**\r\n * Returns a function that adds an interval\r\n *\r\n * @function\r\n * @example\r\n * ['1P', '2M', '3M'].map(Interval.addTo('5P')) // => [\"5P\", \"6M\", \"7M\"]\r\n */\r\nconst addTo = (interval) => (other) => add(interval, other);\r\n/**\r\n * Subtracts two intervals\r\n *\r\n * @function\r\n * @param {string} minuendInterval\r\n * @param {string} subtrahendInterval\r\n * @return {string} the substracted interval name\r\n * @example\r\n * Interval.substract('5P', '3M') // => '3m'\r\n * Interval.substract('3M', '5P') // => '-3m'\r\n */\r\nconst substract = combinator((a, b) => [a[0] - b[0], a[1] - b[1]]);\r\nvar index = {\r\n names,\r\n get,\r\n name,\r\n num,\r\n semitones,\r\n quality,\r\n fromSemitones,\r\n distance,\r\n invert,\r\n simplify,\r\n add,\r\n addTo,\r\n substract,\r\n};\r\nfunction combinator(fn) {\r\n return (a, b) => {\r\n const coordA = interval(a).coord;\r\n const coordB = interval(b).coord;\r\n if (coordA && coordB) {\r\n const coord = fn(coordA, coordB);\r\n return coordToInterval(coord).name;\r\n }\r\n };\r\n}\n\nexport default index;\nexport { add, addTo, distance, fromSemitones, get, invert, name, names, num, quality, semitones, simplify, substract };\n//# sourceMappingURL=index.es.js.map\n","import { note } from '@tonaljs/core';\n\nfunction isMidi(arg) {\r\n return +arg >= 0 && +arg <= 127;\r\n}\r\n/**\r\n * Get the note midi number (a number between 0 and 127)\r\n *\r\n * It returns undefined if not valid note name\r\n *\r\n * @function\r\n * @param {string|number} note - the note name or midi number\r\n * @return {Integer} the midi number or undefined if not valid note\r\n * @example\r\n * import { toMidi } from '@tonaljs/midi'\r\n * toMidi(\"C4\") // => 60\r\n * toMidi(60) // => 60\r\n * toMidi('60') // => 60\r\n */\r\nfunction toMidi(note$1) {\r\n if (isMidi(note$1)) {\r\n return +note$1;\r\n }\r\n const n = note(note$1);\r\n return n.empty ? null : n.midi;\r\n}\r\n/**\r\n * Get the frequency in hertzs from midi number\r\n *\r\n * @param {number} midi - the note midi number\r\n * @param {number} [tuning = 440] - A4 tuning frequency in Hz (440 by default)\r\n * @return {number} the frequency or null if not valid note midi\r\n * @example\r\n * import { midiToFreq} from '@tonaljs/midi'\r\n * midiToFreq(69) // => 440\r\n */\r\nfunction midiToFreq(midi, tuning = 440) {\r\n return Math.pow(2, (midi - 69) / 12) * tuning;\r\n}\r\nconst L2 = Math.log(2);\r\nconst L440 = Math.log(440);\r\n/**\r\n * Get the midi number from a frequency in hertz. The midi number can\r\n * contain decimals (with two digits precission)\r\n *\r\n * @param {number} frequency\r\n * @return {number}\r\n * @example\r\n * import { freqToMidi} from '@tonaljs/midi'\r\n * freqToMidi(220)); //=> 57\r\n * freqToMidi(261.62)); //=> 60\r\n * freqToMidi(261)); //=> 59.96\r\n */\r\nfunction freqToMidi(freq) {\r\n const v = (12 * (Math.log(freq) - L440)) / L2 + 69;\r\n return Math.round(v * 100) / 100;\r\n}\r\nconst SHARPS = \"C C# D D# E F F# G G# A A# B\".split(\" \");\r\nconst FLATS = \"C Db D Eb E F Gb G Ab A Bb B\".split(\" \");\r\n/**\r\n * Given a midi number, returns a note name. The altered notes will have\r\n * flats unless explicitly set with the optional `useSharps` parameter.\r\n *\r\n * @function\r\n * @param {number} midi - the midi note number\r\n * @param {Object} options = default: `{ sharps: false, pitchClass: false }`\r\n * @param {boolean} useSharps - (Optional) set to true to use sharps instead of flats\r\n * @return {string} the note name\r\n * @example\r\n * import { midiToNoteName } from '@tonaljs/midi'\r\n * midiToNoteName(61) // => \"Db4\"\r\n * midiToNoteName(61, { pitchClass: true }) // => \"Db\"\r\n * midiToNoteName(61, { sharps: true }) // => \"C#4\"\r\n * midiToNoteName(61, { pitchClass: true, sharps: true }) // => \"C#\"\r\n * // it rounds to nearest note\r\n * midiToNoteName(61.7) // => \"D4\"\r\n */\r\nfunction midiToNoteName(midi, options = {}) {\r\n if (isNaN(midi) || midi === -Infinity || midi === Infinity)\r\n return \"\";\r\n midi = Math.round(midi);\r\n const pcs = options.sharps === true ? SHARPS : FLATS;\r\n const pc = pcs[midi % 12];\r\n if (options.pitchClass) {\r\n return pc;\r\n }\r\n const o = Math.floor(midi / 12) - 1;\r\n return pc + o;\r\n}\r\nvar index = { isMidi, toMidi, midiToFreq, midiToNoteName, freqToMidi };\n\nexport default index;\nexport { freqToMidi, isMidi, midiToFreq, midiToNoteName, toMidi };\n//# sourceMappingURL=index.es.js.map\n","import { note, transpose as transpose$1, coordToNote } from '@tonaljs/core';\nimport { midiToNoteName, freqToMidi } from '@tonaljs/midi';\n\nconst NAMES = [\"C\", \"D\", \"E\", \"F\", \"G\", \"A\", \"B\"];\r\nconst toName = (n) => n.name;\r\nconst onlyNotes = (array) => array.map(note).filter((n) => !n.empty);\r\n/**\r\n * Return the natural note names without octave\r\n * @function\r\n * @example\r\n * Note.names(); // => [\"C\", \"D\", \"E\", \"F\", \"G\", \"A\", \"B\"]\r\n */\r\nfunction names(array) {\r\n if (array === undefined) {\r\n return NAMES.slice();\r\n }\r\n else if (!Array.isArray(array)) {\r\n return [];\r\n }\r\n else {\r\n return onlyNotes(array).map(toName);\r\n }\r\n}\r\n/**\r\n * Get a note from a note name\r\n *\r\n * @function\r\n * @example\r\n * Note.get('Bb4') // => { name: \"Bb4\", midi: 70, chroma: 10, ... }\r\n */\r\nconst get = note;\r\n/**\r\n * Get the note name\r\n * @function\r\n */\r\nconst name = (note) => get(note).name;\r\n/**\r\n * Get the note pitch class name\r\n * @function\r\n */\r\nconst pitchClass = (note) => get(note).pc;\r\n/**\r\n * Get the note accidentals\r\n * @function\r\n */\r\nconst accidentals = (note) => get(note).acc;\r\n/**\r\n * Get the note octave\r\n * @function\r\n */\r\nconst octave = (note) => get(note).oct;\r\n/**\r\n * Get the note midi\r\n * @function\r\n */\r\nconst midi = (note) => get(note).midi;\r\n/**\r\n * Get the note midi\r\n * @function\r\n */\r\nconst freq = (note) => get(note).freq;\r\n/**\r\n * Get the note chroma\r\n * @function\r\n */\r\nconst chroma = (note) => get(note).chroma;\r\n/**\r\n * Given a midi number, returns a note name. Uses flats for altered notes.\r\n *\r\n * @function\r\n * @param {number} midi - the midi note number\r\n * @return {string} the note name\r\n * @example\r\n * Note.fromMidi(61) // => \"Db4\"\r\n * Note.fromMidi(61.7) // => \"D4\"\r\n */\r\nfunction fromMidi(midi) {\r\n return midiToNoteName(midi);\r\n}\r\n/**\r\n * Given a midi number, returns a note name. Uses flats for altered notes.\r\n */\r\nfunction fromFreq(freq) {\r\n return midiToNoteName(freqToMidi(freq));\r\n}\r\n/**\r\n * Given a midi number, returns a note name. Uses flats for altered notes.\r\n */\r\nfunction fromFreqSharps(freq) {\r\n return midiToNoteName(freqToMidi(freq), { sharps: true });\r\n}\r\n/**\r\n * Given a midi number, returns a note name. Uses flats for altered notes.\r\n *\r\n * @function\r\n * @param {number} midi - the midi note number\r\n * @return {string} the note name\r\n * @example\r\n * Note.fromMidiSharps(61) // => \"C#4\"\r\n */\r\nfunction fromMidiSharps(midi) {\r\n return midiToNoteName(midi, { sharps: true });\r\n}\r\n/**\r\n * Transpose a note by an interval\r\n */\r\nconst transpose = transpose$1;\r\nconst tr = transpose$1;\r\n/**\r\n * Transpose by an interval.\r\n * @function\r\n * @param {string} interval\r\n * @return {function} a function that transposes by the given interval\r\n * @example\r\n * [\"C\", \"D\", \"E\"].map(Note.transposeBy(\"5P\"));\r\n * // => [\"G\", \"A\", \"B\"]\r\n */\r\nconst transposeBy = (interval) => (note) => transpose(note, interval);\r\nconst trBy = transposeBy;\r\n/**\r\n * Transpose from a note\r\n * @function\r\n * @param {string} note\r\n * @return {function} a function that transposes the the note by an interval\r\n * [\"1P\", \"3M\", \"5P\"].map(Note.transposeFrom(\"C\"));\r\n * // => [\"C\", \"E\", \"G\"]\r\n */\r\nconst transposeFrom = (note) => (interval) => transpose(note, interval);\r\nconst trFrom = transposeFrom;\r\n/**\r\n * Transpose a note by a number of perfect fifths.\r\n *\r\n * @function\r\n * @param {string} note - the note name\r\n * @param {number} fifhts - the number of fifths\r\n * @return {string} the transposed note name\r\n *\r\n * @example\r\n * import { transposeFifths } from \"@tonaljs/note\"\r\n * transposeFifths(\"G4\", 1) // => \"D\"\r\n * [0, 1, 2, 3, 4].map(fifths => transposeFifths(\"C\", fifths)) // => [\"C\", \"G\", \"D\", \"A\", \"E\"]\r\n */\r\nfunction transposeFifths(noteName, fifths) {\r\n const note = get(noteName);\r\n if (note.empty) {\r\n return \"\";\r\n }\r\n const [nFifths, nOcts] = note.coord;\r\n const transposed = nOcts === undefined\r\n ? coordToNote([nFifths + fifths])\r\n : coordToNote([nFifths + fifths, nOcts]);\r\n return transposed.name;\r\n}\r\nconst trFifths = transposeFifths;\r\nconst ascending = (a, b) => a.height - b.height;\r\nconst descending = (a, b) => b.height - a.height;\r\nfunction sortedNames(notes, comparator) {\r\n comparator = comparator || ascending;\r\n return onlyNotes(notes).sort(comparator).map(toName);\r\n}\r\nfunction sortedUniqNames(notes) {\r\n return sortedNames(notes, ascending).filter((n, i, a) => i === 0 || n !== a[i - 1]);\r\n}\r\n/**\r\n * Simplify a note\r\n *\r\n * @function\r\n * @param {string} note - the note to be simplified\r\n * - sameAccType: default true. Use same kind of accidentals that source\r\n * @return {string} the simplified note or '' if not valid note\r\n * @example\r\n * simplify(\"C##\") // => \"D\"\r\n * simplify(\"C###\") // => \"D#\"\r\n * simplify(\"C###\")\r\n * simplify(\"B#4\") // => \"C5\"\r\n */\r\nconst simplify = nameBuilder(true);\r\n/**\r\n * Get enharmonic of a note\r\n *\r\n * @function\r\n * @param {string} note\r\n * @return {string} the enharmonic note or '' if not valid note\r\n * @example\r\n * Note.enharmonic(\"Db\") // => \"C#\"\r\n * Note.enharmonic(\"C\") // => \"C\"\r\n */\r\nconst enharmonic = nameBuilder(false);\r\nfunction nameBuilder(sameAccidentals) {\r\n return (noteName) => {\r\n const note = get(noteName);\r\n if (note.empty) {\r\n return \"\";\r\n }\r\n const sharps = sameAccidentals ? note.alt > 0 : note.alt < 0;\r\n const pitchClass = note.midi === null;\r\n return midiToNoteName(note.midi || note.chroma, { sharps, pitchClass });\r\n };\r\n}\r\nvar index = {\r\n names,\r\n get,\r\n name,\r\n pitchClass,\r\n accidentals,\r\n octave,\r\n midi,\r\n ascending,\r\n descending,\r\n sortedNames,\r\n sortedUniqNames,\r\n fromMidi,\r\n fromMidiSharps,\r\n freq,\r\n fromFreq,\r\n fromFreqSharps,\r\n chroma,\r\n transpose,\r\n tr,\r\n transposeBy,\r\n trBy,\r\n transposeFrom,\r\n trFrom,\r\n transposeFifths,\r\n trFifths,\r\n simplify,\r\n enharmonic,\r\n};\n\nexport default index;\nexport { accidentals, ascending, chroma, descending, enharmonic, freq, fromFreq, fromFreqSharps, fromMidi, fromMidiSharps, get, midi, name, names, octave, pitchClass, simplify, sortedNames, sortedUniqNames, tr, trBy, trFifths, trFrom, transpose, transposeBy, transposeFifths, transposeFrom };\n//# sourceMappingURL=index.es.js.map\n","import { isPitch, altToAcc, isNamed, deprecate, accToAlt, interval } from '@tonaljs/core';\n\nconst NoRomanNumeral = { empty: true, name: \"\", chordType: \"\" };\r\nconst cache = {};\r\n/**\r\n * Get properties of a roman numeral string\r\n *\r\n * @function\r\n * @param {string} - the roman numeral string (can have type, like: Imaj7)\r\n * @return {Object} - the roman numeral properties\r\n * @param {string} name - the roman numeral (tonic)\r\n * @param {string} type - the chord type\r\n * @param {string} num - the number (1 = I, 2 = II...)\r\n * @param {boolean} major - major or not\r\n *\r\n * @example\r\n * romanNumeral(\"VIIb5\") // => { name: \"VII\", type: \"b5\", num: 7, major: true }\r\n */\r\nfunction get(src) {\r\n return typeof src === \"string\"\r\n ? cache[src] || (cache[src] = parse(src))\r\n : typeof src === \"number\"\r\n ? get(NAMES[src] || \"\")\r\n : isPitch(src)\r\n ? fromPitch(src)\r\n : isNamed(src)\r\n ? get(src.name)\r\n : NoRomanNumeral;\r\n}\r\nconst romanNumeral = deprecate(\"RomanNumeral.romanNumeral\", \"RomanNumeral.get\", get);\r\n/**\r\n * Get roman numeral names\r\n *\r\n * @function\r\n * @param {boolean} [isMajor=true]\r\n * @return {Array<String>}\r\n *\r\n * @example\r\n * names() // => [\"I\", \"II\", \"III\", \"IV\", \"V\", \"VI\", \"VII\"]\r\n */\r\nfunction names(major = true) {\r\n return (major ? NAMES : NAMES_MINOR).slice();\r\n}\r\nfunction fromPitch(pitch) {\r\n return get(altToAcc(pitch.alt) + NAMES[pitch.step]);\r\n}\r\nconst REGEX = /^(#{1,}|b{1,}|x{1,}|)(IV|I{1,3}|VI{0,2}|iv|i{1,3}|vi{0,2})([^IViv]*)$/;\r\nfunction tokenize(str) {\r\n return (REGEX.exec(str) || [\"\", \"\", \"\", \"\"]);\r\n}\r\nconst ROMANS = \"I II III IV V VI VII\";\r\nconst NAMES = ROMANS.split(\" \");\r\nconst NAMES_MINOR = ROMANS.toLowerCase().split(\" \");\r\nfunction parse(src) {\r\n const [name, acc, roman, chordType] = tokenize(src);\r\n if (!roman) {\r\n return NoRomanNumeral;\r\n }\r\n const upperRoman = roman.toUpperCase();\r\n const step = NAMES.indexOf(upperRoman);\r\n const alt = accToAlt(acc);\r\n const dir = 1;\r\n return {\r\n empty: false,\r\n name,\r\n roman,\r\n interval: interval({ step, alt, dir }).name,\r\n acc,\r\n chordType,\r\n alt,\r\n step,\r\n major: roman === upperRoman,\r\n oct: 0,\r\n dir,\r\n };\r\n}\r\nvar index = {\r\n names,\r\n get,\r\n // deprecated\r\n romanNumeral,\r\n};\n\nexport default index;\nexport { get, names, tokenize };\n//# sourceMappingURL=index.es.js.map\n","import { transpose, altToAcc, accToAlt, note } from '@tonaljs/core';\nimport { transposeFifths } from '@tonaljs/note';\nimport { get } from '@tonaljs/roman-numeral';\n\nconst mapToScale = (scale) => (symbols, sep = \"\") => symbols.map((symbol, index) => symbol !== \"-\" ? scale[index] + sep + symbol : \"\");\r\nfunction keyScale(gradesLiteral, chordsLiteral, hfLiteral, chordScalesLiteral) {\r\n return (tonic) => {\r\n const grades = gradesLiteral.split(\" \");\r\n const intervals = grades.map((gr) => get(gr).interval || \"\");\r\n const scale = intervals.map((interval) => transpose(tonic, interval));\r\n const map = mapToScale(scale);\r\n return {\r\n tonic,\r\n grades,\r\n intervals,\r\n scale,\r\n chords: map(chordsLiteral.split(\" \")),\r\n chordsHarmonicFunction: hfLiteral.split(\" \"),\r\n chordScales: map(chordScalesLiteral.split(\",\"), \" \"),\r\n };\r\n };\r\n}\r\nconst distInFifths = (from, to) => {\r\n const f = note(from);\r\n const t = note(to);\r\n return f.empty || t.empty ? 0 : t.coord[0] - f.coord[0];\r\n};\r\nconst MajorScale = keyScale(\"I II III IV V VI VII\", \"maj7 m7 m7 maj7 7 m7 m7b5\", \"T SD T SD D T D\", \"major,dorian,phrygian,lydian,mixolydian,minor,locrian\");\r\nconst NaturalScale = keyScale(\"I II bIII IV V bVI bVII\", \"m7 m7b5 maj7 m7 m7 maj7 7\", \"T SD T SD D SD SD\", \"minor,locrian,major,dorian,phrygian,lydian,mixolydian\");\r\nconst HarmonicScale = keyScale(\"I II bIII IV V bVI VII\", \"mmaj7 m7b5 +maj7 m7 7 maj7 mo7\", \"T SD T SD D SD D\", \"harmonic minor,locrian 6,major augmented,lydian diminished,phrygian dominant,lydian #9,ultralocrian\");\r\nconst MelodicScale = keyScale(\"I II bIII IV V VI VII\", \"m6 m7 +maj7 7 7 m7b5 m7b5\", \"T SD T SD D - -\", \"melodic minor,dorian b2,lydian augmented,lydian dominant,mixolydian b6,locrian #2,altered\");\r\n/**\r\n * Get a major key properties in a given tonic\r\n * @param tonic\r\n */\r\nfunction majorKey(tonic) {\r\n const keyScale = MajorScale(tonic);\r\n const alteration = distInFifths(\"C\", tonic);\r\n const map = mapToScale(keyScale.scale);\r\n return {\r\n ...keyScale,\r\n type: \"major\",\r\n minorRelative: transpose(tonic, \"-3m\"),\r\n alteration,\r\n keySignature: altToAcc(alteration),\r\n secondaryDominants: map(\"- VI7 VII7 I7 II7 III7 -\".split(\" \")),\r\n secondaryDominantsMinorRelative: map(\"- IIIm7b5 IV#m7 Vm7 VIm7 VIIm7b5 -\".split(\" \")),\r\n substituteDominants: map(\"- bIII7 IV7 bV7 bVI7 bVII7 -\".split(\" \")),\r\n substituteDominantsMinorRelative: map(\"- IIIm7 Im7 IIbm7 VIm7 IVm7 -\".split(\" \")),\r\n };\r\n}\r\n/**\r\n * Get minor key properties in a given tonic\r\n * @param tonic\r\n */\r\nfunction minorKey(tonic) {\r\n const alteration = distInFifths(\"C\", tonic) - 3;\r\n return {\r\n type: \"minor\",\r\n tonic,\r\n relativeMajor: transpose(tonic, \"3m\"),\r\n alteration,\r\n keySignature: altToAcc(alteration),\r\n natural: NaturalScale(tonic),\r\n harmonic: HarmonicScale(tonic),\r\n melodic: MelodicScale(tonic),\r\n };\r\n}\r\n/**\r\n * Given a key signature, returns the tonic of the major key\r\n * @param sigature\r\n * @example\r\n * majorTonicFromKeySignature('###') // => 'A'\r\n */\r\nfunction majorTonicFromKeySignature(sig) {\r\n if (typeof sig === \"number\") {\r\n return transposeFifths(\"C\", sig);\r\n }\r\n else if (typeof sig === \"string\" && /^b+|#+$/.test(sig)) {\r\n return transposeFifths(\"C\", accToAlt(sig));\r\n }\r\n return null;\r\n}\r\nvar index = { majorKey, majorTonicFromKeySignature, minorKey };\n\nexport default index;\nexport { majorKey, majorTonicFromKeySignature, minorKey };\n//# sourceMappingURL=index.es.js.map\n","import { deprecate } from '@tonaljs/core';\nimport { chromaToIntervals, EmptyPcset } from '@tonaljs/pcset';\n\nconst DATA = [\r\n [0, 2773, 0, \"ionian\", \"\", \"Maj7\", \"major\"],\r\n [1, 2902, 2, \"dorian\", \"m\", \"m7\"],\r\n [2, 3418, 4, \"phrygian\", \"m\", \"m7\"],\r\n [3, 2741, -1, \"lydian\", \"\", \"Maj7\"],\r\n [4, 2774, 1, \"mixolydian\", \"\", \"7\"],\r\n [5, 2906, 3, \"aeolian\", \"m\", \"m7\", \"minor\"],\r\n [6, 3434, 5, \"locrian\", \"dim\", \"m7b5\"],\r\n];\n\nconst NoMode = {\r\n ...EmptyPcset,\r\n name: \"\",\r\n alt: 0,\r\n modeNum: NaN,\r\n triad: \"\",\r\n seventh: \"\",\r\n aliases: [],\r\n};\r\nconst modes = DATA.map(toMode);\r\nconst index = {};\r\nmodes.forEach((mode) => {\r\n index[mode.name] = mode;\r\n mode.aliases.forEach((alias) => {\r\n index[alias] = mode;\r\n });\r\n});\r\n/**\r\n * Get a Mode by it's name\r\n *\r\n * @example\r\n * get('dorian')\r\n * // =>\r\n * // {\r\n * // intervals: [ '1P', '2M', '3m', '4P', '5P', '6M', '7m' ],\r\n * // modeNum: 1,\r\n * // chroma: '101101010110',\r\n * // normalized: '101101010110',\r\n * // name: 'dorian',\r\n * // setNum: 2902,\r\n * // alt: 2,\r\n * // triad: 'm',\r\n * // seventh: 'm7',\r\n * // aliases: []\r\n * // }\r\n */\r\nfunction get(name) {\r\n return typeof name === \"string\"\r\n ? index[name.toLowerCase()] || NoMode\r\n : name && name.name\r\n ? get(name.name)\r\n : NoMode;\r\n}\r\nconst mode = deprecate(\"Mode.mode\", \"Mode.get\", get);\r\n/**\r\n * Get a list of all modes\r\n */\r\nfunction all() {\r\n return modes.slice();\r\n}\r\nconst entries = deprecate(\"Mode.mode\", \"Mode.all\", all);\r\n/**\r\n * Get a list of all mode names\r\n */\r\nfunction names() {\r\n return modes.map((mode) => mode.name);\r\n}\r\nfunction toMode(mode) {\r\n const [modeNum, setNum, alt, name, triad, seventh, alias] = mode;\r\n const aliases = alias ? [alias] : [];\r\n const chroma = Number(setNum).toString(2);\r\n const intervals = chromaToIntervals(chroma);\r\n return {\r\n empty: false,\r\n intervals,\r\n modeNum,\r\n chroma,\r\n normalized: chroma,\r\n name,\r\n setNum,\r\n alt,\r\n triad,\r\n seventh,\r\n aliases,\r\n };\r\n}\r\nvar index$1 = {\r\n get,\r\n names,\r\n all,\r\n // deprecated\r\n entries,\r\n mode,\r\n};\n\nexport default index$1;\nexport { all, entries, get, mode, names };\n//# sourceMappingURL=index.es.js.map\n","import { all } from '@tonaljs/chord-type';\nimport { rotate, range } from '@tonaljs/collection';\nimport { note, transpose, deprecate } from '@tonaljs/core';\nimport { sortedUniqNames } from '@tonaljs/note';\nimport { isSubsetOf, isSupersetOf, modes } from '@tonaljs/pcset';\nimport { names as names$1, get as get$1, all as all$1 } from '@tonaljs/scale-type';\n\n/**\r\n * References:\r\n * - https://www.researchgate.net/publication/327567188_An_Algorithm_for_Spelling_the_Pitches_of_Any_Musical_Scale\r\n * @module scale\r\n */\r\nconst NoScale = {\r\n empty: true,\r\n name: \"\",\r\n type: \"\",\r\n tonic: null,\r\n setNum: NaN,\r\n chroma: \"\",\r\n normalized: \"\",\r\n aliases: [],\r\n notes: [],\r\n intervals: [],\r\n};\r\n/**\r\n * Given a string with a scale name and (optionally) a tonic, split\r\n * that components.\r\n *\r\n * It retuns an array with the form [ name, tonic ] where tonic can be a\r\n * note name or null and name can be any arbitrary string\r\n * (this function doesn\"t check if that scale name exists)\r\n *\r\n * @function\r\n * @param {string} name - the scale name\r\n * @return {Array} an array [tonic, name]\r\n * @example\r\n * tokenize(\"C mixolydean\") // => [\"C\", \"mixolydean\"]\r\n * tokenize(\"anything is valid\") // => [\"\", \"anything is valid\"]\r\n * tokenize() // => [\"\", \"\"]\r\n */\r\nfunction tokenize(name) {\r\n if (typeof name !== \"string\") {\r\n return [\"\", \"\"];\r\n }\r\n const i = name.indexOf(\" \");\r\n const tonic = note(name.substring(0, i));\r\n if (tonic.empty) {\r\n const n = note(name);\r\n return n.empty ? [\"\", name] : [n.name, \"\"];\r\n }\r\n const type = name.substring(tonic.name.length + 1);\r\n return [tonic.name, type.length ? type : \"\"];\r\n}\r\n/**\r\n * Get all scale names\r\n * @function\r\n */\r\nconst names = names$1;\r\n/**\r\n * Get a Scale from a scale name.\r\n */\r\nfunction get(src) {\r\n const tokens = Array.isArray(src) ? src : tokenize(src);\r\n const tonic = note(tokens[0]).name;\r\n const st = get$1(tokens[1]);\r\n if (st.empty) {\r\n return NoScale;\r\n }\r\n const type = st.name;\r\n const notes = tonic\r\n ? st.intervals.map((i) => transpose(tonic, i))\r\n : [];\r\n const name = tonic ? tonic + \" \" + type : type;\r\n return { ...st, name, type, tonic, notes };\r\n}\r\nconst scale = deprecate(\"Scale.scale\", \"Scale.get\", get);\r\n/**\r\n * Get all chords that fits a given scale\r\n *\r\n * @function\r\n * @param {string} name - the scale name\r\n * @return {Array<string>} - the chord names\r\n *\r\n * @example\r\n * scaleChords(\"pentatonic\") // => [\"5\", \"64\", \"M\", \"M6\", \"Madd9\", \"Msus2\"]\r\n */\r\nfunction scaleChords(name) {\r\n const s = get(name);\r\n const inScale = isSubsetOf(s.chroma);\r\n return all()\r\n .filter((chord) => inScale(chord.chroma))\r\n .map((chord) => chord.aliases[0]);\r\n}\r\n/**\r\n * Get all scales names that are a superset of the given one\r\n * (has the same notes and at least one more)\r\n *\r\n * @function\r\n * @param {string} name\r\n * @return {Array} a list of scale names\r\n * @example\r\n * extended(\"major\") // => [\"bebop\", \"bebop dominant\", \"bebop major\", \"chromatic\", \"ichikosucho\"]\r\n */\r\nfunction extended(name) {\r\n const s = get(name);\r\n const isSuperset = isSupersetOf(s.chroma);\r\n return all$1()\r\n .filter((scale) => isSuperset(scale.chroma))\r\n .map((scale) => scale.name);\r\n}\r\n/**\r\n * Find all scales names that are a subset of the given one\r\n * (has less notes but all from the given scale)\r\n *\r\n * @function\r\n * @param {string} name\r\n * @return {Array} a list of scale names\r\n *\r\n * @example\r\n * reduced(\"major\") // => [\"ionian pentatonic\", \"major pentatonic\", \"ritusen\"]\r\n */\r\nfunction reduced(name) {\r\n const isSubset = isSubsetOf(get(name).chroma);\r\n return all$1()\r\n .filter((scale) => isSubset(scale.chroma))\r\n .map((scale) => scale.name);\r\n}\r\n/**\r\n * Given an array of notes, return the scale: a pitch class set starting from\r\n * the first note of the array\r\n *\r\n * @function\r\n * @param {string[]} notes\r\n * @return {string[]} pitch classes with same tonic\r\n * @example\r\n * scaleNotes(['C4', 'c3', 'C5', 'C4', 'c4']) // => [\"C\"]\r\n * scaleNotes(['D4', 'c#5', 'A5', 'F#6']) // => [\"D\", \"F#\", \"A\", \"C#\"]\r\n */\r\nfunction scaleNotes(notes) {\r\n const pcset = notes.map((n) => note(n).pc).filter((x) => x);\r\n const tonic = pcset[0];\r\n const scale = sortedUniqNames(pcset);\r\n return rotate(scale.indexOf(tonic), scale);\r\n}\r\n/**\r\n * Find mode names of a scale\r\n *\r\n * @function\r\n * @param {string} name - scale name\r\n * @example\r\n * modeNames(\"C pentatonic\") // => [\r\n * [\"C\", \"major pentatonic\"],\r\n * [\"D\", \"egyptian\"],\r\n * [\"E\", \"malkos raga\"],\r\n * [\"G\", \"ritusen\"],\r\n * [\"A\", \"minor pentatonic\"]\r\n * ]\r\n */\r\nfunction modeNames(name) {\r\n const s = get(name);\r\n if (s.empty) {\r\n return [];\r\n }\r\n const tonics = s.tonic ? s.notes : s.intervals;\r\n return modes(s.chroma)\r\n .map((chroma, i) => {\r\n const modeName = get(chroma).name;\r\n return modeName ? [tonics[i], modeName] : [\"\", \"\"];\r\n })\r\n .filter((x) => x[0]);\r\n}\r\nfunction getNoteNameOf(scale) {\r\n const names = Array.isArray(scale) ? scaleNotes(scale) : get(scale).notes;\r\n const chromas = names.map((name) => note(name).chroma);\r\n return (noteOrMidi) => {\r\n const height = typeof noteOrMidi === \"number\" ? noteOrMidi : note(noteOrMidi).height;\r\n if (height === undefined)\r\n return undefined;\r\n const chroma = height % 12;\r\n const oct = Math.floor(height / 12) - 1;\r\n const position = chromas.indexOf(chroma);\r\n if (position === -1)\r\n return undefined;\r\n return names[position] + oct;\r\n };\r\n}\r\nfunction rangeOf(scale) {\r\n const getName = getNoteNameOf(scale);\r\n return (fromNote, toNote) => {\r\n const from = note(fromNote).height;\r\n const to = note(toNote).height;\r\n if (from === undefined || to === undefined)\r\n return [];\r\n return range(from, to)\r\n .map(getName)\r\n .filter((x) => x);\r\n };\r\n}\r\nvar index = {\r\n get,\r\n names,\r\n extended,\r\n modeNames,\r\n reduced,\r\n scaleChords,\r\n scaleNotes,\r\n tokenize,\r\n rangeOf,\r\n // deprecated\r\n scale,\r\n};\n\nexport default index;\nexport { extended, get, modeNames, names, rangeOf, reduced, scale, scaleChords, scaleNotes, tokenize };\n//# sourceMappingURL=index.es.js.map\n","// eslint-disable-next-line\n/// <reference types=\"webmidi\" />\nimport webmidi, {\n WebMidi,\n Input,\n Output,\n IEventNote,\n InputEventNoteoff,\n InputEventNoteon,\n} from 'webmidi';\nimport { Note, Interval } from '@tonaljs/tonal';\nimport { alertUser } from '@vue-skuilder/common-ui';\nimport { Status } from '@vue-skuilder/common';\nimport { UserDBInterface } from '@vue-skuilder/db';\n// import Navigator from '@types/webmidi';\n\nexport interface NoteEvent {\n note: IEventNote;\n velocity: number;\n timestamp: number;\n type: 'noteon' | 'noteoff';\n}\n\nfunction transpose(note: NoteEvent, semitones: number): NoteEvent {\n const ret: NoteEvent = { ...note };\n const transposedNote = Note.transpose(\n note.note.name + note.note.octave,\n Interval.fromSemitones(semitones)\n );\n\n ret.note = {\n name: Note.pitchClass(transposedNote),\n number: note.note.number + semitones,\n octave: Note.octave(transposedNote)!,\n };\n return ret;\n}\n\nexport function transposeSyllableSeq(notes: NoteEvent[], semitones: number) {\n return notes.map((n) => transpose(n, semitones));\n}\n\nexport function eventsToSyllableSequence(midi: NoteEvent[]): SyllableSequence {\n const syllables: Syllable[] = [];\n midi = midi.filter((e) => e.type === 'noteon').sort((a, b) => a.timestamp - b.timestamp);\n\n for (let chordSize = 10; chordSize > 0; chordSize--) {\n for (let i = 0; i < midi.length - chordSize + 1; i++) {\n try {\n syllables.push(new Syllable(midi.slice(i, i + chordSize)));\n // if a chordSized syllable has been created, remove these notes from\n // the 'to be parsed' pile\n midi.splice(i, chordSize);\n // and reset the 'parse from the beginning' index so that\n // the new midi[0] is not passed over\n i = -1;\n } catch {\n // console.log(`awef`);\n }\n }\n }\n\n return new SyllableSequence(syllables);\n}\n\nexport class SyllableSequence {\n syllables: Syllable[];\n rootNote: IEventNote;\n\n append(e: NoteEvent) {\n if (this.syllables.length) {\n try {\n const amendedLastSyllable = new Syllable(\n this.syllables[this.syllables.length - 1].notes\n .map((note) => {\n return {\n note: note.note,\n timestamp: note.timestamp,\n type: note.type,\n velocity: note.velocity,\n };\n })\n .concat(e)\n );\n this.syllables.splice(this.syllables.length - 1, 1, amendedLastSyllable);\n } catch {\n this.syllables.push(new Syllable([e]));\n }\n } else {\n this.syllables.push(new Syllable([e]));\n this.rootNote = e.note;\n }\n }\n\n /**\n *\n */\n constructor(syllables: Syllable[]) {\n if (syllables.length > 0) {\n this.syllables = syllables.sort((a, b) => {\n return a.timestamp - b.timestamp;\n });\n this.rootNote = this.syllables[0].notes.reduce((lowest, current) => {\n return current.note.number < lowest.note.number ? current : lowest;\n }).note;\n } else {\n this.syllables = [];\n this.rootNote = {\n name: 'C',\n octave: 4,\n number: 0,\n };\n }\n }\n\n public grade(answer: SyllableSequence): SyllableSequence {\n const ret: Syllable[] = [];\n\n for (let i = 0; i < this.syllables.length; i++) {\n ret.push(this.syllables[i].grade(answer.syllables[i]));\n }\n\n return new SyllableSequence(ret);\n }\n\n public toString(): string {\n let ret = '';\n this.syllables.forEach((s, i) => {\n ret += `Syllable ${i + 1}: {\\n`;\n s.notes.forEach((n) => {\n ret += `\\t${n.note.name}\\t${n.note.number}\\t${n.timestamp} ${\n n.isCorrect ? '' : '(incorrect)'\n } ${n.isMissing ? '(missing)' : ''}\\n`;\n });\n ret += `} - ${s.timestamp}, correct: ${s.isCorrect}\\n`;\n });\n return ret;\n }\n\n public isCorrect(): boolean {\n let ret = true;\n this.syllables.forEach((s) => {\n if (s.isCorrect === false) {\n ret = false;\n } else {\n s.notes.forEach((n) => {\n if (n.isCorrect === false) {\n ret = false;\n }\n });\n }\n });\n return ret;\n }\n}\n\nclass Syllable {\n notes: (NoteEvent & {\n isCorrect: boolean;\n isMissing: boolean;\n })[];\n isCorrect: boolean | undefined;\n\n get timestamp(): number {\n let timestamp = 0;\n this.notes.forEach((n) => {\n if (n.timestamp === 0) {\n return 0;\n } else {\n timestamp += n.timestamp;\n }\n });\n timestamp /= this.notes.length;\n return timestamp;\n }\n\n /**\n *\n */\n constructor(notes: NoteEvent[]) {\n notes = notes.filter((note) => {\n return note.type === 'noteon';\n });\n\n const minTimestamp = notes.reduce((min, current) => {\n if (min.timestamp < current.timestamp) {\n return min;\n } else {\n return current;\n }\n });\n const maxTimestamp = notes.reduce((max, current) => {\n if (max.timestamp > current.timestamp) {\n return max;\n } else {\n return current;\n }\n });\n const timespan = maxTimestamp.timestamp - minTimestamp.timestamp;\n\n if (Syllable.gracePeriod(notes.length) < timespan) {\n throw new Error(`Notes ${notes.toString()} are not close enough together to be a syllable`);\n } else {\n this.notes = notes\n .map((note) => {\n return {\n ...note,\n isCorrect: true,\n isMissing: false,\n };\n })\n .sort((a, b) => {\n return a.note.number - b.note.number;\n });\n }\n }\n\n /**\n * Returns the size of a timespan (in ms) that\n * a n-note chord must be contained within\n * @param n number of notes\n */\n private static gracePeriod(n: number): number {\n const sequentialEventsLowerBound = 12; // milliseconds\n return 1.3 * sequentialEventsLowerBound * n;\n }\n\n public grade(answer: Syllable /*, refNote?: IEventNote */): Syllable {\n // const ref =\n // refNote ||\n // this.notes.sort((a, b) => {\n // return a.note.number - b.note.number;\n // })[0];\n\n if (this.notes.length !== answer.notes.length) {\n answer.isCorrect = false;\n }\n\n answer.notes.forEach((studentNote) => {\n let fNote = Note.fromMidi(studentNote.note.number);\n let sNote = Note.fromMidiSharps(studentNote.note.number);\n\n fNote = Note.pitchClass(fNote);\n sNote = Note.pitchClass(sNote);\n\n studentNote.isCorrect =\n this.notes.filter(\n (note) =>\n Note.chroma(fNote) === Note.chroma(note.note.name) ||\n Note.chroma(sNote) === Note.chroma(note.note.name)\n ).length >= 1;\n if (!studentNote.isCorrect) {\n answer.isCorrect = false;\n }\n });\n\n this.notes.forEach((note) => {\n let fNote = Note.fromMidi(note.note.number);\n // let sNote = Note.fromMidiSharps(note.note.number);\n\n fNote = Note.pitchClass(fNote);\n // sNote = Note.pitchClass(sNote);\n\n if (\n !answer.notes.some(\n (studentNote) => Note.chroma(studentNote.note.name) === Note.chroma(fNote)\n )\n ) {\n answer.notes.push({\n ...note,\n isMissing: true,\n isCorrect: false,\n });\n }\n });\n\n return answer;\n }\n}\n\nclass SkMidi {\n private static _instance: SkMidi;\n\n /**\n * OFFSET is used to push all playback events (noteon, note off)\n * forward by OFFSET milliseconds. This is to prevent a\n * 'stutter' effect between the first and second syllables\n * when the time between them is small. (noteon at ~0 ms suffers\n * from a latency effect, while other timestamps don't).\n */\n static readonly OFFSET: number = 5;\n\n public recording: NoteEvent[] = [];\n\n private webmidi: WebMidi = webmidi;\n private input: Input | undefined;\n private output: Output | undefined;\n private _noteonListeners: ((e: InputEventNoteon) => void)[] = [];\n private _noteoffListeners: ((e: InputEventNoteoff) => void)[] = [];\n\n private static _initializedWithUserConfig = false;\n\n private midiAccess: WebMidi.MIDIAccess | undefined;\n\n private _state: 'nodevice' | 'notsupported' | 'ready' | 'initializing' = 'initializing';\n public get state() {\n return this._state;\n }\n\n private _userLookup: (() => Promise<UserDBInterface>) | null;\n\n private constructor(userLookup?: () => Promise<UserDBInterface>) {\n this._userLookup = userLookup ?? null;\n }\n\n private async init(): Promise<boolean> {\n if (!this.midiAccess) {\n try {\n navigator.requestMIDIAccess().then((access) => {\n this.midiAccess = access;\n this.midiAccess.onstatechange = (e) => {\n alertUser({\n text: `Midi device ${e.port.name} is ${e.port.state}`,\n status: e.port.state === 'connected' ? Status.ok : Status.error,\n });\n };\n });\n } catch (e) {\n console.log(`Webmidi not enabled: ${e}`);\n this._state = 'notsupported';\n }\n }\n\n try {\n this.webmidi.disable();\n } catch (e) {\n console.log(`Webmidi not enabled: ${e}`);\n this._state = 'notsupported';\n }\n\n return new Promise<boolean>((resolve, reject) => {\n this.webmidi.enable(async (err) => {\n if (err) {\n this._state = 'notsupported';\n console.log(`Webmidi not enabled: ${err}`);\n // setTimeout(this.init, 2000);\n reject(err);\n } else {\n console.log(`Webmidi enabled`);\n\n // Viewing available inputs and outputs\n console.log(`Inputs: ${JSON.stringify(this.webmidi.inputs)}`);\n console.log(`Outputs: ${JSON.stringify(this.webmidi.outputs)}`);\n\n // set defaults first\n this.output = this.webmidi.outputs[0];\n this.input = this.webmidi.inputs[0];\n\n // but try to load configurfed devices\n if (!SkMidi._initializedWithUserConfig) {\n await this.loadUserConfiguration();\n SkMidi._initializedWithUserConfig = true;\n }\n\n if (this.input && this.output) {\n console.log('midi init state: ready');\n this._state = 'ready';\n this.attachListeners();\n } else {\n console.log('midi init state: nodevice');\n\n this._state = 'nodevice';\n }\n\n resolve(true);\n }\n });\n });\n }\n\n private async loadUserConfiguration(): Promise<void> {\n try {\n if (!this._userLookup) {\n console.log('User lookup function not provided - using default MIDI configuration');\n return;\n }\n\n const user = await this._userLookup();\n\n if (!user) {\n console.log('No user found, using default MIDI configuration');\n return;\n }\n\n // Get all course settings that might have MIDI configurations\n const courses = await user.getActiveCourses();\n for (const course of courses) {\n const cdb = await user.getCourseInterface(course.courseID);\n const settings = await cdb.getCourseSettings();\n if (settings?.midiinput || settings?.midioutput) {\n // We found MIDI settings, use the first valid ones\n if (settings.midiinput && this.webmidi.getInputById(settings.midiinput.toString())) {\n this.selectInput(settings.midiinput.toString());\n console.log(`Loaded saved MIDI input: ${settings.midiinput}`);\n }\n\n if (settings.midioutput && this.webmidi.getOutputById(settings.midioutput.toString())) {\n this.selectOutput(settings.midioutput.toString());\n console.log(`Loaded saved MIDI output: ${settings.midioutput}`);\n }\n\n // Once we've found and applied settings, we can stop searching\n break;\n }\n }\n } catch (error) {\n console.error('Failed to load user MIDI configuration:', error);\n }\n }\n\n public setStateChangeListener(f: () => void) {\n if (!this.midiAccess) {\n try {\n navigator.requestMIDIAccess().then((access) => {\n this.midiAccess = access;\n this.midiAccess.onstatechange = (e) => {\n this.init().then(() => {\n console.log(`Midi state: ${this.state}`);\n f();\n });\n alertUser({\n text: `Midi device ${e.port.name} is ${e.port.state}`,\n status: e.port.state === 'connected' ? Status.ok : Status.error,\n });\n };\n });\n } catch (e) {\n console.log(`Webmidi not enabled: ${e}`);\n this._state = 'notsupported';\n }\n } else {\n this.midiAccess.onstatechange = (e) => {\n this.init().then(() => {\n console.log(`Midi state: ${this.state}`);\n f();\n });\n alertUser({\n text: `Midi device ${e.port.name} is ${e.port.state}`,\n status: e.port.state === 'connected' ? Status.ok : Status.error,\n });\n };\n }\n }\n\n private attachListeners() {\n if (this.input) {\n this._noteonListeners.forEach((f) => {\n this.input?.on('noteon', 'all', f);\n });\n this._noteoffListeners.forEach((f) => {\n this.input?.on('noteoff', 'all', f);\n });\n }\n }\n\n public get hasRecording(): boolean {\n return this.record.length > 0;\n }\n\n public get configuredInput(): string {\n if (this.input) {\n return `${this.input.manufacturer}: ${this.input.name}`;\n } else {\n return '(Not Sure!)';\n }\n }\n\n public eraseRecording() {\n this.recording = [];\n }\n\n public stopRecording() {\n this.input?.removeListener();\n }\n\n public record() {\n let initTimestamp: number = 0;\n\n if (this.input === undefined) {\n throw new Error(`Midi input not configured!`);\n }\n if (this.input.connection === 'open') {\n // remove previously attached listeners\n this.stopRecording();\n // clear previously recorded data\n this.eraseRecording();\n\n this.input.on('noteon', 'all', (e) => {\n if (this.recording.length === 0) {\n initTimestamp = e.timestamp;\n }\n // console.log(`${e.note.name} - time: ${e.timestamp}`);\n this.recording.push({\n note: e.note,\n type: e.type,\n velocity: e.velocity,\n timestamp: e.timestamp - initTimestamp,\n });\n });\n this.input.on('noteoff', 'all', (e) => {\n if (this.recording.length === 0) {\n initTimestamp = e.timestamp;\n }\n // console.log(e.note.name + ' off');\n this.recording.push({\n note: e.note,\n velocity: e.velocity,\n type: e.type,\n timestamp: e.timestamp - initTimestamp,\n });\n });\n }\n }\n\n public addNoteonListenter(f: (e: InputEventNoteon) => void) {\n this._noteonListeners.push(f);\n if (this.input) {\n this.input.on('noteon', 'all', f);\n }\n }\n public addNoteoffListenter(f: (e: InputEventNoteoff) => void) {\n this._noteoffListeners.push(f);\n if (this.input) {\n this.input.on('noteoff', 'all', f);\n }\n }\n\n public play(recording?: NoteEvent[]) {\n let playbackData: NoteEvent[] = recording ? recording : this.recording;\n playbackData = playbackData.map((e) => {\n return {\n ...e,\n timestamp: e.timestamp + SkMidi.OFFSET,\n };\n });\n\n playbackData.forEach((e) => {\n if (e.type === 'noteon') {\n this.output?.playNote(e.note.name + e.note.octave, 1, {\n velocity: e.velocity,\n time: `+${e.timestamp}`,\n rawVelocity: false,\n });\n } else {\n this.output?.stopNote(e.note.name + e.note.octave, 1, {\n velocity: e.velocity,\n time: `+${e.timestamp}`,\n rawVelocity: false,\n });\n }\n });\n }\n\n public static async instance(): Promise<SkMidi> {\n if (SkMidi._instance) {\n return SkMidi._instance;\n } else {\n console.log(`Buzz, whirr, Midi instance factory is at work`);\n SkMidi._instance = new SkMidi();\n await SkMidi._instance.init();\n return SkMidi._instance;\n }\n }\n\n public get inputs(): Input[] {\n return this.webmidi.inputs;\n }\n public get outputs(): Output[] {\n return this.webmidi.outputs;\n }\n\n public selectInput(id: string): void {\n if (this.webmidi.getInputById(id) !== false) {\n this.input = this.webmidi.getInputById(id) as Input;\n } else if (this.webmidi.getInputByName(id) !== false) {\n this.input = this.webmidi.getInputByName(id) as Input;\n }\n }\n\n public selectOutput(id: string): void {\n if (this.webmidi.getOutputById(id) !== false) {\n this.output = this.webmidi.getOutputById(id) as Output;\n } else if (this.webmidi.getOutputByName(id) !== false) {\n this.output = this.webmidi.getOutputByName(id) as Output;\n }\n }\n}\n\nexport default SkMidi;\n","<template>\n <div>\n <svg :width=\"510\" :height=\"Math.max(3 * (high - low) + 10, 0)\">\n <template v-for=\"syl in seq.syllables\">\n <template v-for=\"note in syl.notes\" :key=\"syl.timestamp + '-' + note.note.number\">\n <circle\n :cx=\"((syl.timestamp - firstTS) * 500) / (lastTS - firstTS) + 4\"\n :cy=\"3 * (high - note.note.number) + 4\"\n :alt=\"note.note.name\"\n r=\"3\"\n :fill=\"note.isCorrect ? 'black' : note.isMissing ? 'none' : 'red'\"\n :stroke=\"note.isMissing ? 'red' : 'none'\"\n @mouseenter=\"sayNote(note)\"\n />\n </template>\n </template>\n </svg>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, ref, computed, PropType, onMounted } from 'vue';\nimport { SyllableSequence, NoteEvent } from './midi';\n\nexport default defineComponent({\n name: 'SyllableSeqVis',\n\n props: {\n seq: {\n type: Object as PropType<SyllableSequence>,\n required: true,\n },\n lastTSsuggestion: {\n type: Number,\n required: false,\n default: 0,\n },\n },\n\n setup(props) {\n const firstTS = ref(0); // in ms\n const lastTS = ref(0); // in ms\n const high = ref(0);\n const low = ref(500);\n\n const sayNote = (note: NoteEvent) => {\n console.log(`${JSON.stringify(note)}`);\n };\n\n const getLastTS = computed(() => {\n const min = 1;\n const ts = props.seq.syllables[props.seq.syllables.length - 1].timestamp;\n return Math.max(min, ts, props.lastTSsuggestion);\n });\n\n const getHeight = computed(() => {\n let highVal = 0;\n let lowVal = 500;\n props.seq.syllables.forEach((s) => {\n s.notes.forEach((n) => {\n if (n.note.number > highVal) {\n highVal = n.note.number;\n }\n if (n.note.number < lowVal) {\n lowVal = n.note.number;\n }\n });\n });\n return Math.max(3 * (highVal - lowVal) + 10, 0);\n });\n\n const updateBounds = () => {\n try {\n firstTS.value = props.seq.syllables[0].timestamp;\n const dataTS = props.seq.syllables[props.seq.syllables.length - 1].timestamp;\n const suggestedTS = firstTS.value + props.lastTSsuggestion;\n\n lastTS.value = Math.max(dataTS, suggestedTS);\n } catch (e) {\n console.log(`[SyllableSeqVis] Error updating bounds: ${e}`);\n }\n props.seq.syllables.forEach((s) => {\n s.notes.forEach((n) => {\n if (n.note.number > high.value) {\n high.value = n.note.number;\n }\n if (n.note.number < low.value) {\n low.value = n.note.number;\n }\n });\n });\n };\n\n onMounted(() => {\n console.log(`SyllableSeqVis created w/ input: \\n${props.seq}`);\n updateBounds();\n });\n\n return {\n firstTS,\n lastTS,\n high,\n low,\n sayNote,\n getLastTS,\n getHeight,\n updateBounds,\n };\n },\n});\n</script>\n\n<style lang=\"css\" scoped>\nsvg {\n border: 1px;\n}\n</style>\n","<template>\n <div>\n <svg :width=\"510\" :height=\"Math.max(3 * (high - low) + 10, 0)\">\n <template v-for=\"syl in seq.syllables\">\n <template v-for=\"note in syl.notes\" :key=\"syl.timestamp + '-' + note.note.number\">\n <circle\n :cx=\"((syl.timestamp - firstTS) * 500) / (lastTS - firstTS) + 4\"\n :cy=\"3 * (high - note.note.number) + 4\"\n :alt=\"note.note.name\"\n r=\"3\"\n :fill=\"note.isCorrect ? 'black' : note.isMissing ? 'none' : 'red'\"\n :stroke=\"note.isMissing ? 'red' : 'none'\"\n @mouseenter=\"sayNote(note)\"\n />\n </template>\n </template>\n </svg>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, ref, computed, PropType, onMounted } from 'vue';\nimport { SyllableSequence, NoteEvent } from './midi';\n\nexport default defineComponent({\n name: 'SyllableSeqVis',\n\n props: {\n seq: {\n type: Object as PropType<SyllableSequence>,\n required: true,\n },\n lastTSsuggestion: {\n type: Number,\n required: false,\n default: 0,\n },\n },\n\n setup(props) {\n const firstTS = ref(0); // in ms\n const lastTS = ref(0); // in ms\n const high = ref(0);\n const low = ref(500);\n\n const sayNote = (note: NoteEvent) => {\n console.log(`${JSON.stringify(note)}`);\n };\n\n const getLastTS = computed(() => {\n const min = 1;\n const ts = props.seq.syllables[props.seq.syllables.length - 1].timestamp;\n return Math.max(min, ts, props.lastTSsuggestion);\n });\n\n const getHeight = computed(() => {\n let highVal = 0;\n let lowVal = 500;\n props.seq.syllables.forEach((s) => {\n s.notes.forEach((n) => {\n if (n.note.number > highVal) {\n highVal = n.note.number;\n }\n if (n.note.number < lowVal) {\n lowVal = n.note.number;\n }\n });\n });\n return Math.max(3 * (highVal - lowVal) + 10, 0);\n });\n\n const updateBounds = () => {\n try {\n firstTS.value = props.seq.syllables[0].timestamp;\n const dataTS = props.seq.syllables[props.seq.syllables.length - 1].timestamp;\n const suggestedTS = firstTS.value + props.lastTSsuggestion;\n\n lastTS.value = Math.max(dataTS, suggestedTS);\n } catch (e) {\n console.log(`[SyllableSeqVis] Error updating bounds: ${e}`);\n }\n props.seq.syllables.forEach((s) => {\n s.notes.forEach((n) => {\n if (n.note.number > high.value) {\n high.value = n.note.number;\n }\n if (n.note.number < low.value) {\n low.value = n.note.number;\n }\n });\n });\n };\n\n onMounted(() => {\n console.log(`SyllableSeqVis created w/ input: \\n${props.seq}`);\n updateBounds();\n });\n\n return {\n firstTS,\n lastTS,\n high,\n low,\n sayNote,\n getLastTS,\n getHeight,\n updateBounds,\n };\n },\n});\n</script>\n\n<style lang=\"css\" scoped>\nsvg {\n border: 1px;\n}\n</style>\n","<template>\n <svg\n id=\"svg8\"\n width=\"300px\"\n height=\"auto\"\n xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n xmlns:cc=\"http://creativecommons.org/ns#\"\n xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n xmlns:svg=\"http://www.w3.org/2000/svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\"\n xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n sodipodi:docname=\"keys.svg\"\n inkscape:version=\"1.0rc1 (09960d6f05, 2020-04-09)\"\n version=\"1.1\"\n viewBox=\"0 0 175.24936 73.594925\"\n >\n <defs id=\"defs2\" />\n <sodipodi:namedview\n id=\"base\"\n inkscape:window-maximized=\"1\"\n inkscape:window-y=\"726\"\n inkscape:window-x=\"1491\"\n inkscape:window-height=\"1321\"\n inkscape:window-width=\"2400\"\n showborder=\"false\"\n showgrid=\"false\"\n inkscape:document-rotation=\"0\"\n inkscape:current-layer=\"layer1\"\n inkscape:document-units=\"mm\"\n inkscape:cy=\"255.88343\"\n inkscape:cx=\"754.94284\"\n inkscape:zoom=\"0.98994949\"\n inkscape:pageshadow=\"2\"\n inkscape:pageopacity=\"0.0\"\n borderopacity=\"1.0\"\n bordercolor=\"#666666\"\n pagecolor=\"#ffffff\"\n />\n <metadata id=\"metadata5\">\n <rdf:RDF>\n <cc:Work rdf:about=\"\">\n <dc:format>image/svg+xml</dc:format>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\" />\n <dc:title></dc:title>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <g id=\"layer1\" transform=\"translate(167.75219,-151.96011)\" inkscape:groupmode=\"layer\" inkscape:label=\"Layer 1\">\n <!-- 0 c -->\n <rect id=\"rect845\" y=\"152.19064\" x=\"-150.12129\" height=\"73.220116\" width=\"17.486626\" :style=\"style(0)\" />\n <!-- 2 d -->\n <rect id=\"rect845-9\" :style=\"style(2)\" width=\"17.486626\" height=\"73.220116\" x=\"-132.63466\" y=\"152.19064\" />\n <!-- 4 e -->\n <rect id=\"rect845-6\" :style=\"style(4)\" width=\"17.486626\" height=\"73.220116\" x=\"-115.14803\" y=\"152.19064\" />\n <!-- 5 f -->\n <rect id=\"rect845-4\" :style=\"style(5)\" width=\"17.486626\" height=\"73.220116\" x=\"-97.661407\" y=\"152.19064\" />\n <!-- 7 g -->\n <rect id=\"rect845-92\" :style=\"style(7)\" width=\"17.486626\" height=\"73.220116\" x=\"-80.174782\" y=\"152.19064\" />\n <!-- 9 a -->\n <rect id=\"rect845-3\" :style=\"style(9)\" width=\"17.486626\" height=\"73.220116\" x=\"-62.688156\" y=\"152.19064\" />\n <!-- 11 b -->\n <rect id=\"rect845-0\" :style=\"style(11)\" width=\"17.486626\" height=\"73.220116\" x=\"-45.20153\" y=\"152.19064\" />\n <!-- second c (dnh) -->\n <rect id=\"rect845-30\" :style=\"style(white)\" width=\"17.486626\" height=\"73.220116\" x=\"-27.714905\" y=\"152.10745\" />\n <!-- 1 c# -->\n <rect id=\"rect898\" ry=\"0\" y=\"152.10744\" x=\"-138.43532\" height=\"54.415863\" width=\"10.466455\" :style=\"style(1)\" />\n <!-- 3 d# -->\n <rect id=\"rect898-3\" :style=\"style(3)\" width=\"10.466455\" height=\"54.415863\" x=\"-120.84978\" y=\"152.10744\" ry=\"0\" />\n <!-- 6 f# -->\n <rect id=\"rect898-7\" :style=\"style(6)\" width=\"10.466455\" height=\"54.415863\" x=\"-85.678711\" y=\"152.10744\" ry=\"0\" />\n <!-- 8 g# -->\n <rect id=\"rect898-8\" :style=\"style(8)\" width=\"10.466455\" height=\"54.415863\" x=\"-68.09317\" y=\"152.10744\" ry=\"0\" />\n <!-- 10 a# -->\n <rect\n id=\"rect898-1\"\n :style=\"style(10)\"\n width=\"10.466455\"\n height=\"54.415863\"\n x=\"-50.507633\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <!-- second d (do not highlight) -->\n <rect id=\"rect845-30-1\" y=\"152.10745\" x=\"-10.228278\" height=\"73.220116\" width=\"17.486626\" :style=\"style(white)\" />\n <!-- first b (do not highlight) -->\n <rect id=\"rect845-30-9\" y=\"152.10744\" x=\"-167.60791\" height=\"73.220116\" width=\"17.486626\" :style=\"style(white)\" />\n <!-- second c# (dnh) -->\n <rect\n id=\"rect898-4\"\n :style=\"style(black)\"\n width=\"10.466455\"\n height=\"54.415863\"\n x=\"-15.336554\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <!-- first a# (dnh) -->\n <rect\n id=\"rect898-74\"\n :style=\"style(black)\"\n width=\"4.4679713\"\n height=\"54.415863\"\n x=\"-167.60791\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <!-- second d# (dnh) -->\n <rect\n id=\"rect898-10\"\n :style=\"style(black)\"\n width=\"5.1863246\"\n height=\"54.507248\"\n x=\"2.2092075\"\n y=\"152.06175\"\n ry=\"0\"\n />\n </g>\n </svg>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from 'vue';\n\nexport default defineComponent({\n name: 'NoteDisplay',\n\n props: {\n chroma: {\n type: Number,\n required: true,\n },\n },\n\n setup(props) {\n const white = -1;\n const black = -2;\n\n const style = (n: number) => {\n let color: string = '#ffffff';\n if (n === props.chroma) {\n color = '#1976D2';\n } else if (n === 1 || n === 3 || n === 6 || n === 8 || n === 10 || n === black) {\n color = '#000000';\n }\n\n return {\n fill: color,\n 'fill-opacity': 1,\n stroke: '#000000',\n 'stroke-width': 0.79375,\n 'stroke-miterlimit': 4,\n 'stroke-dasharray': 'none',\n 'stroke-opacity': 1,\n };\n };\n\n return {\n style,\n white,\n black,\n };\n },\n});\n</script>\n","<template>\n <svg\n id=\"svg8\"\n width=\"300px\"\n height=\"auto\"\n xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n xmlns:cc=\"http://creativecommons.org/ns#\"\n xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n xmlns:svg=\"http://www.w3.org/2000/svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\"\n xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n sodipodi:docname=\"keys.svg\"\n inkscape:version=\"1.0rc1 (09960d6f05, 2020-04-09)\"\n version=\"1.1\"\n viewBox=\"0 0 175.24936 73.594925\"\n >\n <defs id=\"defs2\" />\n <sodipodi:namedview\n id=\"base\"\n inkscape:window-maximized=\"1\"\n inkscape:window-y=\"726\"\n inkscape:window-x=\"1491\"\n inkscape:window-height=\"1321\"\n inkscape:window-width=\"2400\"\n showborder=\"false\"\n showgrid=\"false\"\n inkscape:document-rotation=\"0\"\n inkscape:current-layer=\"layer1\"\n inkscape:document-units=\"mm\"\n inkscape:cy=\"255.88343\"\n inkscape:cx=\"754.94284\"\n inkscape:zoom=\"0.98994949\"\n inkscape:pageshadow=\"2\"\n inkscape:pageopacity=\"0.0\"\n borderopacity=\"1.0\"\n bordercolor=\"#666666\"\n pagecolor=\"#ffffff\"\n />\n <metadata id=\"metadata5\">\n <rdf:RDF>\n <cc:Work rdf:about=\"\">\n <dc:format>image/svg+xml</dc:format>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\" />\n <dc:title></dc:title>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <g id=\"layer1\" transform=\"translate(167.75219,-151.96011)\" inkscape:groupmode=\"layer\" inkscape:label=\"Layer 1\">\n <!-- 0 c -->\n <rect id=\"rect845\" y=\"152.19064\" x=\"-150.12129\" height=\"73.220116\" width=\"17.486626\" :style=\"style(0)\" />\n <!-- 2 d -->\n <rect id=\"rect845-9\" :style=\"style(2)\" width=\"17.486626\" height=\"73.220116\" x=\"-132.63466\" y=\"152.19064\" />\n <!-- 4 e -->\n <rect id=\"rect845-6\" :style=\"style(4)\" width=\"17.486626\" height=\"73.220116\" x=\"-115.14803\" y=\"152.19064\" />\n <!-- 5 f -->\n <rect id=\"rect845-4\" :style=\"style(5)\" width=\"17.486626\" height=\"73.220116\" x=\"-97.661407\" y=\"152.19064\" />\n <!-- 7 g -->\n <rect id=\"rect845-92\" :style=\"style(7)\" width=\"17.486626\" height=\"73.220116\" x=\"-80.174782\" y=\"152.19064\" />\n <!-- 9 a -->\n <rect id=\"rect845-3\" :style=\"style(9)\" width=\"17.486626\" height=\"73.220116\" x=\"-62.688156\" y=\"152.19064\" />\n <!-- 11 b -->\n <rect id=\"rect845-0\" :style=\"style(11)\" width=\"17.486626\" height=\"73.220116\" x=\"-45.20153\" y=\"152.19064\" />\n <!-- second c (dnh) -->\n <rect id=\"rect845-30\" :style=\"style(white)\" width=\"17.486626\" height=\"73.220116\" x=\"-27.714905\" y=\"152.10745\" />\n <!-- 1 c# -->\n <rect id=\"rect898\" ry=\"0\" y=\"152.10744\" x=\"-138.43532\" height=\"54.415863\" width=\"10.466455\" :style=\"style(1)\" />\n <!-- 3 d# -->\n <rect id=\"rect898-3\" :style=\"style(3)\" width=\"10.466455\" height=\"54.415863\" x=\"-120.84978\" y=\"152.10744\" ry=\"0\" />\n <!-- 6 f# -->\n <rect id=\"rect898-7\" :style=\"style(6)\" width=\"10.466455\" height=\"54.415863\" x=\"-85.678711\" y=\"152.10744\" ry=\"0\" />\n <!-- 8 g# -->\n <rect id=\"rect898-8\" :style=\"style(8)\" width=\"10.466455\" height=\"54.415863\" x=\"-68.09317\" y=\"152.10744\" ry=\"0\" />\n <!-- 10 a# -->\n <rect\n id=\"rect898-1\"\n :style=\"style(10)\"\n width=\"10.466455\"\n height=\"54.415863\"\n x=\"-50.507633\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <!-- second d (do not highlight) -->\n <rect id=\"rect845-30-1\" y=\"152.10745\" x=\"-10.228278\" height=\"73.220116\" width=\"17.486626\" :style=\"style(white)\" />\n <!-- first b (do not highlight) -->\n <rect id=\"rect845-30-9\" y=\"152.10744\" x=\"-167.60791\" height=\"73.220116\" width=\"17.486626\" :style=\"style(white)\" />\n <!-- second c# (dnh) -->\n <rect\n id=\"rect898-4\"\n :style=\"style(black)\"\n width=\"10.466455\"\n height=\"54.415863\"\n x=\"-15.336554\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <!-- first a# (dnh) -->\n <rect\n id=\"rect898-74\"\n :style=\"style(black)\"\n width=\"4.4679713\"\n height=\"54.415863\"\n x=\"-167.60791\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <!-- second d# (dnh) -->\n <rect\n id=\"rect898-10\"\n :style=\"style(black)\"\n width=\"5.1863246\"\n height=\"54.507248\"\n x=\"2.2092075\"\n y=\"152.06175\"\n ry=\"0\"\n />\n </g>\n </svg>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from 'vue';\n\nexport default defineComponent({\n name: 'NoteDisplay',\n\n props: {\n chroma: {\n type: Number,\n required: true,\n },\n },\n\n setup(props) {\n const white = -1;\n const black = -2;\n\n const style = (n: number) => {\n let color: string = '#ffffff';\n if (n === props.chroma) {\n color = '#1976D2';\n } else if (n === 1 || n === 3 || n === 6 || n === 8 || n === 10 || n === black) {\n color = '#000000';\n }\n\n return {\n fill: color,\n 'fill-opacity': 1,\n stroke: '#000000',\n 'stroke-width': 0.79375,\n 'stroke-miterlimit': 4,\n 'stroke-dasharray': 'none',\n 'stroke-opacity': 1,\n };\n };\n\n return {\n style,\n white,\n black,\n };\n },\n});\n</script>\n","<template>\n <div v-if=\"initialized\" data-viewable=\"Playback\">\n <div v-if=\"state === 'ready'\">\n <div class=\"text-h4\">{{ promptText }} <note-display :chroma=\"firstNoteChroma\" /></div>\n <div class=\"text-h5\">Listen...<span v-if=\"recording\"> and Repeat</span></div>\n\n <div class=\"progressContainer\">\n <div id=\"progress\" ref=\"progressBar\"></div>\n </div>\n\n <v-btn color=\"primary\" autofocus @click=\"clearAttempt\"> Play again <v-icon end>volume_up</v-icon> </v-btn>\n\n <syllable-seq-vis v-if=\"true\" ref=\"inputVisRef\" :seq=\"inputSeq\" :last-t-ssuggestion=\"lastTSsuggestion\" />\n <syllable-seq-vis v-if=\"graded\" :seq=\"gradedSeq\" />\n </div>\n <div v-else-if=\"state === 'nodevice'\">No midi device detected. Please attach one!</div>\n <div v-else-if=\"state === 'notsupported'\">\n <p>This exercise requires a midi input device, which is not supported by this browser ☹</p>\n <div>\n <p>Please try again with one of the following browsers:</p>\n <ul>\n <li><a href=\"https://www.google.com/chrome/\">Google Chrome</a></li>\n <li><a href=\"https://www.microsoft.com/edge\">Microsoft Edge</a></li>\n <li><a href=\"https://brave.com/\">Brave</a></li>\n </ul>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, ref, computed, PropType, onMounted, onBeforeUnmount } from 'vue';\nimport SkMidi, { eventsToSyllableSequence, SyllableSequence } from '../../utility/midi';\nimport { EchoQuestion } from '.';\nimport moment from 'moment';\nimport SyllableSeqVis from '../../utility/SyllableSeqVis.vue';\nimport NoteDisplay from '../../NoteDisplay.vue';\nimport { SkldrMouseTrap, alertUser, useViewable, useQuestionView } from '@vue-skuilder/common-ui';\nimport { ViewData, Status } from '@vue-skuilder/common';\n\nexport default defineComponent({\n // this class name *may* be used as a lookup for dynamic component.\n // eslint-disable-next-line\n name: 'Playback',\n\n components: {\n SyllableSeqVis,\n NoteDisplay,\n },\n\n props: {\n data: {\n type: Array as PropType<ViewData[]>,\n required: true,\n },\n modifyDifficulty: {\n type: Number,\n required: false,\n default: 0,\n },\n },\n\n setup(props, { emit }) {\n const viewableUtils = useViewable(props, emit, 'Playback');\n const questionUtils = useQuestionView<EchoQuestion>(viewableUtils);\n\n // State\n const midi = ref<SkMidi>();\n const initialized = ref(false);\n const state = ref('notSet');\n const recording = ref(false);\n const playbackProgress = ref(0);\n const playbackStartTime = ref(moment.utc());\n const playbackDuration = ref(0);\n const attempts = ref(0);\n const gradedSeq = ref<SyllableSequence>(eventsToSyllableSequence([]));\n const graded = ref(false);\n const inputSeq = ref<SyllableSequence>(eventsToSyllableSequence([]));\n const lastTSsuggestion = ref(0);\n const errMsg = ref('');\n const notesOn = ref(0);\n const notesOff = ref(0);\n\n // Refs\n const progressBar = ref<HTMLDivElement>();\n const inputVisRef = ref<InstanceType<typeof SyllableSeqVis>>();\n\n // Initialize question\n questionUtils.question.value = new EchoQuestion(props.data);\n\n // Computed\n const question = computed(() => new EchoQuestion(props.data));\n\n const promptText = computed(() => {\n return eventsToSyllableSequence(question.value.midi).syllables[0].notes.length > 1\n ? 'Lowest note of first chord:'\n : 'First note:';\n });\n\n const firstNoteChroma = computed(() => {\n if (initialized.value) {\n return eventsToSyllableSequence(question.value.midi).rootNote.number % 12;\n }\n return 0;\n });\n\n // Methods\n const init = () => {\n if (state.value) {\n if (state.value !== midi.value?.state) {\n initialized.value = false;\n state.value = midi.value?.state || 'notSet';\n initialized.value = true;\n }\n } else {\n state.value = midi.value?.state || 'notSet';\n initialized.value = true;\n }\n\n viewableUtils.logger.log(`Playback is running init with state: ${state.value}`);\n\n if (state.value === 'ready') {\n playbackDuration.value = question.value.duration;\n play();\n }\n };\n\n const runProgressBar = () => {\n try {\n if (progressBar.value) {\n progressBar.value.style.animationName = '';\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n if (progressBar.value) {\n progressBar.value.style.animationDuration = playbackDuration.value + 'ms';\n progressBar.value.style.animationName = 'progress';\n }\n });\n });\n }\n } catch {\n setTimeout(runProgressBar, 50);\n }\n };\n\n const record = () => {\n midi.value?.record();\n recording.value = true;\n\n // attach listeners\n midi.value?.addNoteonListenter((e) => {\n notesOn.value++;\n inputSeq.value.append(e);\n inputVisRef.value?.updateBounds();\n if (notesOn.value + notesOff.value >= question.value.midi.length) {\n submit();\n }\n });\n\n midi.value?.addNoteoffListenter(() => {\n notesOff.value++;\n if (notesOn.value + notesOff.value >= question.value.midi.length) {\n submit();\n }\n });\n };\n\n const play = () => {\n midi.value?.stopRecording();\n midi.value?.eraseRecording();\n playbackStartTime.value = moment.utc();\n notesOn.value = 0;\n notesOff.value = 0;\n recording.value = false;\n playbackProgress.value = 0;\n\n runProgressBar();\n\n midi.value?.play(question.value.midi);\n\n setTimeout(() => {\n viewableUtils.logger.log('done playback...');\n record();\n }, question.value.lastNoteOnTimestamp);\n };\n\n const submit = () => {\n if (!midi.value?.recording) return false;\n\n const qSylSeq = eventsToSyllableSequence(question.value.midi);\n const aSylSeq = eventsToSyllableSequence(midi.value.recording);\n gradedSeq.value = qSylSeq.grade(aSylSeq);\n inputSeq.value = eventsToSyllableSequence([]);\n\n if (!questionUtils.submitAnswer(midi.value.recording).isCorrect) {\n attempts.value++;\n graded.value = true;\n if (attempts.value < questionUtils.maxAttemptsPerView.value) {\n play();\n }\n return false;\n }\n return true;\n };\n\n const clearAttempt = () => {\n if (notesOn.value > 0) {\n submit();\n } else {\n play();\n }\n };\n\n // Lifecycle\n onMounted(async () => {\n try {\n midi.value = await SkMidi.instance();\n midi.value.setStateChangeListener(() => {\n init();\n });\n initialized.value = true;\n } catch (error) {\n alertUser({\n status: Status.error,\n text: 'Midi device not supported',\n });\n errMsg.value = JSON.stringify(error);\n state.value = 'notsupported';\n initialized.value = true;\n }\n\n init();\n\n // Bind space key\n SkldrMouseTrap.addBinding([\n {\n hotkey: 'space',\n callback: clearAttempt,\n command: 'Clear attempt or play again',\n },\n ]);\n });\n\n onBeforeUnmount(() => {\n SkldrMouseTrap.removeBinding('space');\n });\n\n return {\n ...viewableUtils,\n ...questionUtils,\n initialized,\n state,\n recording,\n inputSeq,\n lastTSsuggestion,\n gradedSeq,\n graded,\n promptText,\n firstNoteChroma,\n progressBar,\n inputVisRef,\n clearAttempt,\n notesOn,\n };\n },\n});\n</script>\n\n<style lang=\"css\">\n@keyframes progress {\n 0% {\n width: 0%;\n }\n\n 100% {\n width: 100%;\n }\n}\n\n.progressContainer {\n background-color: #eee;\n height: 5px;\n}\n\n#progress {\n background-color: blue;\n width: 100%;\n height: 5px;\n animation-timing-function: linear;\n}\n\n.hidden {\n opacity: 0;\n}\n</style>\n","<template>\n <div v-if=\"initialized\" data-viewable=\"Playback\">\n <div v-if=\"state === 'ready'\">\n <div class=\"text-h4\">{{ promptText }} <note-display :chroma=\"firstNoteChroma\" /></div>\n <div class=\"text-h5\">Listen...<span v-if=\"recording\"> and Repeat</span></div>\n\n <div class=\"progressContainer\">\n <div id=\"progress\" ref=\"progressBar\"></div>\n </div>\n\n <v-btn color=\"primary\" autofocus @click=\"clearAttempt\"> Play again <v-icon end>volume_up</v-icon> </v-btn>\n\n <syllable-seq-vis v-if=\"true\" ref=\"inputVisRef\" :seq=\"inputSeq\" :last-t-ssuggestion=\"lastTSsuggestion\" />\n <syllable-seq-vis v-if=\"graded\" :seq=\"gradedSeq\" />\n </div>\n <div v-else-if=\"state === 'nodevice'\">No midi device detected. Please attach one!</div>\n <div v-else-if=\"state === 'notsupported'\">\n <p>This exercise requires a midi input device, which is not supported by this browser ☹</p>\n <div>\n <p>Please try again with one of the following browsers:</p>\n <ul>\n <li><a href=\"https://www.google.com/chrome/\">Google Chrome</a></li>\n <li><a href=\"https://www.microsoft.com/edge\">Microsoft Edge</a></li>\n <li><a href=\"https://brave.com/\">Brave</a></li>\n </ul>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, ref, computed, PropType, onMounted, onBeforeUnmount } from 'vue';\nimport SkMidi, { eventsToSyllableSequence, SyllableSequence } from '../../utility/midi';\nimport { EchoQuestion } from '.';\nimport moment from 'moment';\nimport SyllableSeqVis from '../../utility/SyllableSeqVis.vue';\nimport NoteDisplay from '../../NoteDisplay.vue';\nimport { SkldrMouseTrap, alertUser, useViewable, useQuestionView } from '@vue-skuilder/common-ui';\nimport { ViewData, Status } from '@vue-skuilder/common';\n\nexport default defineComponent({\n // this class name *may* be used as a lookup for dynamic component.\n // eslint-disable-next-line\n name: 'Playback',\n\n components: {\n SyllableSeqVis,\n NoteDisplay,\n },\n\n props: {\n data: {\n type: Array as PropType<ViewData[]>,\n required: true,\n },\n modifyDifficulty: {\n type: Number,\n required: false,\n default: 0,\n },\n },\n\n setup(props, { emit }) {\n const viewableUtils = useViewable(props, emit, 'Playback');\n const questionUtils = useQuestionView<EchoQuestion>(viewableUtils);\n\n // State\n const midi = ref<SkMidi>();\n const initialized = ref(false);\n const state = ref('notSet');\n const recording = ref(false);\n const playbackProgress = ref(0);\n const playbackStartTime = ref(moment.utc());\n const playbackDuration = ref(0);\n const attempts = ref(0);\n const gradedSeq = ref<SyllableSequence>(eventsToSyllableSequence([]));\n const graded = ref(false);\n const inputSeq = ref<SyllableSequence>(eventsToSyllableSequence([]));\n const lastTSsuggestion = ref(0);\n const errMsg = ref('');\n const notesOn = ref(0);\n const notesOff = ref(0);\n\n // Refs\n const progressBar = ref<HTMLDivElement>();\n const inputVisRef = ref<InstanceType<typeof SyllableSeqVis>>();\n\n // Initialize question\n questionUtils.question.value = new EchoQuestion(props.data);\n\n // Computed\n const question = computed(() => new EchoQuestion(props.data));\n\n const promptText = computed(() => {\n return eventsToSyllableSequence(question.value.midi).syllables[0].notes.length > 1\n ? 'Lowest note of first chord:'\n : 'First note:';\n });\n\n const firstNoteChroma = computed(() => {\n if (initialized.value) {\n return eventsToSyllableSequence(question.value.midi).rootNote.number % 12;\n }\n return 0;\n });\n\n // Methods\n const init = () => {\n if (state.value) {\n if (state.value !== midi.value?.state) {\n initialized.value = false;\n state.value = midi.value?.state || 'notSet';\n initialized.value = true;\n }\n } else {\n state.value = midi.value?.state || 'notSet';\n initialized.value = true;\n }\n\n viewableUtils.logger.log(`Playback is running init with state: ${state.value}`);\n\n if (state.value === 'ready') {\n playbackDuration.value = question.value.duration;\n play();\n }\n };\n\n const runProgressBar = () => {\n try {\n if (progressBar.value) {\n progressBar.value.style.animationName = '';\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n if (progressBar.value) {\n progressBar.value.style.animationDuration = playbackDuration.value + 'ms';\n progressBar.value.style.animationName = 'progress';\n }\n });\n });\n }\n } catch {\n setTimeout(runProgressBar, 50);\n }\n };\n\n const record = () => {\n midi.value?.record();\n recording.value = true;\n\n // attach listeners\n midi.value?.addNoteonListenter((e) => {\n notesOn.value++;\n inputSeq.value.append(e);\n inputVisRef.value?.updateBounds();\n if (notesOn.value + notesOff.value >= question.value.midi.length) {\n submit();\n }\n });\n\n midi.value?.addNoteoffListenter(() => {\n notesOff.value++;\n if (notesOn.value + notesOff.value >= question.value.midi.length) {\n submit();\n }\n });\n };\n\n const play = () => {\n midi.value?.stopRecording();\n midi.value?.eraseRecording();\n playbackStartTime.value = moment.utc();\n notesOn.value = 0;\n notesOff.value = 0;\n recording.value = false;\n playbackProgress.value = 0;\n\n runProgressBar();\n\n midi.value?.play(question.value.midi);\n\n setTimeout(() => {\n viewableUtils.logger.log('done playback...');\n record();\n }, question.value.lastNoteOnTimestamp);\n };\n\n const submit = () => {\n if (!midi.value?.recording) return false;\n\n const qSylSeq = eventsToSyllableSequence(question.value.midi);\n const aSylSeq = eventsToSyllableSequence(midi.value.recording);\n gradedSeq.value = qSylSeq.grade(aSylSeq);\n inputSeq.value = eventsToSyllableSequence([]);\n\n if (!questionUtils.submitAnswer(midi.value.recording).isCorrect) {\n attempts.value++;\n graded.value = true;\n if (attempts.value < questionUtils.maxAttemptsPerView.value) {\n play();\n }\n return false;\n }\n return true;\n };\n\n const clearAttempt = () => {\n if (notesOn.value > 0) {\n submit();\n } else {\n play();\n }\n };\n\n // Lifecycle\n onMounted(async () => {\n try {\n midi.value = await SkMidi.instance();\n midi.value.setStateChangeListener(() => {\n init();\n });\n initialized.value = true;\n } catch (error) {\n alertUser({\n status: Status.error,\n text: 'Midi device not supported',\n });\n errMsg.value = JSON.stringify(error);\n state.value = 'notsupported';\n initialized.value = true;\n }\n\n init();\n\n // Bind space key\n SkldrMouseTrap.addBinding([\n {\n hotkey: 'space',\n callback: clearAttempt,\n command: 'Clear attempt or play again',\n },\n ]);\n });\n\n onBeforeUnmount(() => {\n SkldrMouseTrap.removeBinding('space');\n });\n\n return {\n ...viewableUtils,\n ...questionUtils,\n initialized,\n state,\n recording,\n inputSeq,\n lastTSsuggestion,\n gradedSeq,\n graded,\n promptText,\n firstNoteChroma,\n progressBar,\n inputVisRef,\n clearAttempt,\n notesOn,\n };\n },\n});\n</script>\n\n<style lang=\"css\">\n@keyframes progress {\n 0% {\n width: 0%;\n }\n\n 100% {\n width: 100%;\n }\n}\n\n.progressContainer {\n background-color: #eee;\n height: 5px;\n}\n\n#progress {\n background-color: blue;\n width: 100%;\n height: 5px;\n animation-timing-function: linear;\n}\n\n.hidden {\n opacity: 0;\n}\n</style>\n","import { Question } from '@vue-skuilder/common-ui';\nimport { DataShape, FieldDefinition } from '@vue-skuilder/common';\nimport { ViewData, DataShapeName, FieldType } from '@vue-skuilder/common';\nimport { eventsToSyllableSequence, NoteEvent } from '../../utility/midi';\nimport Playback from './Playback.vue';\n\nconst fields: FieldDefinition[] = [\n {\n name: 'Melody',\n type: FieldType.MIDI,\n },\n];\n\nexport class EchoQuestion extends Question {\n public static dataShapes: DataShape[] = [\n {\n fields,\n name: DataShapeName.PIANO_Echo,\n },\n ];\n\n public static views = [Playback];\n\n public midi: NoteEvent[];\n\n constructor(data: ViewData[]) {\n super(data);\n this.midi = data[0].Melody as unknown as NoteEvent[];\n }\n\n /**\n * The duration of the recording in milliseconds\n */\n public get duration(): number {\n return this.midi.reduce((max, current) => {\n if (current.timestamp > max.timestamp) {\n return current;\n } else {\n return max;\n }\n }).timestamp;\n }\n\n /**\n * The time (in MS) at which the last note in\n * recording is played\n */\n public get lastNoteOnTimestamp(): number {\n return this.midi\n .filter((e) => e.type === 'noteon')\n .reduce((max, current) => {\n if (current.timestamp > max.timestamp) {\n return current;\n } else {\n return max;\n }\n }).timestamp;\n }\n\n public isCorrect(answer: NoteEvent[]): boolean {\n const qSylSeq = eventsToSyllableSequence(this.midi);\n const aSylSeq = eventsToSyllableSequence(answer);\n\n try {\n const gradedSeq = qSylSeq.grade(aSylSeq);\n return gradedSeq.isCorrect();\n } catch (e) {\n console.log(`ERROR grading this midi sequence!`, e);\n return false;\n }\n\n // console.log(`Sequence is correct: ${gradedSeq.isCorrect()}`);\n // if (gradedSeq.isCorrect()) {\n // console.log(`The correct sequence: \\n${gradedSeq}`);\n // }\n\n // if (answer.length !== this.midi.length) {\n // log(`Input length and answer length not equal...`);\n // return false;\n // }\n\n // for (let i = 0; i < Math.min(onAnswer.length, onMidi.length); i++) {\n // if (onAnswer[i].note.name !== onMidi[i].note.name ||\n // onAnswer[i].note.number - onAnswer[0].note.number !==\n // onMidi[i].note.number - onMidi[0].note.number\n // ) {\n // return false || gradedSeq.isCorrect();\n // }\n // }\n // return true;\n }\n\n public dataShapes(): DataShape[] {\n return EchoQuestion.dataShapes;\n }\n public views() {\n return EchoQuestion.views;\n }\n}\n","<template>\n <div data-viewable=\"NotePlayback\">\n <div class=\"text-h4\">\n Play the note: <span class=\"font-weight-bold\">{{ note }}</span>\n </div>\n\n <svg\n v-if=\"graded\"\n id=\"svg8\"\n width=\"300px\"\n height=\"auto\"\n xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n xmlns:cc=\"http://creativecommons.org/ns#\"\n xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n xmlns:svg=\"http://www.w3.org/2000/svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\"\n xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n sodipodi:docname=\"keys.svg\"\n inkscape:version=\"1.0rc1 (09960d6f05, 2020-04-09)\"\n version=\"1.1\"\n viewBox=\"0 0 175.24936 73.594925\"\n >\n <defs id=\"defs2\" />\n <sodipodi:namedview\n id=\"base\"\n inkscape:window-maximized=\"1\"\n inkscape:window-y=\"726\"\n inkscape:window-x=\"1491\"\n inkscape:window-height=\"1321\"\n inkscape:window-width=\"2400\"\n showborder=\"false\"\n showgrid=\"false\"\n inkscape:document-rotation=\"0\"\n inkscape:current-layer=\"layer1\"\n inkscape:document-units=\"mm\"\n inkscape:cy=\"255.88343\"\n inkscape:cx=\"754.94284\"\n inkscape:zoom=\"0.98994949\"\n inkscape:pageshadow=\"2\"\n inkscape:pageopacity=\"0.0\"\n borderopacity=\"1.0\"\n bordercolor=\"#666666\"\n pagecolor=\"#ffffff\"\n />\n <metadata id=\"metadata5\">\n <rdf:RDF>\n <cc:Work rdf:about=\"\">\n <dc:format>image/svg+xml</dc:format>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\" />\n <dc:title></dc:title>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <g id=\"layer1\" transform=\"translate(167.75219,-151.96011)\" inkscape:groupmode=\"layer\" inkscape:label=\"Layer 1\">\n <rect\n id=\"rect845\"\n y=\"152.19064\"\n x=\"-150.12129\"\n height=\"73.220116\"\n width=\"17.486626\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n />\n <rect\n id=\"rect845-9\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"17.486626\"\n height=\"73.220116\"\n x=\"-132.63466\"\n y=\"152.19064\"\n />\n <rect\n id=\"rect845-6\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"17.486626\"\n height=\"73.220116\"\n x=\"-115.14803\"\n y=\"152.19064\"\n />\n <rect\n id=\"rect845-0\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"17.486626\"\n height=\"73.220116\"\n x=\"-45.20153\"\n y=\"152.19064\"\n />\n <rect\n id=\"rect845-92\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"17.486626\"\n height=\"73.220116\"\n x=\"-80.174782\"\n y=\"152.19064\"\n />\n <rect\n id=\"rect845-3\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"17.486626\"\n height=\"73.220116\"\n x=\"-62.688156\"\n y=\"152.19064\"\n />\n <rect\n id=\"rect845-4\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"17.486626\"\n height=\"73.220116\"\n x=\"-97.661407\"\n y=\"152.19064\"\n />\n <rect\n id=\"rect845-30\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"17.486626\"\n height=\"73.220116\"\n x=\"-27.714905\"\n y=\"152.10745\"\n />\n <rect\n id=\"rect898\"\n ry=\"0\"\n y=\"152.10744\"\n x=\"-138.43532\"\n height=\"54.415863\"\n width=\"10.466455\"\n style=\"\n fill: #000000;\n fill-opacity: 1;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n />\n <rect\n id=\"rect898-3\"\n style=\"\n fill: #000000;\n fill-opacity: 1;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"10.466455\"\n height=\"54.415863\"\n x=\"-120.84978\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <rect\n id=\"rect898-7\"\n style=\"\n fill: #000000;\n fill-opacity: 1;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"10.466455\"\n height=\"54.415863\"\n x=\"-85.678711\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <rect\n id=\"rect898-8\"\n style=\"\n fill: #000000;\n fill-opacity: 1;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"10.466455\"\n height=\"54.415863\"\n x=\"-68.09317\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <rect\n id=\"rect898-1\"\n style=\"\n fill: #000000;\n fill-opacity: 1;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"10.466455\"\n height=\"54.415863\"\n x=\"-50.507633\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <rect\n id=\"rect845-30-1\"\n y=\"152.10745\"\n x=\"-10.228278\"\n height=\"73.220116\"\n width=\"17.486626\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n />\n <rect\n id=\"rect845-30-9\"\n y=\"152.10744\"\n x=\"-167.60791\"\n height=\"73.220116\"\n width=\"17.486626\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n />\n <rect\n id=\"rect898-4\"\n style=\"\n fill: #000000;\n fill-opacity: 1;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"10.466455\"\n height=\"54.415863\"\n x=\"-15.336554\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <rect\n id=\"rect898-74\"\n style=\"\n fill: #000000;\n fill-opacity: 1;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"4.4679713\"\n height=\"54.415863\"\n x=\"-167.60791\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <rect\n id=\"rect898-10\"\n style=\"\n fill: #000000;\n fill-opacity: 1;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"5.1863246\"\n height=\"54.507248\"\n x=\"2.2092075\"\n y=\"152.06175\"\n ry=\"0\"\n />\n </g>\n </svg>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, ref, computed, PropType, onMounted } from 'vue';\nimport { useViewable, useQuestionView } from '@vue-skuilder/common-ui';\nimport SkMidi, { eventsToSyllableSequence, SyllableSequence } from '../../utility/midi';\nimport { PlayNote } from '.';\nimport moment from 'moment';\nimport { ViewData } from '@vue-skuilder/common';\n\nexport default defineComponent({\n name: 'NotePlayback',\n\n components: {},\n\n props: {\n data: {\n type: Array as PropType<ViewData[]>,\n required: true,\n },\n modifyDifficulty: {\n type: Number,\n required: false,\n default: 0,\n },\n },\n\n setup(props, { emit }) {\n const viewableUtils = useViewable(props, emit, 'NotePlayback');\n const questionUtils = useQuestionView<PlayNote>(viewableUtils);\n\n // State\n const midi = ref<SkMidi>();\n const initialized = ref(false);\n const recording = ref(false);\n const playbackProgress = ref(0);\n const playbackStartTime = ref(moment.utc());\n const attempts = ref(0);\n const gradedSeq = ref<SyllableSequence>(eventsToSyllableSequence([]));\n const graded = ref(false);\n const inputSeq = ref<SyllableSequence>(eventsToSyllableSequence([]));\n const note = ref('');\n\n // Initialize question\n questionUtils.question.value = new PlayNote(props.data);\n\n // Computed\n const question = computed(() => new PlayNote(props.data));\n\n // Methods\n const record = () => {\n midi.value?.record();\n recording.value = true;\n\n // attach listeners\n midi.value?.addNoteonListenter((e) => {\n inputSeq.value.append(e);\n });\n\n midi.value?.addNoteoffListenter(() => {\n if (midi.value?.recording?.length && midi.value?.recording?.length >= 2) {\n submit();\n }\n });\n };\n\n const play = () => {\n midi.value?.stopRecording();\n midi.value?.eraseRecording();\n playbackStartTime.value = moment.utc();\n recording.value = false;\n playbackProgress.value = 0;\n\n record();\n };\n\n const submit = () => {\n if (!midi.value?.recording) return false;\n\n inputSeq.value = eventsToSyllableSequence([]);\n\n if (!questionUtils.submitAnswer(midi.value.recording).isCorrect) {\n attempts.value++;\n graded.value = true;\n if (attempts.value < questionUtils.maxAttemptsPerView.value) {\n play();\n }\n return false;\n }\n return true;\n };\n\n // Lifecycle\n onMounted(async () => {\n try {\n midi.value = await SkMidi.instance();\n note.value = question.value.note;\n play();\n initialized.value = true;\n } catch (error) {\n viewableUtils.logger.error('Failed to initialize MIDI:', error);\n }\n });\n\n return {\n ...viewableUtils,\n ...questionUtils,\n initialized,\n recording,\n inputSeq,\n gradedSeq,\n graded,\n note,\n attempts,\n };\n },\n});\n</script>\n\n<style lang=\"css\">\n@keyframes progress {\n 0% {\n width: 0%;\n }\n\n 100% {\n width: 100%;\n }\n}\n\n.progressContainer {\n background-color: #eee;\n height: 5px;\n}\n\n#progress {\n background-color: blue;\n width: 100%;\n height: 5px;\n animation-timing-function: linear;\n}\n\n.hidden {\n opacity: 0;\n}\n</style>\n","<template>\n <div data-viewable=\"NotePlayback\">\n <div class=\"text-h4\">\n Play the note: <span class=\"font-weight-bold\">{{ note }}</span>\n </div>\n\n <svg\n v-if=\"graded\"\n id=\"svg8\"\n width=\"300px\"\n height=\"auto\"\n xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n xmlns:cc=\"http://creativecommons.org/ns#\"\n xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n xmlns:svg=\"http://www.w3.org/2000/svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\"\n xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n sodipodi:docname=\"keys.svg\"\n inkscape:version=\"1.0rc1 (09960d6f05, 2020-04-09)\"\n version=\"1.1\"\n viewBox=\"0 0 175.24936 73.594925\"\n >\n <defs id=\"defs2\" />\n <sodipodi:namedview\n id=\"base\"\n inkscape:window-maximized=\"1\"\n inkscape:window-y=\"726\"\n inkscape:window-x=\"1491\"\n inkscape:window-height=\"1321\"\n inkscape:window-width=\"2400\"\n showborder=\"false\"\n showgrid=\"false\"\n inkscape:document-rotation=\"0\"\n inkscape:current-layer=\"layer1\"\n inkscape:document-units=\"mm\"\n inkscape:cy=\"255.88343\"\n inkscape:cx=\"754.94284\"\n inkscape:zoom=\"0.98994949\"\n inkscape:pageshadow=\"2\"\n inkscape:pageopacity=\"0.0\"\n borderopacity=\"1.0\"\n bordercolor=\"#666666\"\n pagecolor=\"#ffffff\"\n />\n <metadata id=\"metadata5\">\n <rdf:RDF>\n <cc:Work rdf:about=\"\">\n <dc:format>image/svg+xml</dc:format>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\" />\n <dc:title></dc:title>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <g id=\"layer1\" transform=\"translate(167.75219,-151.96011)\" inkscape:groupmode=\"layer\" inkscape:label=\"Layer 1\">\n <rect\n id=\"rect845\"\n y=\"152.19064\"\n x=\"-150.12129\"\n height=\"73.220116\"\n width=\"17.486626\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n />\n <rect\n id=\"rect845-9\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"17.486626\"\n height=\"73.220116\"\n x=\"-132.63466\"\n y=\"152.19064\"\n />\n <rect\n id=\"rect845-6\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"17.486626\"\n height=\"73.220116\"\n x=\"-115.14803\"\n y=\"152.19064\"\n />\n <rect\n id=\"rect845-0\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"17.486626\"\n height=\"73.220116\"\n x=\"-45.20153\"\n y=\"152.19064\"\n />\n <rect\n id=\"rect845-92\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"17.486626\"\n height=\"73.220116\"\n x=\"-80.174782\"\n y=\"152.19064\"\n />\n <rect\n id=\"rect845-3\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"17.486626\"\n height=\"73.220116\"\n x=\"-62.688156\"\n y=\"152.19064\"\n />\n <rect\n id=\"rect845-4\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"17.486626\"\n height=\"73.220116\"\n x=\"-97.661407\"\n y=\"152.19064\"\n />\n <rect\n id=\"rect845-30\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"17.486626\"\n height=\"73.220116\"\n x=\"-27.714905\"\n y=\"152.10745\"\n />\n <rect\n id=\"rect898\"\n ry=\"0\"\n y=\"152.10744\"\n x=\"-138.43532\"\n height=\"54.415863\"\n width=\"10.466455\"\n style=\"\n fill: #000000;\n fill-opacity: 1;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n />\n <rect\n id=\"rect898-3\"\n style=\"\n fill: #000000;\n fill-opacity: 1;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"10.466455\"\n height=\"54.415863\"\n x=\"-120.84978\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <rect\n id=\"rect898-7\"\n style=\"\n fill: #000000;\n fill-opacity: 1;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"10.466455\"\n height=\"54.415863\"\n x=\"-85.678711\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <rect\n id=\"rect898-8\"\n style=\"\n fill: #000000;\n fill-opacity: 1;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"10.466455\"\n height=\"54.415863\"\n x=\"-68.09317\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <rect\n id=\"rect898-1\"\n style=\"\n fill: #000000;\n fill-opacity: 1;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"10.466455\"\n height=\"54.415863\"\n x=\"-50.507633\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <rect\n id=\"rect845-30-1\"\n y=\"152.10745\"\n x=\"-10.228278\"\n height=\"73.220116\"\n width=\"17.486626\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n />\n <rect\n id=\"rect845-30-9\"\n y=\"152.10744\"\n x=\"-167.60791\"\n height=\"73.220116\"\n width=\"17.486626\"\n style=\"\n fill: #ffffff;\n fill-opacity: 0;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n />\n <rect\n id=\"rect898-4\"\n style=\"\n fill: #000000;\n fill-opacity: 1;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"10.466455\"\n height=\"54.415863\"\n x=\"-15.336554\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <rect\n id=\"rect898-74\"\n style=\"\n fill: #000000;\n fill-opacity: 1;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"4.4679713\"\n height=\"54.415863\"\n x=\"-167.60791\"\n y=\"152.10744\"\n ry=\"0\"\n />\n <rect\n id=\"rect898-10\"\n style=\"\n fill: #000000;\n fill-opacity: 1;\n stroke: #000000;\n stroke-width: 0.79375;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-opacity: 1;\n \"\n width=\"5.1863246\"\n height=\"54.507248\"\n x=\"2.2092075\"\n y=\"152.06175\"\n ry=\"0\"\n />\n </g>\n </svg>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, ref, computed, PropType, onMounted } from 'vue';\nimport { useViewable, useQuestionView } from '@vue-skuilder/common-ui';\nimport SkMidi, { eventsToSyllableSequence, SyllableSequence } from '../../utility/midi';\nimport { PlayNote } from '.';\nimport moment from 'moment';\nimport { ViewData } from '@vue-skuilder/common';\n\nexport default defineComponent({\n name: 'NotePlayback',\n\n components: {},\n\n props: {\n data: {\n type: Array as PropType<ViewData[]>,\n required: true,\n },\n modifyDifficulty: {\n type: Number,\n required: false,\n default: 0,\n },\n },\n\n setup(props, { emit }) {\n const viewableUtils = useViewable(props, emit, 'NotePlayback');\n const questionUtils = useQuestionView<PlayNote>(viewableUtils);\n\n // State\n const midi = ref<SkMidi>();\n const initialized = ref(false);\n const recording = ref(false);\n const playbackProgress = ref(0);\n const playbackStartTime = ref(moment.utc());\n const attempts = ref(0);\n const gradedSeq = ref<SyllableSequence>(eventsToSyllableSequence([]));\n const graded = ref(false);\n const inputSeq = ref<SyllableSequence>(eventsToSyllableSequence([]));\n const note = ref('');\n\n // Initialize question\n questionUtils.question.value = new PlayNote(props.data);\n\n // Computed\n const question = computed(() => new PlayNote(props.data));\n\n // Methods\n const record = () => {\n midi.value?.record();\n recording.value = true;\n\n // attach listeners\n midi.value?.addNoteonListenter((e) => {\n inputSeq.value.append(e);\n });\n\n midi.value?.addNoteoffListenter(() => {\n if (midi.value?.recording?.length && midi.value?.recording?.length >= 2) {\n submit();\n }\n });\n };\n\n const play = () => {\n midi.value?.stopRecording();\n midi.value?.eraseRecording();\n playbackStartTime.value = moment.utc();\n recording.value = false;\n playbackProgress.value = 0;\n\n record();\n };\n\n const submit = () => {\n if (!midi.value?.recording) return false;\n\n inputSeq.value = eventsToSyllableSequence([]);\n\n if (!questionUtils.submitAnswer(midi.value.recording).isCorrect) {\n attempts.value++;\n graded.value = true;\n if (attempts.value < questionUtils.maxAttemptsPerView.value) {\n play();\n }\n return false;\n }\n return true;\n };\n\n // Lifecycle\n onMounted(async () => {\n try {\n midi.value = await SkMidi.instance();\n note.value = question.value.note;\n play();\n initialized.value = true;\n } catch (error) {\n viewableUtils.logger.error('Failed to initialize MIDI:', error);\n }\n });\n\n return {\n ...viewableUtils,\n ...questionUtils,\n initialized,\n recording,\n inputSeq,\n gradedSeq,\n graded,\n note,\n attempts,\n };\n },\n});\n</script>\n\n<style lang=\"css\">\n@keyframes progress {\n 0% {\n width: 0%;\n }\n\n 100% {\n width: 100%;\n }\n}\n\n.progressContainer {\n background-color: #eee;\n height: 5px;\n}\n\n#progress {\n background-color: blue;\n width: 100%;\n height: 5px;\n animation-timing-function: linear;\n}\n\n.hidden {\n opacity: 0;\n}\n</style>\n","import { Question } from '@vue-skuilder/common-ui';\nimport { DataShape, FieldDefinition } from '@vue-skuilder/common';\nimport { ViewData, DataShapeName, FieldType } from '@vue-skuilder/common';\nimport { NoteEvent } from '../../utility/midi';\nimport NotePlayback from './NotePlayback.vue';\n\nconst fields: FieldDefinition[] = [\n {\n name: 'Note',\n type: FieldType.STRING,\n },\n];\n\nexport const inputs: string[] = [\n 'A',\n 'B',\n 'C',\n 'D',\n 'E',\n 'F',\n 'G',\n 'A♯', // sharps\n 'C♯',\n 'D♯',\n 'F♯',\n 'G♯',\n 'D♭', // flats\n 'E♭',\n 'G♭',\n 'A♭',\n 'B♭',\n];\n\nexport class PlayNote extends Question {\n public static dataShapes: DataShape[] = [\n {\n fields,\n name: DataShapeName.PIANO_PlayNote,\n },\n ];\n\n public static seedData = inputs.map((n) => {\n return {\n Note: n,\n };\n });\n\n public static views = [NotePlayback];\n\n public note: string;\n\n constructor(data: ViewData[]) {\n super(data);\n this.note = data[0].Note as unknown as string;\n }\n\n public isCorrect(answer: NoteEvent[]): boolean {\n return answer[0].note.name === this.note;\n }\n\n public dataShapes(): DataShape[] {\n return PlayNote.dataShapes;\n }\n public views() {\n return PlayNote.views;\n }\n}\n","import { CourseWare } from '../CourseWare';\nimport { EchoQuestion } from './questions/echo';\nimport { PlayNote } from './questions/playNote';\n\nconst piano: CourseWare = new CourseWare('piano', [EchoQuestion, PlayNote]);\n\nexport default piano;\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],"mappings":"6NA8BC,SAAS,EAAM,CAAC,aAAa,SAAS,SAAS,CAAC,GAAG,QAAQ,UAAU,WAAW,MAAU,MAAM,8DAA8D,CAAC,CAAC,QAAQ,UAAU,WAAW,MAAM,QAAQ,EAAE,CAAC,KAAK,SAAS,EAAE,CAAC,KAAK,cAAc,EAAE,CAAC,KAAK,kBAAkB,EAAE,CAAC,KAAK,uBAAuB,CAAC,EAAE,KAAK,qBAAqB,CAAC,YAAY,eAAe,CAAC,KAAK,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,mBAAmB,CAAC,EAAE,KAAK,WAAW,CAAC,QAAQ,YAAY,YAAY,CAAC,KAAK,OAAO,CAAC,IAAI,KAAK,IAAI,KAAK,IAAI,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,CAAC,KAAK,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,OAAO,iBAAiB,KAAK,CAAC,qBAAq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