UNPKG

orpheus-osmd

Version:

An open source JavaScript engine for displaying MusicXML based on VexFlow.

1 lines 1.6 MB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.opensheetmusicdisplay=e():t.opensheetmusicdisplay=e()}(this,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=75)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});class i{constructor(t=0,e=1,n=0,i=!0){this.numerator=0,this.denominator=1,this.wholeValue=0,this.numerator=t,this.denominator=e,this.wholeValue=n,i&&this.simplify(),this.setRealValue()}static max(t,e){return t.RealValue>e.RealValue?t:e}static Equal(t,e){return t.wholeValue===e.wholeValue&&t.Denominator===e.Denominator&&t.Numerator===e.Numerator}static createFromFraction(t){return new i(t.numerator,t.denominator,t.wholeValue,!1)}static plus(t,e){const n=t.clone();return n.Add(e),n}static minus(t,e){const n=t.clone();return n.Sub(e),n}static multiply(t,e){return new i((t.wholeValue*t.denominator+t.numerator)*(e.wholeValue*e.denominator+e.numerator),t.denominator*e.denominator)}static greatestCommonDenominator(t,e){if(0===t)return e;if(1===e)return 1;for(;0!==e;)t>e?t-=e:e-=t;return t}toString(){let t=this.numerator+"/"+this.denominator;return 0!==this.wholeValue&&(t=this.wholeValue+" "+t),t}clone(){return new i(this.numerator,this.denominator,this.wholeValue,!1)}get Numerator(){return this.numerator}set Numerator(t){this.numerator!==t&&(this.numerator=t,this.simplify(),this.setRealValue())}get Denominator(){return this.denominator}set Denominator(t){this.denominator!==t&&(this.denominator=t,0!==this.numerator&&this.simplify(),this.setRealValue())}get WholeValue(){return this.wholeValue}set WholeValue(t){this.wholeValue!==t&&(this.wholeValue=t,this.setRealValue())}GetExpandedNumerator(){return this.wholeValue*this.denominator+this.numerator}IsNegative(){return this.realValue<0}get RealValue(){return this.realValue}expand(t){this.numerator*=t,this.denominator*=t,0!==this.wholeValue&&(this.numerator+=this.wholeValue*this.denominator,this.wholeValue=0)}Add(t){this.numerator=(this.wholeValue*this.denominator+this.numerator)*t.denominator+(t.wholeValue*t.denominator+t.numerator)*this.denominator,this.denominator=this.denominator*t.denominator,this.wholeValue=0,this.simplify(),this.setRealValue()}Sub(t){this.numerator=(this.wholeValue*this.denominator+this.numerator)*t.denominator-(t.wholeValue*t.denominator+t.numerator)*this.denominator,this.denominator=this.denominator*t.denominator,this.wholeValue=0,this.simplify(),this.setRealValue()}Quantize(t){if(this.denominator<=t)return this;const e=new i(this.numerator+1,this.denominator,this.wholeValue);for(;e.Denominator>t;)e.Numerator++;if(this.numerator>this.denominator){const n=new i(this.numerator-1,this.denominator,this.wholeValue);for(;n.Denominator>t;)n.Numerator--;if(n.Denominator<e.Denominator)return n}return e}Equals(t){return this.realValue===t.realValue}CompareTo(t){const e=this.realValue-t.realValue;return e?e<0?-1:1:0}lt(t){return this.realValue<t.realValue}lte(t){return this.realValue<=t.realValue}gt(t){return!this.lte(t)}gte(t){return!this.lt(t)}setRealValue(){this.realValue=this.wholeValue+this.numerator/this.denominator}simplify(){if(0===this.numerator)return void(this.denominator=1);const t=i.greatestCommonDenominator(Math.abs(this.numerator),Math.abs(this.denominator));this.numerator/=t,this.denominator/=t;const e=Math.floor(this.numerator/this.denominator);if(0!==e&&(this.wholeValue+=e,this.numerator-=e*this.denominator,0===this.numerator&&(this.denominator=1)),this.denominator>i.maximumAllowedNumber){const t=this.denominator/i.maximumAllowedNumber;this.numerator=Math.round(this.numerator/t),this.denominator=Math.round(this.denominator/t)}if(this.numerator>i.maximumAllowedNumber){const t=this.numerator/i.maximumAllowedNumber;this.numerator=Math.round(this.numerator/t),this.denominator=Math.round(this.denominator/t)}}isOnBeat(t){const e=this.distanceFromBeat(t);return Math.abs(e)<i.FloatInaccuracyTolerance}distanceFromBeat(t){const e=new i(1,t.Denominator);return this.RealValue%e.RealValue}}e.Fraction=i,i.maximumAllowedNumber=46340,i.FloatInaccuracyTolerance=1e-4},function(t,e,n){var i,r;!function(s,o){"use strict";void 0===(r="function"==typeof(i=function(){var t=function(){},e="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function i(t,e){var n=t[e];if("function"==typeof n.bind)return n.bind(t);try{return Function.prototype.bind.call(n,t)}catch(e){return function(){return Function.prototype.apply.apply(n,[t,arguments])}}}function r(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(n){return"debug"===n&&(n="log"),"undefined"!=typeof console&&("trace"===n&&e?r:void 0!==console[n]?i(console,n):void 0!==console.log?i(console,"log"):t)}function o(e,i){for(var r=0;r<n.length;r++){var s=n[r];this[s]=r<e?t:this.methodFactory(s,e,i)}this.log=this.debug}function a(t,e,n){return function(){"undefined"!=typeof console&&(o.call(this,e,n),this[t].apply(this,arguments))}}function l(t,e,n){return s(t)||a.apply(this,arguments)}function u(t,e,i){var r,s=this,a="loglevel";function u(){var t;if("undefined"!=typeof window){try{t=window.localStorage[a]}catch(t){}if(void 0===t)try{var e=window.document.cookie,n=e.indexOf(encodeURIComponent(a)+"=");-1!==n&&(t=/^([^;]+)/.exec(e.slice(n))[1])}catch(t){}return void 0===s.levels[t]&&(t=void 0),t}}t&&(a+=":"+t),s.name=t,s.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},s.methodFactory=i||l,s.getLevel=function(){return r},s.setLevel=function(e,i){if("string"==typeof e&&void 0!==s.levels[e.toUpperCase()]&&(e=s.levels[e.toUpperCase()]),!("number"==typeof e&&e>=0&&e<=s.levels.SILENT))throw"log.setLevel() called with invalid level: "+e;if(r=e,!1!==i&&function(t){var e=(n[t]||"silent").toUpperCase();if("undefined"!=typeof window){try{return void(window.localStorage[a]=e)}catch(t){}try{window.document.cookie=encodeURIComponent(a)+"="+e+";"}catch(t){}}}(e),o.call(s,e,t),"undefined"==typeof console&&e<s.levels.SILENT)return"No console available for logging"},s.setDefaultLevel=function(t){u()||s.setLevel(t,!1)},s.enableAll=function(t){s.setLevel(s.levels.TRACE,t)},s.disableAll=function(t){s.setLevel(s.levels.SILENT,t)};var c=u();null==c&&(c=null==e?"WARN":e),s.setLevel(c,!1)}var c=new u,h={};c.getLogger=function(t){if("string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=h[t];return e||(e=h[t]=new u(t,c.getLevel(),c.methodFactory)),e};var f="undefined"!=typeof window?window.log:void 0;return c.noConflict=function(){return"undefined"!=typeof window&&window.log===c&&(window.log=f),c},c.getLoggers=function(){return h},c})?i.call(e,n,e,t):i)||(t.exports=r)}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(40),r=n(1),s=n(8),o=n(7),a=n(39),l=n(29);class u{constructor(){this.noteDistances=[1,1,1.3,1.6,2,2.5,3,4],this.noteDistancesScalingFactors=[1,2,4,8,16,32,64,128],this.durationDistanceDict={},this.durationScalingDistanceDict={},this.samplingUnit=3*u.unit,this.sheetTitleHeight=4,this.sheetSubtitleHeight=2,this.sheetMinimumDistanceBetweenTitleAndSubtitle=1,this.sheetComposerHeight=2,this.sheetAuthorHeight=2,this.compactMode=!1,this.pagePlacementEnum=i.PagePlacementEnum.Down,this.pageHeight=100001,this.pageTopMargin=5,this.pageTopMarginNarrow=0,this.pageBottomMargin=5,this.pageLeftMargin=5,this.pageRightMargin=5,this.titleTopDistance=9,this.titleBottomDistance=1,this.staffDistance=7,this.betweenStaffDistance=5,this.staffHeight=4,this.betweenStaffLinesDistance=u.unit,this.systemLeftMargin=0,this.systemRightMargin=0,this.firstSystemMargin=15,this.systemLabelsRightMargin=2,this.systemComposerDistance=2,this.instrumentLabelTextHeight=2,this.minimumDistanceBetweenSystems=4,this.lastSystemMaxScalingFactor=1.4,this.autoBeamNotes=!1,this.autoBeamOptions={beam_middle_rests_only:!1,beam_rests:!1,maintain_stem_directions:!1},this.beamWidth=u.unit/2,this.beamSpaceWidth=u.unit/3,this.beamForwardLength=1.25*u.unit,this.clefLeftMargin=.5,this.clefRightMargin=.75,this.betweenKeySymbolsDistance=.2,this.keyRightMargin=.75,this.rhythmRightMargin=1.25,this.inStaffClefScalingFactor=.8,this.distanceBetweenNaturalAndSymbolWhenCancelling=.4,this.noteHelperLinesOffset=.25,this.measureLeftMargin=.7,this.measureRightMargin=0,this.distanceBetweenLastInstructionAndRepetitionBarline=1,this.arpeggioDistance=.6,this.staccatoShorteningFactor=2,this.idealStemLength=3,this.stemNoteHeadBorderYOffset=.2,this.stemWidth=.13,this.stemMargin=.2,this.stemMinLength=2.5,this.stemMaxLength=4.5,this.beamSlopeMaxAngle=10,this.stemMinAllowedDistanceBetweenNoteHeadAndBeamLine=1,this.setWantedStemDirectionByXml=!0,this.graceNoteScalingFactor=.6,this.graceNoteXOffset=.2,this.wedgeOpeningLength=1.2,this.wedgeMeasureEndOpeningLength=.75,this.wedgeMeasureBeginOpeningLength=.75,this.wedgePlacementAboveY=-1.5,this.wedgePlacementBelowY=1.5,this.wedgeHorizontalMargin=.6,this.wedgeVerticalMargin=.5,this.distanceOffsetBetweenTwoHorizontallyCrossedWedges=.3,this.wedgeMinLength=2,this.distanceBetweenAdjacentDynamics=.75,this.tempoChangeMeasureValidity=4,this.tempoContinousFactor=.7,this.staccatoScalingFactor=.8,this.betweenDotsDistance=.8,this.ornamentAccidentalScalingFactor=.65,this.chordSymbolTextHeight=2,this.chordSymbolXSpacing=1,this.chordSymbolYOffset=2,this.fingeringLabelFontHeight=1.7,this.measureNumberLabelHeight=1.5*u.unit,this.measureNumberLabelOffset=2,this.tupletsRatioed=!1,this.tupletsBracketed=!1,this.tripletsBracketed=!1,this.tupletNumberLabelHeight=1.5*u.unit,this.tupletNumberYOffset=.5,this.labelMarginBorderFactor=.1,this.tupletVerticalLineLength=.5,this.bezierCurveStepSize=1e3,this.calculateCurveParametersArrays(),this.tieGhostObjectWidth=.75,this.tieYPositionOffsetFactor=.3,this.minimumNeededXspaceForTieGhostObject=1,this.tieHeightMinimum=.28,this.tieHeightMaximum=1.2,this.tieHeightInterpolationK=.0288,this.tieHeightInterpolationD=.136,this.slurNoteHeadYOffset=.5,this.slurStemXOffset=.3,this.slurSlopeMaxAngle=15,this.slurTangentMinAngle=30,this.slurTangentMaxAngle=80,this.slursStartingAtSameStaffEntryYOffset=.8,this.repetitionEndingLabelHeight=2,this.repetitionEndingLabelXOffset=.5,this.repetitionEndingLabelYOffset=.3,this.repetitionEndingLineYLowerOffset=.5,this.repetitionEndingLineYUpperOffset=.3,this.lyricsAlignmentStandard=s.TextAlignmentEnum.LeftBottom,this.lyricsHeight=2,this.lyricsYOffsetToStaffHeight=3,this.verticalBetweenLyricsDistance=.5,this.horizontalBetweenLyricsDistance=.2,this.betweenSyllableMaximumDistance=10,this.betweenSyllableMinimumDistance=.5,this.lyricOverlapAllowedIntoNextMeasure=3.4,this.minimumDistanceBetweenDashes=10,this.instantaneousTempoTextHeight=2.3,this.continuousDynamicTextHeight=2.3,this.moodTextHeight=2.3,this.unknownTextHeight=2,this.continuousTempoTextHeight=2.3,this.dynamicExpressionMaxDistance=2,this.dynamicExpressionSpacer=.5,this.staffLineWidth=.12,this.ledgerLineWidth=.12,this.wedgeLineWidth=.12,this.tupletLineWidth=.12,this.lyricUnderscoreLineWidth=.12,this.systemThinLineWidth=.12,this.systemBoldLineWidth=u.unit/2,this.systemRepetitionEndingLineWidth=.12,this.systemDotWidth=u.unit/5,this.distanceBetweenVerticalSystemLines=.35,this.distanceBetweenDotAndLine=.7,this.octaveShiftLineWidth=.12,this.octaveShiftVerticalLineLength=u.unit,this.graceLineWidth=this.staffLineWidth*this.GraceNoteScalingFactor,this.minimumStaffLineDistance=1,this.minimumCrossedBeamDifferenceMargin=1e-4,this.displacedNoteMargin=.1,this.minNoteDistance=2,this.subMeasureXSpacingThreshold=35,this.measureDynamicsMaxScalingFactor=2.5,this.wholeRestXShiftVexflow=-2.5,this.metronomeMarkXShift=-6,this.metronomeMarkYShift=-.5,this.alignRests=a.AlignRestOption.Never,this.fillEmptyMeasuresWithWholeRest=a.FillEmptyMeasuresWithWholeRests.No,this.arpeggiosGoAcrossVoices=!1,this.renderArpeggios=!0,this.renderSlurs=!0,this.coloringMode=l.ColoringModes.XML,this.coloringEnabled=!0,this.colorStemsLikeNoteheads=!1,this.colorBeams=!0,this.colorFlags=!0,this.defaultColorNotehead="#000000",this.defaultColorRest=this.defaultColorNotehead,this.defaultColorStem=this.defaultColorNotehead,this.defaultColorLabel=this.defaultColorNotehead,this.defaultColorTitle=this.defaultColorNotehead,this.defaultFontFamily="Times New Roman",this.maxMeasureToDrawIndex=Number.MAX_VALUE,this.minMeasureToDrawIndex=0,this.renderComposer=!0,this.renderTitle=!0,this.renderSubtitle=!0,this.renderLyricist=!0,this.renderPartNames=!0,this.renderPartAbbreviations=!0,this.renderFingerings=!0,this.renderMeasureNumbers=!0,this.renderLyrics=!0,this.fingeringPosition=o.PlacementEnum.Left,this.fingeringInsideStafflines=!1,this.fixStafflineBoundingBox=!1,this.pageFormat=c.UndefinedPageFormat,this.pageBackgroundColor=void 0,this.renderSingleHorizontalStaffline=!1,this.populateDictionaries();try{this.maxInstructionsConstValue=this.ClefLeftMargin+this.ClefRightMargin+this.KeyRightMargin+this.RhythmRightMargin+11}catch(t){r.info("EngravingRules()",t)}}static get Rules(){return void 0!==u.rules?u.rules:u.rules=new u}get SamplingUnit(){return this.samplingUnit}get SheetTitleHeight(){return this.sheetTitleHeight}set SheetTitleHeight(t){this.sheetTitleHeight=t}get SheetSubtitleHeight(){return this.sheetSubtitleHeight}set SheetSubtitleHeight(t){this.sheetSubtitleHeight=t}get SheetMinimumDistanceBetweenTitleAndSubtitle(){return this.sheetMinimumDistanceBetweenTitleAndSubtitle}set SheetMinimumDistanceBetweenTitleAndSubtitle(t){this.sheetMinimumDistanceBetweenTitleAndSubtitle=t}get SheetComposerHeight(){return this.sheetComposerHeight}set SheetComposerHeight(t){this.sheetComposerHeight=t}get SheetAuthorHeight(){return this.sheetAuthorHeight}set SheetAuthorHeight(t){this.sheetAuthorHeight=t}get PagePlacement(){return this.pagePlacementEnum}set PagePlacement(t){this.pagePlacementEnum=t}get CompactMode(){return this.compactMode}set CompactMode(t){this.compactMode=t}get PageHeight(){return this.pageHeight}set PageHeight(t){this.pageHeight=t}get PageTopMargin(){return this.pageTopMargin}set PageTopMargin(t){this.pageTopMargin=t}get PageTopMarginNarrow(){return this.pageTopMarginNarrow}set PageTopMarginNarrow(t){this.pageTopMarginNarrow=t}get PageBottomMargin(){return this.pageBottomMargin}set PageBottomMargin(t){this.pageBottomMargin=t}get PageLeftMargin(){return this.pageLeftMargin}set PageLeftMargin(t){this.pageLeftMargin=t}get PageRightMargin(){return this.pageRightMargin}set PageRightMargin(t){this.pageRightMargin=t}get TitleTopDistance(){return this.titleTopDistance}set TitleTopDistance(t){this.titleTopDistance=t}get TitleBottomDistance(){return this.titleBottomDistance}set TitleBottomDistance(t){this.titleBottomDistance=t}get SystemComposerDistance(){return this.systemComposerDistance}set SystemComposerDistance(t){this.systemComposerDistance=t}get InstrumentLabelTextHeight(){return this.instrumentLabelTextHeight}set InstrumentLabelTextHeight(t){this.instrumentLabelTextHeight=t}get SystemLeftMargin(){return this.systemLeftMargin}set SystemLeftMargin(t){this.systemLeftMargin=t}get SystemRightMargin(){return this.systemRightMargin}set SystemRightMargin(t){this.systemRightMargin=t}get FirstSystemMargin(){return this.firstSystemMargin}set FirstSystemMargin(t){this.firstSystemMargin=t}get SystemLabelsRightMargin(){return this.systemLabelsRightMargin}set SystemLabelsRightMargin(t){this.systemLabelsRightMargin=t}get MinimumDistanceBetweenSystems(){return this.minimumDistanceBetweenSystems}set MinimumDistanceBetweenSystems(t){this.minimumDistanceBetweenSystems=t}get LastSystemMaxScalingFactor(){return this.lastSystemMaxScalingFactor}set LastSystemMaxScalingFactor(t){this.lastSystemMaxScalingFactor=t}get StaffDistance(){return this.staffDistance}set StaffDistance(t){this.staffDistance=t}get BetweenStaffDistance(){return this.betweenStaffDistance}set BetweenStaffDistance(t){this.betweenStaffDistance=t}get StaffHeight(){return this.staffHeight}set StaffHeight(t){this.staffHeight=t}get BetweenStaffLinesDistance(){return this.betweenStaffLinesDistance}set BetweenStaffLinesDistance(t){this.betweenStaffLinesDistance=t}get AutoBeamNotes(){return this.autoBeamNotes}set AutoBeamNotes(t){this.autoBeamNotes=t}get AutoBeamOptions(){return this.autoBeamOptions}set AutoBeamOptions(t){this.autoBeamOptions=t}get BeamWidth(){return this.beamWidth}set BeamWidth(t){this.beamWidth=t}get BeamSpaceWidth(){return this.beamSpaceWidth}set BeamSpaceWidth(t){this.beamSpaceWidth=t}get BeamForwardLength(){return this.beamForwardLength}set BeamForwardLength(t){this.beamForwardLength=t}get BetweenKeySymbolsDistance(){return this.betweenKeySymbolsDistance}set BetweenKeySymbolsDistance(t){this.betweenKeySymbolsDistance=t}get ClefLeftMargin(){return this.clefLeftMargin}set ClefLeftMargin(t){this.clefLeftMargin=t}get ClefRightMargin(){return this.clefRightMargin}set ClefRightMargin(t){this.clefRightMargin=t}get KeyRightMargin(){return this.keyRightMargin}set KeyRightMargin(t){this.keyRightMargin=t}get RhythmRightMargin(){return this.rhythmRightMargin}set RhythmRightMargin(t){this.rhythmRightMargin=t}get InStaffClefScalingFactor(){return this.inStaffClefScalingFactor}set InStaffClefScalingFactor(t){this.inStaffClefScalingFactor=t}get DistanceBetweenNaturalAndSymbolWhenCancelling(){return this.distanceBetweenNaturalAndSymbolWhenCancelling}set DistanceBetweenNaturalAndSymbolWhenCancelling(t){this.distanceBetweenNaturalAndSymbolWhenCancelling=t}get NoteHelperLinesOffset(){return this.noteHelperLinesOffset}set NoteHelperLinesOffset(t){this.noteHelperLinesOffset=t}get MeasureLeftMargin(){return this.measureLeftMargin}set MeasureLeftMargin(t){this.measureLeftMargin=t}get MeasureRightMargin(){return this.measureRightMargin}set MeasureRightMargin(t){this.measureRightMargin=t}get DistanceBetweenLastInstructionAndRepetitionBarline(){return this.distanceBetweenLastInstructionAndRepetitionBarline}set DistanceBetweenLastInstructionAndRepetitionBarline(t){this.distanceBetweenLastInstructionAndRepetitionBarline=t}get ArpeggioDistance(){return this.arpeggioDistance}set ArpeggioDistance(t){this.arpeggioDistance=t}get StaccatoShorteningFactor(){return this.staccatoShorteningFactor}set StaccatoShorteningFactor(t){this.staccatoShorteningFactor=t}get IdealStemLength(){return this.idealStemLength}set IdealStemLength(t){this.idealStemLength=t}get StemNoteHeadBorderYOffset(){return this.stemNoteHeadBorderYOffset}set StemNoteHeadBorderYOffset(t){this.stemNoteHeadBorderYOffset=t}get StemWidth(){return this.stemWidth}set StemWidth(t){this.stemWidth=t}get StemMargin(){return this.stemMargin}set StemMargin(t){this.stemMargin=t}get StemMinLength(){return this.stemMinLength}set StemMinLength(t){this.stemMinLength=t}get StemMaxLength(){return this.stemMaxLength}set StemMaxLength(t){this.stemMaxLength=t}get BeamSlopeMaxAngle(){return this.beamSlopeMaxAngle}set BeamSlopeMaxAngle(t){this.beamSlopeMaxAngle=t}get StemMinAllowedDistanceBetweenNoteHeadAndBeamLine(){return this.stemMinAllowedDistanceBetweenNoteHeadAndBeamLine}set StemMinAllowedDistanceBetweenNoteHeadAndBeamLine(t){this.stemMinAllowedDistanceBetweenNoteHeadAndBeamLine=t}get SetWantedStemDirectionByXml(){return this.setWantedStemDirectionByXml}set SetWantedStemDirectionByXml(t){this.setWantedStemDirectionByXml=t}get GraceNoteScalingFactor(){return this.graceNoteScalingFactor}set GraceNoteScalingFactor(t){this.graceNoteScalingFactor=t}get GraceNoteXOffset(){return this.graceNoteXOffset}set GraceNoteXOffset(t){this.graceNoteXOffset=t}get WedgeOpeningLength(){return this.wedgeOpeningLength}set WedgeOpeningLength(t){this.wedgeOpeningLength=t}get WedgeMeasureEndOpeningLength(){return this.wedgeMeasureEndOpeningLength}set WedgeMeasureEndOpeningLength(t){this.wedgeMeasureEndOpeningLength=t}get WedgeMeasureBeginOpeningLength(){return this.wedgeMeasureBeginOpeningLength}set WedgeMeasureBeginOpeningLength(t){this.wedgeMeasureBeginOpeningLength=t}get WedgePlacementAboveY(){return this.wedgePlacementAboveY}set WedgePlacementAboveY(t){this.wedgePlacementAboveY=t}get WedgePlacementBelowY(){return this.wedgePlacementBelowY}set WedgePlacementBelowY(t){this.wedgePlacementBelowY=t}get WedgeHorizontalMargin(){return this.wedgeHorizontalMargin}set WedgeHorizontalMargin(t){this.wedgeHorizontalMargin=t}get WedgeVerticalMargin(){return this.wedgeVerticalMargin}set WedgeVerticalMargin(t){this.wedgeVerticalMargin=t}get DistanceOffsetBetweenTwoHorizontallyCrossedWedges(){return this.distanceOffsetBetweenTwoHorizontallyCrossedWedges}set DistanceOffsetBetweenTwoHorizontallyCrossedWedges(t){this.distanceOffsetBetweenTwoHorizontallyCrossedWedges=t}get WedgeMinLength(){return this.wedgeMinLength}set WedgeMinLength(t){this.wedgeMinLength=t}get DistanceBetweenAdjacentDynamics(){return this.distanceBetweenAdjacentDynamics}set DistanceBetweenAdjacentDynamics(t){this.distanceBetweenAdjacentDynamics=t}get TempoChangeMeasureValidity(){return this.tempoChangeMeasureValidity}set TempoChangeMeasureValidity(t){this.tempoChangeMeasureValidity=t}get TempoContinousFactor(){return this.tempoContinousFactor}set TempoContinousFactor(t){this.tempoContinousFactor=t}get StaccatoScalingFactor(){return this.staccatoScalingFactor}set StaccatoScalingFactor(t){this.staccatoScalingFactor=t}get BetweenDotsDistance(){return this.betweenDotsDistance}set BetweenDotsDistance(t){this.betweenDotsDistance=t}get OrnamentAccidentalScalingFactor(){return this.ornamentAccidentalScalingFactor}set OrnamentAccidentalScalingFactor(t){this.ornamentAccidentalScalingFactor=t}get ChordSymbolTextHeight(){return this.chordSymbolTextHeight}set ChordSymbolTextHeight(t){this.chordSymbolTextHeight=t}get ChordSymbolXSpacing(){return this.chordSymbolXSpacing}set ChordSymbolXSpacing(t){this.chordSymbolXSpacing=t}get ChordSymbolYOffset(){return this.chordSymbolYOffset}set ChordSymbolYOffset(t){this.chordSymbolYOffset=t}get FingeringLabelFontHeight(){return this.fingeringLabelFontHeight}set FingeringLabelFontHeight(t){this.fingeringLabelFontHeight=t}get MeasureNumberLabelHeight(){return this.measureNumberLabelHeight}set MeasureNumberLabelHeight(t){this.measureNumberLabelHeight=t}get MeasureNumberLabelOffset(){return this.measureNumberLabelOffset}set MeasureNumberLabelOffset(t){this.measureNumberLabelOffset=t}get TupletsRatioed(){return this.tupletsRatioed}set TupletsRatioed(t){this.tupletsRatioed=t}get TupletsBracketed(){return this.tupletsBracketed}set TupletsBracketed(t){this.tupletsBracketed=t}get TripletsBracketed(){return this.tripletsBracketed}set TripletsBracketed(t){this.tripletsBracketed=t}get TupletNumberLabelHeight(){return this.tupletNumberLabelHeight}set TupletNumberLabelHeight(t){this.tupletNumberLabelHeight=t}get TupletNumberYOffset(){return this.tupletNumberYOffset}set TupletNumberYOffset(t){this.tupletNumberYOffset=t}get LabelMarginBorderFactor(){return this.labelMarginBorderFactor}set LabelMarginBorderFactor(t){this.labelMarginBorderFactor=t}get TupletVerticalLineLength(){return this.tupletVerticalLineLength}set TupletVerticalLineLength(t){this.tupletVerticalLineLength=t}get RepetitionEndingLabelHeight(){return this.repetitionEndingLabelHeight}set RepetitionEndingLabelHeight(t){this.repetitionEndingLabelHeight=t}get RepetitionEndingLabelXOffset(){return this.repetitionEndingLabelXOffset}set RepetitionEndingLabelXOffset(t){this.repetitionEndingLabelXOffset=t}get RepetitionEndingLabelYOffset(){return this.repetitionEndingLabelYOffset}set RepetitionEndingLabelYOffset(t){this.repetitionEndingLabelYOffset=t}get RepetitionEndingLineYLowerOffset(){return this.repetitionEndingLineYLowerOffset}set RepetitionEndingLineYLowerOffset(t){this.repetitionEndingLineYLowerOffset=t}get RepetitionEndingLineYUpperOffset(){return this.repetitionEndingLineYUpperOffset}set RepetitionEndingLineYUpperOffset(t){this.repetitionEndingLineYUpperOffset=t}get LyricsAlignmentStandard(){return this.lyricsAlignmentStandard}set LyricsAlignmentStandard(t){this.lyricsAlignmentStandard=t}get LyricsHeight(){return this.lyricsHeight}set LyricsHeight(t){this.lyricsHeight=t}get LyricsYOffsetToStaffHeight(){return this.lyricsYOffsetToStaffHeight}set LyricsYOffsetToStaffHeight(t){this.lyricsYOffsetToStaffHeight=t}get VerticalBetweenLyricsDistance(){return this.verticalBetweenLyricsDistance}set VerticalBetweenLyricsDistance(t){this.verticalBetweenLyricsDistance=t}get HorizontalBetweenLyricsDistance(){return this.horizontalBetweenLyricsDistance}set HorizontalBetweenLyricsDistance(t){this.horizontalBetweenLyricsDistance=t}get BetweenSyllableMaximumDistance(){return this.betweenSyllableMaximumDistance}set BetweenSyllableMaximumDistance(t){this.betweenSyllableMaximumDistance=t}get BetweenSyllableMinimumDistance(){return this.betweenSyllableMinimumDistance}set BetweenSyllableMinimumDistance(t){this.betweenSyllableMinimumDistance=t}get LyricOverlapAllowedIntoNextMeasure(){return this.lyricOverlapAllowedIntoNextMeasure}set LyricOverlapAllowedIntoNextMeasure(t){this.lyricOverlapAllowedIntoNextMeasure=t}get MinimumDistanceBetweenDashes(){return this.minimumDistanceBetweenDashes}set MinimumDistanceBetweenDashes(t){this.minimumDistanceBetweenDashes=t}get BezierCurveStepSize(){return this.bezierCurveStepSize}set BezierCurveStepSize(t){this.bezierCurveStepSize=t}get TPow3(){return this.tPower3}set TPow3(t){this.tPower3=t}get OneMinusTPow3(){return this.oneMinusTPower3}set OneMinusTPow3(t){this.oneMinusTPower3=t}get BezierFactorOne(){return this.factorOne}set BezierFactorOne(t){this.factorOne=t}get BezierFactorTwo(){return this.factorTwo}set BezierFactorTwo(t){this.factorTwo=t}get TieGhostObjectWidth(){return this.tieGhostObjectWidth}set TieGhostObjectWidth(t){this.tieGhostObjectWidth=t}get TieYPositionOffsetFactor(){return this.tieYPositionOffsetFactor}set TieYPositionOffsetFactor(t){this.tieYPositionOffsetFactor=t}get MinimumNeededXspaceForTieGhostObject(){return this.minimumNeededXspaceForTieGhostObject}set MinimumNeededXspaceForTieGhostObject(t){this.minimumNeededXspaceForTieGhostObject=t}get TieHeightMinimum(){return this.tieHeightMinimum}set TieHeightMinimum(t){this.tieHeightMinimum=t}get TieHeightMaximum(){return this.tieHeightMaximum}set TieHeightMaximum(t){this.tieHeightMaximum=t}get TieHeightInterpolationK(){return this.tieHeightInterpolationK}set TieHeightInterpolationK(t){this.tieHeightInterpolationK=t}get TieHeightInterpolationD(){return this.tieHeightInterpolationD}set TieHeightInterpolationD(t){this.tieHeightInterpolationD=t}get SlurNoteHeadYOffset(){return this.slurNoteHeadYOffset}set SlurNoteHeadYOffset(t){this.slurNoteHeadYOffset=t}get SlurStemXOffset(){return this.slurStemXOffset}set SlurStemXOffset(t){this.slurStemXOffset=t}get SlurSlopeMaxAngle(){return this.slurSlopeMaxAngle}set SlurSlopeMaxAngle(t){this.slurSlopeMaxAngle=t}get SlurTangentMinAngle(){return this.slurTangentMinAngle}set SlurTangentMinAngle(t){this.slurTangentMinAngle=t}get SlurTangentMaxAngle(){return this.slurTangentMaxAngle}set SlurTangentMaxAngle(t){this.slurTangentMaxAngle=t}get SlursStartingAtSameStaffEntryYOffset(){return this.slursStartingAtSameStaffEntryYOffset}set SlursStartingAtSameStaffEntryYOffset(t){this.slursStartingAtSameStaffEntryYOffset=t}get InstantaneousTempoTextHeight(){return this.instantaneousTempoTextHeight}set InstantaneousTempoTextHeight(t){this.instantaneousTempoTextHeight=t}get ContinuousDynamicTextHeight(){return this.continuousDynamicTextHeight}set ContinuousDynamicTextHeight(t){this.continuousDynamicTextHeight=t}get MoodTextHeight(){return this.moodTextHeight}set MoodTextHeight(t){this.moodTextHeight=t}get ContinuousTempoTextHeight(){return this.continuousTempoTextHeight}set ContinuousTempoTextHeight(t){this.continuousTempoTextHeight=t}get DynamicExpressionMaxDistance(){return this.dynamicExpressionMaxDistance}set DynamicExpressionMaxDistance(t){this.dynamicExpressionMaxDistance=t}get DynamicExpressionSpacer(){return this.dynamicExpressionSpacer}set DynamicExpressionSpacer(t){this.dynamicExpressionSpacer=t}get UnknownTextHeight(){return this.unknownTextHeight}set UnknownTextHeight(t){this.unknownTextHeight=t}get StaffLineWidth(){return this.staffLineWidth}set StaffLineWidth(t){this.staffLineWidth=t}get LedgerLineWidth(){return this.ledgerLineWidth}set LedgerLineWidth(t){this.ledgerLineWidth=t}get WedgeLineWidth(){return this.wedgeLineWidth}set WedgeLineWidth(t){this.wedgeLineWidth=t}get TupletLineWidth(){return this.tupletLineWidth}set TupletLineWidth(t){this.tupletLineWidth=t}get LyricUnderscoreLineWidth(){return this.lyricUnderscoreLineWidth}set LyricUnderscoreLineWidth(t){this.lyricUnderscoreLineWidth=t}get SystemThinLineWidth(){return this.systemThinLineWidth}set SystemThinLineWidth(t){this.systemThinLineWidth=t}get SystemBoldLineWidth(){return this.systemBoldLineWidth}set SystemBoldLineWidth(t){this.systemBoldLineWidth=t}get SystemRepetitionEndingLineWidth(){return this.systemRepetitionEndingLineWidth}set SystemRepetitionEndingLineWidth(t){this.systemRepetitionEndingLineWidth=t}get SystemDotWidth(){return this.systemDotWidth}set SystemDotWidth(t){this.systemDotWidth=t}get DistanceBetweenVerticalSystemLines(){return this.distanceBetweenVerticalSystemLines}set DistanceBetweenVerticalSystemLines(t){this.distanceBetweenVerticalSystemLines=t}get DistanceBetweenDotAndLine(){return this.distanceBetweenDotAndLine}set DistanceBetweenDotAndLine(t){this.distanceBetweenDotAndLine=t}get OctaveShiftLineWidth(){return this.octaveShiftLineWidth}set OctaveShiftLineWidth(t){this.octaveShiftLineWidth=t}get OctaveShiftVerticalLineLength(){return this.octaveShiftVerticalLineLength}set OctaveShiftVerticalLineLength(t){this.octaveShiftVerticalLineLength=t}get GraceLineWidth(){return this.graceLineWidth}set GraceLineWidth(t){this.graceLineWidth=t}get MinimumStaffLineDistance(){return this.minimumStaffLineDistance}set MinimumStaffLineDistance(t){this.minimumStaffLineDistance=t}get MinimumCrossedBeamDifferenceMargin(){return this.minimumCrossedBeamDifferenceMargin}set MinimumCrossedBeamDifferenceMargin(t){this.minimumCrossedBeamDifferenceMargin=t}get DisplacedNoteMargin(){return this.displacedNoteMargin}set DisplacedNoteMargin(t){this.displacedNoteMargin=t}get MinNoteDistance(){return this.minNoteDistance}set MinNoteDistance(t){this.minNoteDistance=t}get SubMeasureXSpacingThreshold(){return this.subMeasureXSpacingThreshold}set SubMeasureXSpacingThreshold(t){this.subMeasureXSpacingThreshold=t}get MeasureDynamicsMaxScalingFactor(){return this.measureDynamicsMaxScalingFactor}set MeasureDynamicsMaxScalingFactor(t){this.measureDynamicsMaxScalingFactor=t}get WholeRestXShiftVexflow(){return this.wholeRestXShiftVexflow}set WholeRestXShiftVexflow(t){this.wholeRestXShiftVexflow=t}get MetronomeMarkXShift(){return this.metronomeMarkXShift}set MetronomeMarkXShift(t){this.metronomeMarkXShift=t}get MetronomeMarkYShift(){return this.metronomeMarkYShift}set MetronomeMarkYShift(t){this.metronomeMarkYShift=t}get MaxInstructionsConstValue(){return this.maxInstructionsConstValue}set MaxInstructionsConstValue(t){this.maxInstructionsConstValue=t}get NoteDistances(){return this.noteDistances}set NoteDistances(t){this.noteDistances=t}get NoteDistancesScalingFactors(){return this.noteDistancesScalingFactors}set NoteDistancesScalingFactors(t){this.noteDistancesScalingFactors=t}get DurationDistanceDict(){return this.durationDistanceDict}get DurationScalingDistanceDict(){return this.durationScalingDistanceDict}get AlignRests(){return this.alignRests}set AlignRests(t){this.alignRests=t}get FillEmptyMeasuresWithWholeRest(){return this.fillEmptyMeasuresWithWholeRest}set FillEmptyMeasuresWithWholeRest(t){this.fillEmptyMeasuresWithWholeRest=t}get ArpeggiosGoAcrossVoices(){return this.arpeggiosGoAcrossVoices}set ArpeggiosGoAcrossVoices(t){this.arpeggiosGoAcrossVoices=t}get RenderArpeggios(){return this.renderArpeggios}set RenderArpeggios(t){this.renderArpeggios=t}get RenderSlurs(){return this.renderSlurs}set RenderSlurs(t){this.renderSlurs=t}get ColoringMode(){return this.coloringMode}set ColoringMode(t){this.coloringMode=t}get ColoringEnabled(){return this.coloringEnabled}set ColoringEnabled(t){this.coloringEnabled=t}get ColorStemsLikeNoteheads(){return this.colorStemsLikeNoteheads}set ColorStemsLikeNoteheads(t){this.colorStemsLikeNoteheads=t}get ColorFlags(){return this.colorFlags}set ColorFlags(t){this.colorFlags=t}get ColorBeams(){return this.colorBeams}set ColorBeams(t){this.colorBeams=t}get ColoringSetCurrent(){return this.coloringSetCustom}set ColoringSetCurrent(t){this.coloringSetCustom=t}get DefaultColorNotehead(){return this.defaultColorNotehead}set DefaultColorNotehead(t){this.defaultColorNotehead=t}get DefaultColorRest(){return this.defaultColorRest}set DefaultColorRest(t){this.defaultColorRest=t}get DefaultColorStem(){return this.defaultColorStem}set DefaultColorStem(t){this.defaultColorStem=t}get DefaultColorLabel(){return this.defaultColorLabel}set DefaultColorLabel(t){this.defaultColorLabel=t}get DefaultColorTitle(){return this.defaultColorTitle}set DefaultColorTitle(t){this.defaultColorTitle=t}get DefaultFontFamily(){return this.defaultFontFamily}set DefaultFontFamily(t){this.defaultFontFamily=t}get MaxMeasureToDrawIndex(){return this.maxMeasureToDrawIndex}set MaxMeasureToDrawIndex(t){this.maxMeasureToDrawIndex=t}get MinMeasureToDrawIndex(){return this.minMeasureToDrawIndex}set MinMeasureToDrawIndex(t){this.minMeasureToDrawIndex=t}get RenderComposer(){return this.renderComposer}set RenderComposer(t){this.renderComposer=t}get RenderTitle(){return this.renderTitle}set RenderTitle(t){this.renderTitle=t}get RenderSubtitle(){return this.renderSubtitle}set RenderSubtitle(t){this.renderSubtitle=t}get RenderLyricist(){return this.renderLyricist}set RenderLyricist(t){this.renderLyricist=t}get RenderPartNames(){return this.renderPartNames}set RenderPartNames(t){this.renderPartNames=t}get RenderPartAbbreviations(){return this.renderPartAbbreviations}set RenderPartAbbreviations(t){this.renderPartAbbreviations=t}get RenderFingerings(){return this.renderFingerings}set RenderFingerings(t){this.renderFingerings=t}get RenderMeasureNumbers(){return this.renderMeasureNumbers}set RenderMeasureNumbers(t){this.renderMeasureNumbers=t}get RenderLyrics(){return this.renderLyrics}set RenderLyrics(t){this.renderLyrics=t}get FingeringPosition(){return this.fingeringPosition}set FingeringPosition(t){this.fingeringPosition=t}get FingeringInsideStafflines(){return this.fingeringInsideStafflines}set FingeringInsideStafflines(t){this.fingeringInsideStafflines=t}set FixStafflineBoundingBox(t){this.fixStafflineBoundingBox=t}get FixStafflineBoundingBox(){return this.fixStafflineBoundingBox}get PageFormat(){return this.pageFormat}set PageFormat(t){this.pageFormat=t}get PageBackgroundColor(){return this.pageBackgroundColor}set PageBackgroundColor(t){this.pageBackgroundColor=t}get RenderSingleHorizontalStaffline(){return this.renderSingleHorizontalStaffline}set RenderSingleHorizontalStaffline(t){this.renderSingleHorizontalStaffline=t}populateDictionaries(){for(let t=0;t<this.noteDistances.length;t++)switch(t){case 0:this.durationDistanceDict[.015625]=this.noteDistances[t],this.durationScalingDistanceDict[.015625]=this.noteDistancesScalingFactors[t];break;case 1:this.durationDistanceDict[.03125]=this.noteDistances[t],this.durationScalingDistanceDict[.03125]=this.noteDistancesScalingFactors[t];break;case 2:this.durationDistanceDict[.0625]=this.noteDistances[t],this.durationScalingDistanceDict[.0625]=this.noteDistancesScalingFactors[t];break;case 3:this.durationDistanceDict[.125]=this.noteDistances[t],this.durationScalingDistanceDict[.125]=this.noteDistancesScalingFactors[t];break;case 4:this.durationDistanceDict[.25]=this.noteDistances[t],this.durationScalingDistanceDict[.25]=this.noteDistancesScalingFactors[t];break;case 5:this.durationDistanceDict[.5]=this.noteDistances[t],this.durationScalingDistanceDict[.5]=this.noteDistancesScalingFactors[t];break;case 6:this.durationDistanceDict[1]=this.noteDistances[t],this.durationScalingDistanceDict[1]=this.noteDistancesScalingFactors[t];break;case 7:this.durationDistanceDict[2]=this.noteDistances[t],this.durationScalingDistanceDict[2]=this.noteDistancesScalingFactors[t]}}calculateCurveParametersArrays(){this.tPower3=new Array(this.bezierCurveStepSize),this.oneMinusTPower3=new Array(this.bezierCurveStepSize),this.factorOne=new Array(this.bezierCurveStepSize),this.factorTwo=new Array(this.bezierCurveStepSize);for(let t=0;t<this.bezierCurveStepSize;t++){const e=t/this.bezierCurveStepSize;this.tPower3[t]=Math.pow(e,3),this.oneMinusTPower3[t]=Math.pow(1-e,3),this.factorOne[t]=3*Math.pow(1-e,2)*e,this.factorTwo[t]=3*(1-e)*Math.pow(e,2)}}}e.EngravingRules=u,u.unit=1;class c{constructor(t,e,n="noIdStringGiven"){this.width=t,this.height=e,this.idString=n}get aspectRatio(){return this.IsUndefined?0:this.width/this.height}get IsUndefined(){return void 0===this.width||void 0===this.height||0===this.height||0===this.width}static get UndefinedPageFormat(){return new c(0,0)}Equals(t){return!!t&&(t.width===this.width&&t.height===this.height)}}e.PageFormat=c},function(t,e,n){"use strict";var i,r;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.C=0]="C",t[t.D=2]="D",t[t.E=4]="E",t[t.F=5]="F",t[t.G=7]="G",t[t.A=9]="A",t[t.B=11]="B"}(i=e.NoteEnum||(e.NoteEnum={})),function(t){t[t.SHARP=0]="SHARP",t[t.FLAT=1]="FLAT",t[t.NONE=2]="NONE",t[t.NATURAL=3]="NATURAL",t[t.DOUBLESHARP=4]="DOUBLESHARP",t[t.DOUBLEFLAT=5]="DOUBLEFLAT",t[t.TRIPLESHARP=6]="TRIPLESHARP",t[t.TRIPLEFLAT=7]="TRIPLEFLAT",t[t.QUARTERTONESHARP=8]="QUARTERTONESHARP",t[t.QUARTERTONEFLAT=9]="QUARTERTONEFLAT"}(r=e.AccidentalEnum||(e.AccidentalEnum={}));class s{constructor(t,e,n){this.accidental=r.NONE,this.fundamentalNote=t,this.octave=e,this.accidental=n,this.halfTone=t+12*(e+s.octXmlDiff)+s.HalfTonesFromAccidental(n),this.frequency=s.calcFrequency(this)}static getNoteEnumString(t){switch(t){case i.C:return"C";case i.D:return"D";case i.E:return"E";case i.F:return"F";case i.G:return"G";case i.A:return"A";case i.B:return"B";default:return""}}static CalculateTransposedHalfTone(t,e){const n=t.fundamentalNote+t.AccidentalHalfTones+e;return s.WrapAroundCheck(n,12)}static WrapAroundCheck(t,e){let n=0;for(;t<0;)t+=e,n--;for(;t>=e;)t-=e,n++;return{overflow:n,value:t}}static calcFrequency(t){let e,n=0;if(t instanceof s){const r=t;n=r.octave-1,e=r.fundamentalNote-i.A+r.AccidentalHalfTones}else if("number"==typeof t){e=t-57}return 440*Math.pow(2,n)*Math.pow(2,e/12)}static calcFractionalKey(t){return Math.log(t/440)/Math.LN10*s.halftoneFactor+57}static fromFrequency(t){const e=s.calcFractionalKey(t)+.5,n=Math.floor(e/12)-s.octXmlDiff,i=Math.floor(e)%12;let o=i,a=r.NONE;return-1===this.pitchEnumValues.indexOf(o)&&(o=i-1,a=r.SHARP),new s(o,n,a)}static fromHalftone(t){const e=Math.floor(t/12)-s.octXmlDiff,n=t%12;let i=n,o=r.NONE;return-1===this.pitchEnumValues.indexOf(i)&&(i=n-1,o=r.SHARP),new s(i,e,o)}static ceiling(t){let e=t%=12;return-1===this.pitchEnumValues.indexOf(e)&&(e=t+1),e}static floor(t){let e=t%=12;return-1===this.pitchEnumValues.indexOf(e)&&(e=t-1),e}static HalfTonesFromAccidental(t){switch(t){case r.NONE:return 0;case r.SHARP:return 1;case r.FLAT:return-1;case r.NATURAL:return 0;case r.DOUBLESHARP:return 2;case r.DOUBLEFLAT:return-2;case r.QUARTERTONESHARP:return.5;case r.QUARTERTONEFLAT:return-.5;case r.TRIPLESHARP:return 3;case r.TRIPLEFLAT:return-3;default:throw new Error("Unhandled AccidentalEnum value")}}static AccidentalFromHalfTones(t){switch(t){case 0:return r.NONE;case 1:return r.SHARP;case-1:return r.FLAT;case 2:return r.DOUBLESHARP;case-2:return r.DOUBLEFLAT;case.5:return r.QUARTERTONESHARP;case-.5:return r.QUARTERTONEFLAT;case 3:return r.TRIPLESHARP;case-3:return r.TRIPLEFLAT;default:return t>0&&t<1?r.QUARTERTONESHARP:t<0&&t>-1?r.QUARTERTONEFLAT:r.QUARTERTONESHARP}}static accidentalVexflow(t){let e;switch(t){case r.NATURAL:e="n";break;case r.FLAT:e="b";break;case r.SHARP:e="#";break;case r.DOUBLESHARP:e="##";break;case r.TRIPLESHARP:e="++";break;case r.DOUBLEFLAT:e="bb";break;case r.TRIPLEFLAT:e="bbs";break;case r.QUARTERTONESHARP:e="+";break;case r.QUARTERTONEFLAT:e="d"}return e}get AccidentalHalfTones(){return s.HalfTonesFromAccidental(this.accidental)}get Octave(){return this.octave}get FundamentalNote(){return this.fundamentalNote}get Accidental(){return this.accidental}get Frequency(){return this.frequency}static get OctaveXmlDifference(){return s.octXmlDiff}getHalfTone(){return this.halfTone}getTransposedPitch(t){if(t>12)throw new Error("rewrite this method to handle bigger octave changes or don't use is with bigger octave changes!");return t>0?this.getHigherPitchByTransposeFactor(t):t<0?this.getLowerPitchByTransposeFactor(-t):this}DoEnharmonicChange(){switch(this.accidental){case r.FLAT:case r.DOUBLEFLAT:this.fundamentalNote=this.getPreviousFundamentalNote(this.fundamentalNote),this.accidental=s.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+s.octXmlDiff)));break;case r.SHARP:case r.DOUBLESHARP:this.fundamentalNote=this.getNextFundamentalNote(this.fundamentalNote),this.accidental=s.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+s.octXmlDiff)));break;default:return}}ToString(){let t=s.accidentalVexflow(this.accidental);return t||(t=""),"Key: "+s.getNoteEnumString(this.fundamentalNote)+t+", Note: "+this.fundamentalNote+", octave: "+this.octave.toString()}OperatorEquals(t){return void 0!==this&&void 0!==t&&(this.FundamentalNote===t.FundamentalNote&&this.Octave===t.Octave&&this.Accidental===t.Accidental)}OperatorNotEqual(t){return!(this===t)}getHigherPitchByTransposeFactor(t){const e=s.pitchEnumValues.indexOf(this.fundamentalNote);let n,i=this.octave;return e+t>s.pitchEnumValues.length-1?(n=s.pitchEnumValues[e+t-s.pitchEnumValues.length],i++):n=s.pitchEnumValues[e+t],new s(n,i,r.NONE)}getLowerPitchByTransposeFactor(t){const e=s.pitchEnumValues.indexOf(this.fundamentalNote);let n,i=this.octave;return e-t<0?(n=s.pitchEnumValues[s.pitchEnumValues.length+e-t],i--):n=s.pitchEnumValues[e-t],new s(n,i,r.NONE)}getNextFundamentalNote(t){let e=s.pitchEnumValues.indexOf(t);return e=(e+1)%s.pitchEnumValues.length,s.pitchEnumValues[e]}getPreviousFundamentalNote(t){const e=s.pitchEnumValues.indexOf(t);return e>0?s.pitchEnumValues[e-1]:s.pitchEnumValues[s.pitchEnumValues.length-1]}}e.Pitch=s,s.pitchEnumValues=[i.C,i.D,i.E,i.F,i.G,i.A,i.B],s.halftoneFactor=12/(Math.LN2/Math.LN10),s.octXmlDiff=3},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(1),r=n(12),s=n(5),o=n(80),a=n(51),l=n(52),u=n(2);var c;e.BoundingBox=class{constructor(t,e,n=!1){this.isSymbol=!1,this.relativePositionHasBeenSet=!1,this.xBordersHaveBeenSet=!1,this.yBordersHaveBeenSet=!1,this.absolutePosition=new s.PointF2D,this.relativePosition=new s.PointF2D,this.size=new o.SizeF2D,this.marginSize=new o.SizeF2D,this.upperLeftCorner=new s.PointF2D,this.upperLeftMarginCorner=new s.PointF2D,this.borderLeft=0,this.borderRight=0,this.borderTop=0,this.borderBottom=0,this.borderMarginLeft=0,this.borderMarginRight=0,this.borderMarginTop=0,this.borderMarginBottom=0,this.childElements=[],this.parent=e,this.dataObject=t,this.isSymbol=n,this.xBordersHaveBeenSet=!1,this.yBordersHaveBeenSet=!1,void 0!==e&&(this.Parent=e)}get RelativePositionHasBeenSet(){return this.relativePositionHasBeenSet}get XBordersHaveBeenSet(){return this.xBordersHaveBeenSet}set XBordersHaveBeenSet(t){this.xBordersHaveBeenSet=t}get YBordersHaveBeenSet(){return this.yBordersHaveBeenSet}set YBordersHaveBeenSet(t){this.yBordersHaveBeenSet=t}get AbsolutePosition(){return this.absolutePosition}set AbsolutePosition(t){this.absolutePosition=t}get RelativePosition(){return this.relativePosition}set RelativePosition(t){this.relativePosition=t,this.relativePositionHasBeenSet=!0}get Size(){return this.size}set Size(t){this.size=t}get MarginSize(){return this.marginSize}get UpperLeftCorner(){return this.upperLeftCorner}get UpperLeftMarginCorner(){return this.upperLeftMarginCorner}get BorderLeft(){return this.borderLeft}set BorderLeft(t){this.borderLeft=t,this.calculateRectangle()}get BorderRight(){return this.borderRight}set BorderRight(t){this.borderRight=t,this.calculateRectangle()}get BorderTop(){return this.borderTop}set BorderTop(t){this.borderTop=t,this.calculateRectangle()}get BorderBottom(){return this.borderBottom}set BorderBottom(t){this.borderBottom=t,this.calculateRectangle()}get BorderMarginLeft(){return this.borderMarginLeft>this.borderLeft?this.borderLeft:this.borderMarginLeft}set BorderMarginLeft(t){this.borderMarginLeft=t,this.calculateMarginRectangle()}get BorderMarginRight(){return this.borderMarginRight<this.borderRight?this.borderRight:this.borderMarginRight}set BorderMarginRight(t){this.borderMarginRight=t,this.calculateMarginRectangle()}get BorderMarginTop(){return this.borderMarginTop>this.borderTop?this.borderTop:this.borderMarginTop}set BorderMarginTop(t){this.borderMarginTop=t,this.calculateMarginRectangle()}get BorderMarginBottom(){return this.borderMarginBottom<this.borderBottom?this.borderBottom:this.borderMarginBottom}set BorderMarginBottom(t){this.borderMarginBottom=t,this.calculateMarginRectangle()}get BoundingRectangle(){return this.boundingRectangle}get BoundingMarginRectangle(){return this.boundingMarginRectangle}get ChildElements(){return this.childElements}set ChildElements(t){this.childElements=t}get Parent(){return this.parent}set Parent(t){if(void 0!==this.parent){const t=this.parent.ChildElements.indexOf(this,0);t>-1&&this.parent.ChildElements.splice(t,1)}this.parent=t,this.parent.ChildElements.indexOf(this)>-1?i.error("BoundingBox of "+this.dataObject.constructor.name+" already in children list of "+this.parent.dataObject.constructor.name+"'s BoundingBox"):this.parent.ChildElements.push(this)}get DataObject(){return this.dataObject}get Center(){return new s.PointF2D(this.RelativePosition.x+(this.BorderMarginRight+this.BorderMarginLeft),this.RelativePosition.y+(this.BorderMarginBottom+this.BorderMarginTop))}setAbsolutePositionFromParent(){void 0!==this.parent?(this.absolutePosition.x=this.parent.AbsolutePosition.x+this.relativePosition.x,this.absolutePosition.y=this.parent.AbsolutePosition.y+this.relativePosition.y):this.absolutePosition=this.relativePosition}calculateAbsolutePosition(){this.absolutePosition.x=this.relativePosition.x,this.absolutePosition.y=this.relativePosition.y;let t=this.parent;for(;void 0!==t;)this.absolutePosition.x+=t.relativePosition.x,this.absolutePosition.y+=t.relativePosition.y,t=t.parent}calculateAbsolutePositionsRecursiveWithoutTopelement(){this.absolutePosition.x=0,this.absolutePosition.y=0;for(let t=0,e=this.ChildElements.length;t<e;++t){this.ChildElements[t].calculateAbsolutePositionsRecursive(this.absolutePosition.x,this.absolutePosition.y)}}calculateAbsolutePositionsRecursive(t,e){this.absolutePosition.x=this.relativePosition.x+t,this.absolutePosition.y=this.relativePosition.y+e;for(let t=0,e=this.ChildElements.length;t<e;++t){this.ChildElements[t].calculateAbsolutePositionsRecursive(this.absolutePosition.x,this.absolutePosition.y)}}calculateAbsolutePositionsOfChildren(){for(let t=0,e=this.ChildElements.length;t<e;++t){this.ChildElements[t].calculateAbsolutePositionsRecursive(this.absolutePosition.x,this.absolutePosition.y)}}calculateBoundingBox(){if(0===this.childElements.length)return;for(let t=0,e=this.ChildElements.length;t<e;++t){this.ChildElements[t].calculateBoundingBox()}let t=Number.MAX_VALUE,e=Number.MIN_VALUE,n=Number.MAX_VALUE,i=Number.MIN_VALUE,r=Number.MAX_VALUE,s=Number.MIN_VALUE,o=Number.MAX_VALUE,a=Number.MIN_VALUE;this.isSymbol&&(t=this.borderLeft,e=this.borderRight,n=this.borderTop,i=this.borderBottom,r=this.borderMarginLeft,s=this.borderMarginRight,o=this.borderMarginTop,a=this.borderMarginBottom);for(let l=0,u=this.ChildElements.length;l<u;++l){const u=this.ChildElements[l];t=Math.min(t,u.relativePosition.x+u.borderLeft),e=Math.max(e,u.relativePosition.x+u.borderRight),n=Math.min(n,u.relativePosition.y+u.borderTop),i=Math.max(i,u.relativePosition.y+u.borderBottom),r=Math.min(r,u.relativePosition.x+u.borderMarginLeft),s=Math.max(s,u.relativePosition.x+u.borderMarginRight),o=Math.min(o,u.relativePosition.y+u.borderMarginTop),a=Math.max(a,u.relativePosition.y+u.borderMarginBottom)}this.borderLeft=t,this.borderRight=e,this.borderTop=n,this.borderBottom=i,this.borderMarginLeft=r,this.borderMarginRight=s,this.borderMarginTop=o,this.borderMarginBottom=a,this.calculateRectangle(),this.calculateMarginRectangle(),this.xBordersHaveBeenSet=!0,this.yBordersHaveBeenSet=!0}calculateTopBottomBorders(){if(0===this.childElements.length)return;for(let t=0,e=this.ChildElements.length;t<e;++t){this.ChildElements[t].calculateTopBottomBorders()}let t=Number.MAX_VALUE,e=Number.MIN_VALUE,n=Number.MAX_VALUE,i=Number.MIN_VALUE;this.yBordersHaveBeenSet&&(t=this.borderTop,e=this.borderBottom,n=this.borderMarginTop,i=this.borderMarginBottom);for(let r=0,s=this.ChildElements.length;r<s;++r){const s=this.ChildElements[r];t=Math.min(t,s.relativePosition.y+s.borderTop),u.E