1
0
mirror of https://github.com/StarGazer114/stargazer114.github.io.git synced 2025-01-09 06:48:17 +08:00
stargazer114.github.io/pluginsSrc/abcjs/dist/abcjs-basic-min.js

3 lines
472 KiB
JavaScript
Raw Normal View History

2025-01-05 20:41:38 +08:00
/*! abcjs_basic v6.4.4 Copyright © 2009-2024 Paul Rosen and Gregory Dyke (https://abcjs.net) */
/*! For license information please see abcjs_basic.LICENSE */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.abcjs=t():e.ABCJS=t()}(this,(function(){return e={1045:function(e,t,r){var n=r(1185),a=r(6306),i=r(1592),s=r(1028),o=r(5633),c={};c.signature="abcjs-basic v"+n,Object.keys(a).forEach((function(e){c[e]=a[e]})),Object.keys(i).forEach((function(e){c[e]=i[e]})),c.renderAbc=r(6859),c.tuneMetrics=r(9989),c.TimingCallbacks=r(5681);var l=r(6020);c.setGlyph=l.setSymbol,c.strTranspose=o;var h=r(5594),u=r(8471),d=r(522),f=r(2029),p=r(6313),m=r(5281),g=r(8702),v=r(5049),b=r(4718),y=r(3450),x=r(562),k=r(9991);c.synth={CreateSynth:h,instrumentIndexToName:u,pitchToNoteName:d,SynthController:y,SynthSequence:f,CreateSynthControl:p,registerAudioContext:m,activeAudioContext:g,supportsAudio:v,playEvent:b,getMidiFile:x,sequence:s,midiRenderer:k},c.Editor=r(5294),c.EditArea=r(2945),e.exports=c},6306:function(e,t,r){var n=r(5681),a={};!function(){"use strict";var e,t;a.startAnimation=function(r,a,i){function s(e){for(var t=0;t<e.length;t++){var r=e[t];r.classList.contains("abcjs-bar")||(r.style.display="none")}}var o;function c(e){i.hideCurrentMeasure?function(e){s(r.querySelectorAll(e))}(e):i.hideFinishedMeasures&&function(e){o&&s(r.querySelectorAll(o)),o=e}(e)}e&&(e.stop(),e=void 0),i.showCursor&&((t=r.querySelector(".abcjs-cursor"))||((t=document.createElement("DIV")).className="abcjs-cursor cursor",t.style.position="absolute",r.appendChild(t),r.style.position="relative")),(e=new n(a,{qpm:i.bpm,eventCallback:function(r){if(r){if(r.measureStart){var n=".abcjs-l"+(a=r).line+".abcjs-m"+a.measureNumber;n&&c(n)}t&&(t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=r.width+"px",t.style.height=r.height+"px")}else e.stop(),e=void 0;var a}})).start()},a.pauseAnimation=function(t){e&&(t?e.pause():e.start())},a.stopAnimation=function(){e&&(e.stop(),e=void 0)}}(),e.exports=a},5681:function(e){e.exports=function(e,t){var r=this;if(t||(t={}),r.qpm=t.qpm?parseInt(t.qpm,10):null,!r.qpm){var n=e.metaText?e.metaText.tempo:null;r.qpm=e.getBpm(n)}r.extraMeasuresAtBeginning=t.extraMeasuresAtBeginning?parseInt(t.extraMeasuresAtBeginning,10):0,r.beatCallback=t.beatCallback,r.eventCallback=t.eventCallback,r.lineEndCallback=t.lineEndCallback,r.lineEndAnticipation=t.lineEndAnticipation?parseInt(t.lineEndAnticipation,10):0,r.beatSubdivisions=t.beatSubdivisions?parseInt(t.beatSubdivisions,10):1,r.joggerTimer=null,r.replaceTarget=function(e){r.noteTimings=e.setTiming(r.qpm,r.extraMeasuresAtBeginning),0===e.noteTimings.length&&(r.noteTimings=e.setTiming(0,0)),r.lineEndCallback&&(r.lineEndTimings=function(e,t){for(var r=[],n=null,a=0;a<e.length;a++){var i=e[a];"end"!==i.type&&i.top!==n&&(r.push({measureNumber:i.measureNumber,milliseconds:i.milliseconds-t,top:i.top,bottom:i.top+i.height}),n=i.top)}return r}(e.noteTimings,r.lineEndAnticipation)),r.startTime=null,r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.currentTime=0,r.isPaused=!1,r.isRunning=!1,r.pausedPercent=null,r.justUnpaused=!1,r.newSeekPercent=0,r.lastTimestamp=0,0!==r.noteTimings.length&&(r.millisecondsPerBeat=1e3/(r.qpm/60)/r.beatSubdivisions,r.lastMoment=r.noteTimings[r.noteTimings.length-1].milliseconds,r.totalBeats=Math.round(r.lastMoment/r.millisecondsPerBeat))},r.replaceTarget(e),r.doTiming=function(e){if(r.lastTimestamp!==e&&(r.lastTimestamp=e,r.startTime||(r.startTime=e),!r.isPaused&&r.isRunning)){for(r.currentTime=e-r.startTime,r.currentTime+=16;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;){if(r.eventCallback&&"event"===r.noteTimings[r.currentEvent].type){var t=r.startTime;r.eventCallback(r.noteTimings[r.currentEvent]),t!==r.startTime&&(r.currentTime=e-r.startTime)}r.currentEvent++}if(r.lineEndCallback&&r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds<r.currentTime&&r.currentEvent<r.noteTimings.length){var n=r.noteTimings[r.currentEvent].milliseconds===r.currentTime?r.noteTimings[r.currentEvent]:r.noteTimings[r.currentEvent-1];r.lineEnd