EngravingRules.ts 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472
  1. import { PagePlacementEnum } from "./GraphicalMusicPage";
  2. //import {MusicSymbol} from "./MusicSymbol";
  3. import * as log from "loglevel";
  4. import { TextAlignmentEnum } from "../../Common/Enums/TextAlignment";
  5. import { PlacementEnum } from "../VoiceData/Expressions/AbstractExpression";
  6. import { AutoBeamOptions } from "../../OpenSheetMusicDisplay/OSMDOptions";
  7. export class EngravingRules {
  8. private static rules: EngravingRules;
  9. /** A unit of distance. 1.0 is the distance between lines of a stave for OSMD, which is 10 pixels in Vexflow. */
  10. private static unit: number = 1.0;
  11. private samplingUnit: number;
  12. private staccatoShorteningFactor: number;
  13. /** Height (size) of the sheet title. */
  14. private sheetTitleHeight: number;
  15. private sheetSubtitleHeight: number;
  16. private sheetMinimumDistanceBetweenTitleAndSubtitle: number;
  17. private sheetComposerHeight: number;
  18. private sheetAuthorHeight: number;
  19. private compactMode: boolean;
  20. private pagePlacementEnum: PagePlacementEnum;
  21. private pageHeight: number;
  22. private pageTopMargin: number;
  23. private pageTopMarginNarrow: number;
  24. private pageBottomMargin: number;
  25. private pageLeftMargin: number;
  26. private pageRightMargin: number;
  27. private titleTopDistance: number;
  28. private titleBottomDistance: number;
  29. private systemDistance: number;
  30. private systemLeftMargin: number;
  31. private systemRightMargin: number;
  32. private firstSystemMargin: number;
  33. private systemLabelsRightMargin: number;
  34. private systemComposerDistance: number;
  35. private instrumentLabelTextHeight: number;
  36. private minimumAllowedDistanceBetweenSystems: number;
  37. private lastSystemMaxScalingFactor: number;
  38. private staffDistance: number;
  39. private betweenStaffDistance: number;
  40. private staffHeight: number;
  41. private betweenStaffLinesDistance: number;
  42. /** Whether to automatically beam notes that don't already have beams in XML. */
  43. private autoBeamNotes: boolean;
  44. /** Options for autoBeaming like whether to beam over rests. See AutoBeamOptions interface. */
  45. private autoBeamOptions: AutoBeamOptions;
  46. private beamWidth: number;
  47. private beamSpaceWidth: number;
  48. private beamForwardLength: number;
  49. private clefLeftMargin: number;
  50. private clefRightMargin: number;
  51. private betweenKeySymbolsDistance: number;
  52. private keyRightMargin: number;
  53. private rhythmRightMargin: number;
  54. private inStaffClefScalingFactor: number;
  55. private distanceBetweenNaturalAndSymbolWhenCancelling: number;
  56. private noteHelperLinesOffset: number;
  57. private measureLeftMargin: number;
  58. private measureRightMargin: number;
  59. private distanceBetweenLastInstructionAndRepetitionBarline: number;
  60. private arpeggioDistance: number;
  61. private idealStemLength: number;
  62. private stemNoteHeadBorderYOffset: number;
  63. private stemWidth: number;
  64. private stemMargin: number;
  65. private stemMinLength: number;
  66. private stemMaxLength: number;
  67. private beamSlopeMaxAngle: number;
  68. private stemMinAllowedDistanceBetweenNoteHeadAndBeamLine: number;
  69. private setWantedStemDirectionByXml: boolean;
  70. private graceNoteScalingFactor: number;
  71. private graceNoteXOffset: number;
  72. private wedgeOpeningLength: number;
  73. private wedgeMeasureEndOpeningLength: number;
  74. private wedgeMeasureBeginOpeningLength: number;
  75. private wedgePlacementAboveY: number;
  76. private wedgePlacementBelowY: number;
  77. private wedgeHorizontalMargin: number;
  78. private wedgeVerticalMargin: number;
  79. private distanceOffsetBetweenTwoHorizontallyCrossedWedges: number;
  80. private wedgeMinLength: number;
  81. private distanceBetweenAdjacentDynamics: number;
  82. private tempoChangeMeasureValidity: number;
  83. private tempoContinousFactor: number;
  84. private staccatoScalingFactor: number;
  85. private betweenDotsDistance: number;
  86. private ornamentAccidentalScalingFactor: number;
  87. private chordSymbolTextHeight: number;
  88. private chordSymbolYOffset: number;
  89. private fingeringLabelFontHeight: number;
  90. private measureNumberLabelHeight: number;
  91. private measureNumberLabelOffset: number;
  92. /** Whether tuplets should display ratio (3:2 instead of 3 for triplet). Default false. */
  93. private tupletsRatioed: boolean;
  94. /** Whether all tuplets should be bracketed (e.g. |--5--| instead of 5). Default false.
  95. * If false, only tuplets given as bracketed in XML (bracket="yes") will be bracketed.
  96. * (If not given in XML, bracketing is implementation-dependent according to standard)
  97. */
  98. private tupletsBracketed: boolean;
  99. /** Whether all triplets should be bracketed. Overrides tupletsBracketed for triplets.
  100. * If false, only triplets given as bracketed in XML (bracket="yes") will be bracketed.
  101. * (Bracketing all triplets can be cluttering)
  102. */
  103. private tripletsBracketed: boolean;
  104. private tupletNumberLabelHeight: number;
  105. private tupletNumberYOffset: number;
  106. private labelMarginBorderFactor: number;
  107. private tupletVerticalLineLength: number;
  108. private repetitionEndingLabelHeight: number;
  109. private repetitionEndingLabelXOffset: number;
  110. private repetitionEndingLabelYOffset: number;
  111. private repetitionEndingLineYLowerOffset: number;
  112. private repetitionEndingLineYUpperOffset: number;
  113. /** Default alignment of lyrics.
  114. * Left alignments will extend text to the right of the bounding box,
  115. * which facilitates spacing by extending measure width.
  116. */
  117. private lyricsAlignmentStandard: TextAlignmentEnum;
  118. private lyricsHeight: number;
  119. private lyricsYOffsetToStaffHeight: number;
  120. private verticalBetweenLyricsDistance: number;
  121. private horizontalBetweenLyricsDistance: number;
  122. private betweenSyllableMaximumDistance: number;
  123. private betweenSyllableMinimumDistance: number;
  124. private lyricOverlapAllowedIntoNextMeasure: number;
  125. private minimumDistanceBetweenDashes: number;
  126. private bezierCurveStepSize: number;
  127. private tPower3: number[];
  128. private oneMinusTPower3: number[];
  129. private factorOne: number[];
  130. private factorTwo: number[];
  131. private tieGhostObjectWidth: number;
  132. private tieYPositionOffsetFactor: number;
  133. private minimumNeededXspaceForTieGhostObject: number;
  134. private tieHeightMinimum: number;
  135. private tieHeightMaximum: number;
  136. private tieHeightInterpolationK: number;
  137. private tieHeightInterpolationD: number;
  138. private slurNoteHeadYOffset: number;
  139. private slurStemXOffset: number;
  140. private slurSlopeMaxAngle: number;
  141. private slurTangentMinAngle: number;
  142. private slurTangentMaxAngle: number;
  143. private slursStartingAtSameStaffEntryYOffset: number;
  144. private instantaneousTempoTextHeight: number;
  145. private continuousDynamicTextHeight: number;
  146. private moodTextHeight: number;
  147. private unknownTextHeight: number;
  148. private continuousTempoTextHeight: number;
  149. private staffLineWidth: number;
  150. private ledgerLineWidth: number;
  151. private wedgeLineWidth: number;
  152. private tupletLineWidth: number;
  153. private lyricUnderscoreLineWidth: number;
  154. private systemThinLineWidth: number;
  155. private systemBoldLineWidth: number;
  156. private systemRepetitionEndingLineWidth: number;
  157. private systemDotWidth: number;
  158. private distanceBetweenVerticalSystemLines: number;
  159. private distanceBetweenDotAndLine: number;
  160. private octaveShiftLineWidth: number;
  161. private octaveShiftVerticalLineLength: number;
  162. private graceLineWidth: number;
  163. private minimumStaffLineDistance: number;
  164. private minimumCrossedBeamDifferenceMargin: number;
  165. private displacedNoteMargin: number;
  166. private minNoteDistance: number;
  167. private subMeasureXSpacingThreshold: number;
  168. private measureDynamicsMaxScalingFactor: number;
  169. private wholeRestXShiftVexflow: number;
  170. private maxInstructionsConstValue: number;
  171. private noteDistances: number[] = [1.0, 1.0, 1.3, 1.6, 2.0, 2.5, 3.0, 4.0];
  172. private noteDistancesScalingFactors: number[] = [1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0];
  173. private durationDistanceDict: {[_: number]: number; } = {};
  174. private durationScalingDistanceDict: {[_: number]: number; } = {};
  175. private coloringEnabled: boolean;
  176. private colorFlags: boolean;
  177. private colorBeams: boolean;
  178. private defaultColorNotehead: string;
  179. private defaultColorRest: string;
  180. private defaultColorStem: string;
  181. private defaultColorLabel: string;
  182. private defaultColorTitle: string;
  183. /** Whether to render a label for the composer of the piece at the top of the sheet. */
  184. private renderComposer: boolean;
  185. private renderTitle: boolean;
  186. private renderSubtitle: boolean;
  187. private renderLyricist: boolean;
  188. private renderInstrumentNames: boolean;
  189. private renderFingerings: boolean;
  190. private dynamicExpressionMaxDistance: number;
  191. private dynamicExpressionSpacer: number;
  192. /** Position of fingering label in relation to corresponding note (left, right supported, above, below experimental) */
  193. private fingeringPosition: PlacementEnum;
  194. private fingeringInsideStafflines: boolean;
  195. constructor() {
  196. // global variables
  197. this.samplingUnit = EngravingRules.unit * 3;
  198. // Page Label Variables
  199. this.sheetTitleHeight = 4.0;
  200. this.sheetSubtitleHeight = 2.0;
  201. this.sheetMinimumDistanceBetweenTitleAndSubtitle = 1.0;
  202. this.sheetComposerHeight = 2.0;
  203. this.sheetAuthorHeight = 2.0;
  204. // Staff sizing Variables
  205. this.compactMode = false;
  206. this.pagePlacementEnum = PagePlacementEnum.Down;
  207. this.pageHeight = 100001.0;
  208. this.pageTopMargin = 5.0;
  209. this.pageTopMarginNarrow = 0.0; // for compact mode
  210. this.pageBottomMargin = 5.0;
  211. this.pageLeftMargin = 5.0;
  212. this.pageRightMargin = 5.0;
  213. this.titleTopDistance = 9.0;
  214. this.titleBottomDistance = 1.0;
  215. this.staffDistance = 7.0;
  216. this.betweenStaffDistance = 5.0;
  217. // System Sizing and Label Variables
  218. this.staffHeight = 4.0;
  219. this.betweenStaffLinesDistance = EngravingRules.unit;
  220. this.systemDistance = 10.0;
  221. this.systemLeftMargin = 0.0;
  222. this.systemRightMargin = 0.0;
  223. this.firstSystemMargin = 15.0;
  224. this.systemLabelsRightMargin = 2.0;
  225. this.systemComposerDistance = 2.0;
  226. this.instrumentLabelTextHeight = 2;
  227. this.minimumAllowedDistanceBetweenSystems = 3.0;
  228. this.lastSystemMaxScalingFactor = 1.4;
  229. // autoBeam options
  230. this.autoBeamNotes = false;
  231. this.autoBeamOptions = {
  232. beam_middle_rests_only: false,
  233. beam_rests: false,
  234. maintain_stem_directions: false
  235. };
  236. // Beam Sizing Variables
  237. this.beamWidth = EngravingRules.unit / 2.0;
  238. this.beamSpaceWidth = EngravingRules.unit / 3.0;
  239. this.beamForwardLength = 1.25 * EngravingRules.unit;
  240. // Beam Sizing Variables
  241. this.clefLeftMargin = 0.5;
  242. this.clefRightMargin = 0.75;
  243. this.betweenKeySymbolsDistance = 0.2;
  244. this.keyRightMargin = 0.75;
  245. this.rhythmRightMargin = 1.25;
  246. this.inStaffClefScalingFactor = 0.8;
  247. this.distanceBetweenNaturalAndSymbolWhenCancelling = 0.4;
  248. // Beam Sizing Variables
  249. this.noteHelperLinesOffset = 0.25;
  250. this.measureLeftMargin = 0.7;
  251. this.measureRightMargin = 0.0;
  252. this.distanceBetweenLastInstructionAndRepetitionBarline = 1.0;
  253. this.arpeggioDistance = 0.6;
  254. // Stems Variables
  255. this.staccatoShorteningFactor = 2;
  256. this.idealStemLength = 3.0;
  257. this.stemNoteHeadBorderYOffset = 0.2;
  258. this.stemWidth = 0.13;
  259. this.stemMargin = 0.2;
  260. this.stemMinLength = 2.5;
  261. this.stemMaxLength = 4.5;
  262. this.beamSlopeMaxAngle = 10.0;
  263. this.stemMinAllowedDistanceBetweenNoteHeadAndBeamLine = 1.0;
  264. this.setWantedStemDirectionByXml = true;
  265. // GraceNote Variables
  266. this.graceNoteScalingFactor = 0.6;
  267. this.graceNoteXOffset = 0.2;
  268. // Wedge Variables
  269. this.wedgeOpeningLength = 1.2;
  270. this.wedgeMeasureEndOpeningLength = 0.75;
  271. this.wedgeMeasureBeginOpeningLength = 0.75;
  272. this.wedgePlacementAboveY = -1.5;
  273. this.wedgePlacementBelowY = 1.5;
  274. this.wedgeHorizontalMargin = 0.6;
  275. this.wedgeVerticalMargin = 0.5;
  276. this.distanceOffsetBetweenTwoHorizontallyCrossedWedges = 0.3;
  277. this.wedgeMinLength = 2.0;
  278. this.distanceBetweenAdjacentDynamics = 0.75;
  279. // Tempo Variables
  280. this.tempoChangeMeasureValidity = 4;
  281. this.tempoContinousFactor = 0.7;
  282. // various
  283. this.staccatoScalingFactor = 0.8;
  284. this.betweenDotsDistance = 0.8;
  285. this.ornamentAccidentalScalingFactor = 0.65;
  286. this.chordSymbolTextHeight = 2.0;
  287. this.chordSymbolYOffset = 2.0;
  288. this.fingeringLabelFontHeight = 1.7;
  289. // Tuplets, MeasureNumber and TupletNumber Labels
  290. this.measureNumberLabelHeight = 1.5 * EngravingRules.unit;
  291. this.measureNumberLabelOffset = 2;
  292. this.tupletsRatioed = false;
  293. this.tupletsBracketed = false;
  294. this.tripletsBracketed = false; // special setting for triplets, overrides tuplet setting (for triplets only)
  295. this.tupletNumberLabelHeight = 1.5 * EngravingRules.unit;
  296. this.tupletNumberYOffset = 0.5;
  297. this.labelMarginBorderFactor = 0.1;
  298. this.tupletVerticalLineLength = 0.5;
  299. // Slur and Tie variables
  300. this.bezierCurveStepSize = 1000;
  301. this.calculateCurveParametersArrays();
  302. this.tieGhostObjectWidth = 0.75;
  303. this.tieYPositionOffsetFactor = 0.3;
  304. this.minimumNeededXspaceForTieGhostObject = 1.0;
  305. this.tieHeightMinimum = 0.28;
  306. this.tieHeightMaximum = 1.2;
  307. this.tieHeightInterpolationK = 0.0288;
  308. this.tieHeightInterpolationD = 0.136;
  309. this.slurNoteHeadYOffset = 0.5;
  310. this.slurStemXOffset = 0.3;
  311. this.slurSlopeMaxAngle = 15.0;
  312. this.slurTangentMinAngle = 30.0;
  313. this.slurTangentMaxAngle = 80.0;
  314. this.slursStartingAtSameStaffEntryYOffset = 0.8;
  315. // Repetitions
  316. this.repetitionEndingLabelHeight = 2.0;
  317. this.repetitionEndingLabelXOffset = 0.5;
  318. this.repetitionEndingLabelYOffset = 0.3;
  319. this.repetitionEndingLineYLowerOffset = 0.5;
  320. this.repetitionEndingLineYUpperOffset = 0.3;
  321. // Lyrics
  322. this.lyricsAlignmentStandard = TextAlignmentEnum.LeftBottom; // CenterBottom and LeftBottom tested, spacing-optimized
  323. this.lyricsHeight = 2.0; // actually size of lyrics
  324. this.lyricsYOffsetToStaffHeight = 3.0; // distance between lyrics and staff. could partly be even lower/dynamic
  325. this.verticalBetweenLyricsDistance = 0.5;
  326. this.horizontalBetweenLyricsDistance = 0.2;
  327. this.betweenSyllableMaximumDistance = 10.0;
  328. this.betweenSyllableMinimumDistance = 0.5; // + 1.0 for CenterAlignment added in lyrics spacing
  329. this.lyricOverlapAllowedIntoNextMeasure = 3.4; // optimal for dashed last lyric, see Land der Berge
  330. this.minimumDistanceBetweenDashes = 10;
  331. // expressions variables
  332. this.instantaneousTempoTextHeight = 2.3;
  333. this.continuousDynamicTextHeight = 2.3;
  334. this.moodTextHeight = 2.3;
  335. this.unknownTextHeight = 2.0;
  336. this.continuousTempoTextHeight = 2.3;
  337. this.dynamicExpressionMaxDistance = 2;
  338. this.dynamicExpressionSpacer = 0.5;
  339. // Line Widths
  340. this.staffLineWidth = 0.12;
  341. this.ledgerLineWidth = 0.12;
  342. this.wedgeLineWidth = 0.12;
  343. this.tupletLineWidth = 0.12;
  344. this.lyricUnderscoreLineWidth = 0.12;
  345. this.systemThinLineWidth = 0.12;
  346. this.systemBoldLineWidth = EngravingRules.unit / 2.0;
  347. this.systemRepetitionEndingLineWidth = 0.12;
  348. this.systemDotWidth = EngravingRules.unit / 5.0;
  349. this.distanceBetweenVerticalSystemLines = 0.35;
  350. this.distanceBetweenDotAndLine = 0.7;
  351. this.octaveShiftLineWidth = 0.12;
  352. this.octaveShiftVerticalLineLength = EngravingRules.unit;
  353. this.graceLineWidth = this.staffLineWidth * this.GraceNoteScalingFactor;
  354. // Line Widths
  355. this.minimumStaffLineDistance = 1.0;
  356. this.minimumCrossedBeamDifferenceMargin = 0.0001;
  357. // xSpacing Variables
  358. this.displacedNoteMargin = 0.1;
  359. this.minNoteDistance = 2.0;
  360. this.subMeasureXSpacingThreshold = 35;
  361. this.measureDynamicsMaxScalingFactor = 2.5;
  362. this.wholeRestXShiftVexflow = -2.5; // VexFlow draws rest notes too far to the right
  363. // Render options (whether to render specific or invisible elements)
  364. this.coloringEnabled = true;
  365. this.colorBeams = true;
  366. this.colorFlags = true;
  367. this.defaultColorNotehead = undefined; // undefined colors mean black
  368. this.defaultColorRest = undefined;
  369. this.defaultColorStem = undefined;
  370. this.defaultColorLabel = undefined;
  371. this.defaultColorTitle = undefined;
  372. this.renderComposer = true;
  373. this.renderTitle = true;
  374. this.renderSubtitle = true;
  375. this.renderLyricist = true;
  376. this.renderInstrumentNames = true;
  377. this.renderFingerings = true;
  378. this.fingeringPosition = PlacementEnum.Left; // easier to get bounding box, and safer for vertical layout
  379. this.fingeringInsideStafflines = false;
  380. this.populateDictionaries();
  381. try {
  382. this.maxInstructionsConstValue = this.ClefLeftMargin + this.ClefRightMargin + this.KeyRightMargin + this.RhythmRightMargin + 11;
  383. //if (FontInfo.Info !== undefined) {
  384. // this.maxInstructionsConstValue += FontInfo.Info.getBoundingBox(MusicSymbol.G_CLEF).width
  385. // + FontInfo.Info.getBoundingBox(MusicSymbol.FOUR).width
  386. // + 7 * FontInfo.Info.getBoundingBox(MusicSymbol.SHARP).width;
  387. //}
  388. } catch (ex) {
  389. log.info("EngravingRules()", ex);
  390. }
  391. }
  392. public static get Rules(): EngravingRules {
  393. return EngravingRules.rules !== undefined ? EngravingRules.rules : (EngravingRules.rules = new EngravingRules());
  394. }
  395. public get SamplingUnit(): number {
  396. return this.samplingUnit;
  397. }
  398. public get SheetTitleHeight(): number {
  399. return this.sheetTitleHeight;
  400. }
  401. public set SheetTitleHeight(value: number) {
  402. this.sheetTitleHeight = value;
  403. }
  404. public get SheetSubtitleHeight(): number {
  405. return this.sheetSubtitleHeight;
  406. }
  407. public set SheetSubtitleHeight(value: number) {
  408. this.sheetSubtitleHeight = value;
  409. }
  410. public get SheetMinimumDistanceBetweenTitleAndSubtitle(): number {
  411. return this.sheetMinimumDistanceBetweenTitleAndSubtitle;
  412. }
  413. public set SheetMinimumDistanceBetweenTitleAndSubtitle(value: number) {
  414. this.sheetMinimumDistanceBetweenTitleAndSubtitle = value;
  415. }
  416. public get SheetComposerHeight(): number {
  417. return this.sheetComposerHeight;
  418. }
  419. public set SheetComposerHeight(value: number) {
  420. this.sheetComposerHeight = value;
  421. }
  422. public get SheetAuthorHeight(): number {
  423. return this.sheetAuthorHeight;
  424. }
  425. public set SheetAuthorHeight(value: number) {
  426. this.sheetAuthorHeight = value;
  427. }
  428. public get PagePlacement(): PagePlacementEnum {
  429. return this.pagePlacementEnum;
  430. }
  431. public set PagePlacement(value: PagePlacementEnum) {
  432. this.pagePlacementEnum = value;
  433. }
  434. public get CompactMode(): boolean {
  435. return this.compactMode;
  436. }
  437. public set CompactMode(value: boolean) {
  438. this.compactMode = value;
  439. }
  440. public get PageHeight(): number {
  441. return this.pageHeight;
  442. }
  443. public set PageHeight(value: number) {
  444. this.pageHeight = value;
  445. }
  446. public get PageTopMargin(): number {
  447. return this.pageTopMargin;
  448. }
  449. public set PageTopMargin(value: number) {
  450. this.pageTopMargin = value;
  451. }
  452. public get PageTopMarginNarrow(): number {
  453. return this.pageTopMarginNarrow;
  454. }
  455. public set PageTopMarginNarrow(value: number) {
  456. this.pageTopMarginNarrow = value;
  457. }
  458. public get PageBottomMargin(): number {
  459. return this.pageBottomMargin;
  460. }
  461. public set PageBottomMargin(value: number) {
  462. this.pageBottomMargin = value;
  463. }
  464. public get PageLeftMargin(): number {
  465. return this.pageLeftMargin;
  466. }
  467. public set PageLeftMargin(value: number) {
  468. this.pageLeftMargin = value;
  469. }
  470. public get PageRightMargin(): number {
  471. return this.pageRightMargin;
  472. }
  473. public set PageRightMargin(value: number) {
  474. this.pageRightMargin = value;
  475. }
  476. public get TitleTopDistance(): number {
  477. return this.titleTopDistance;
  478. }
  479. public set TitleTopDistance(value: number) {
  480. this.titleTopDistance = value;
  481. }
  482. public get TitleBottomDistance(): number {
  483. return this.titleBottomDistance;
  484. }
  485. public set TitleBottomDistance(value: number) {
  486. this.titleBottomDistance = value;
  487. }
  488. public get SystemComposerDistance(): number {
  489. return this.systemComposerDistance;
  490. }
  491. public set SystemComposerDistance(value: number) {
  492. this.systemComposerDistance = value;
  493. }
  494. public get InstrumentLabelTextHeight(): number {
  495. return this.instrumentLabelTextHeight;
  496. }
  497. public set InstrumentLabelTextHeight(value: number) {
  498. this.instrumentLabelTextHeight = value;
  499. }
  500. public get SystemDistance(): number {
  501. return this.systemDistance;
  502. }
  503. public set SystemDistance(value: number) {
  504. this.systemDistance = value;
  505. }
  506. public get SystemLeftMargin(): number {
  507. return this.systemLeftMargin;
  508. }
  509. public set SystemLeftMargin(value: number) {
  510. this.systemLeftMargin = value;
  511. }
  512. public get SystemRightMargin(): number {
  513. return this.systemRightMargin;
  514. }
  515. public set SystemRightMargin(value: number) {
  516. this.systemRightMargin = value;
  517. }
  518. public get FirstSystemMargin(): number {
  519. return this.firstSystemMargin;
  520. }
  521. public set FirstSystemMargin(value: number) {
  522. this.firstSystemMargin = value;
  523. }
  524. public get SystemLabelsRightMargin(): number {
  525. return this.systemLabelsRightMargin;
  526. }
  527. public set SystemLabelsRightMargin(value: number) {
  528. this.systemLabelsRightMargin = value;
  529. }
  530. public get MinimumAllowedDistanceBetweenSystems(): number {
  531. return this.minimumAllowedDistanceBetweenSystems;
  532. }
  533. public set MinimumAllowedDistanceBetweenSystems(value: number) {
  534. this.minimumAllowedDistanceBetweenSystems = value;
  535. }
  536. public get LastSystemMaxScalingFactor(): number {
  537. return this.lastSystemMaxScalingFactor;
  538. }
  539. public set LastSystemMaxScalingFactor(value: number) {
  540. this.lastSystemMaxScalingFactor = value;
  541. }
  542. public get StaffDistance(): number {
  543. return this.staffDistance;
  544. }
  545. public set StaffDistance(value: number) {
  546. this.staffDistance = value;
  547. }
  548. public get BetweenStaffDistance(): number {
  549. return this.betweenStaffDistance;
  550. }
  551. public set BetweenStaffDistance(value: number) {
  552. this.betweenStaffDistance = value;
  553. }
  554. public get StaffHeight(): number {
  555. return this.staffHeight;
  556. }
  557. public set StaffHeight(value: number) {
  558. this.staffHeight = value;
  559. }
  560. public get BetweenStaffLinesDistance(): number {
  561. return this.betweenStaffLinesDistance;
  562. }
  563. public set BetweenStaffLinesDistance(value: number) {
  564. this.betweenStaffLinesDistance = value;
  565. }
  566. public get AutoBeamNotes(): boolean {
  567. return this.autoBeamNotes;
  568. }
  569. public set AutoBeamNotes(value: boolean) {
  570. this.autoBeamNotes = value;
  571. }
  572. public get AutoBeamOptions(): AutoBeamOptions {
  573. return this.autoBeamOptions;
  574. }
  575. public set AutoBeamOptions(value: AutoBeamOptions) {
  576. this.autoBeamOptions = value;
  577. }
  578. public get BeamWidth(): number {
  579. return this.beamWidth;
  580. }
  581. public set BeamWidth(value: number) {
  582. this.beamWidth = value;
  583. }
  584. public get BeamSpaceWidth(): number {
  585. return this.beamSpaceWidth;
  586. }
  587. public set BeamSpaceWidth(value: number) {
  588. this.beamSpaceWidth = value;
  589. }
  590. public get BeamForwardLength(): number {
  591. return this.beamForwardLength;
  592. }
  593. public set BeamForwardLength(value: number) {
  594. this.beamForwardLength = value;
  595. }
  596. public get BetweenKeySymbolsDistance(): number {
  597. return this.betweenKeySymbolsDistance;
  598. }
  599. public set BetweenKeySymbolsDistance(value: number) {
  600. this.betweenKeySymbolsDistance = value;
  601. }
  602. public get ClefLeftMargin(): number {
  603. return this.clefLeftMargin;
  604. }
  605. public set ClefLeftMargin(value: number) {
  606. this.clefLeftMargin = value;
  607. }
  608. public get ClefRightMargin(): number {
  609. return this.clefRightMargin;
  610. }
  611. public set ClefRightMargin(value: number) {
  612. this.clefRightMargin = value;
  613. }
  614. public get KeyRightMargin(): number {
  615. return this.keyRightMargin;
  616. }
  617. public set KeyRightMargin(value: number) {
  618. this.keyRightMargin = value;
  619. }
  620. public get RhythmRightMargin(): number {
  621. return this.rhythmRightMargin;
  622. }
  623. public set RhythmRightMargin(value: number) {
  624. this.rhythmRightMargin = value;
  625. }
  626. public get InStaffClefScalingFactor(): number {
  627. return this.inStaffClefScalingFactor;
  628. }
  629. public set InStaffClefScalingFactor(value: number) {
  630. this.inStaffClefScalingFactor = value;
  631. }
  632. public get DistanceBetweenNaturalAndSymbolWhenCancelling(): number {
  633. return this.distanceBetweenNaturalAndSymbolWhenCancelling;
  634. }
  635. public set DistanceBetweenNaturalAndSymbolWhenCancelling(value: number) {
  636. this.distanceBetweenNaturalAndSymbolWhenCancelling = value;
  637. }
  638. public get NoteHelperLinesOffset(): number {
  639. return this.noteHelperLinesOffset;
  640. }
  641. public set NoteHelperLinesOffset(value: number) {
  642. this.noteHelperLinesOffset = value;
  643. }
  644. public get MeasureLeftMargin(): number {
  645. return this.measureLeftMargin;
  646. }
  647. public set MeasureLeftMargin(value: number) {
  648. this.measureLeftMargin = value;
  649. }
  650. public get MeasureRightMargin(): number {
  651. return this.measureRightMargin;
  652. }
  653. public set MeasureRightMargin(value: number) {
  654. this.measureRightMargin = value;
  655. }
  656. public get DistanceBetweenLastInstructionAndRepetitionBarline(): number {
  657. return this.distanceBetweenLastInstructionAndRepetitionBarline;
  658. }
  659. public set DistanceBetweenLastInstructionAndRepetitionBarline(value: number) {
  660. this.distanceBetweenLastInstructionAndRepetitionBarline = value;
  661. }
  662. public get ArpeggioDistance(): number {
  663. return this.arpeggioDistance;
  664. }
  665. public set ArpeggioDistance(value: number) {
  666. this.arpeggioDistance = value;
  667. }
  668. public get StaccatoShorteningFactor(): number {
  669. return this.staccatoShorteningFactor;
  670. }
  671. public set StaccatoShorteningFactor(value: number) {
  672. this.staccatoShorteningFactor = value;
  673. }
  674. public get IdealStemLength(): number {
  675. return this.idealStemLength;
  676. }
  677. public set IdealStemLength(value: number) {
  678. this.idealStemLength = value;
  679. }
  680. public get StemNoteHeadBorderYOffset(): number {
  681. return this.stemNoteHeadBorderYOffset;
  682. }
  683. public set StemNoteHeadBorderYOffset(value: number) {
  684. this.stemNoteHeadBorderYOffset = value;
  685. }
  686. public get StemWidth(): number {
  687. return this.stemWidth;
  688. }
  689. public set StemWidth(value: number) {
  690. this.stemWidth = value;
  691. }
  692. public get StemMargin(): number {
  693. return this.stemMargin;
  694. }
  695. public set StemMargin(value: number) {
  696. this.stemMargin = value;
  697. }
  698. public get StemMinLength(): number {
  699. return this.stemMinLength;
  700. }
  701. public set StemMinLength(value: number) {
  702. this.stemMinLength = value;
  703. }
  704. public get StemMaxLength(): number {
  705. return this.stemMaxLength;
  706. }
  707. public set StemMaxLength(value: number) {
  708. this.stemMaxLength = value;
  709. }
  710. public get BeamSlopeMaxAngle(): number {
  711. return this.beamSlopeMaxAngle;
  712. }
  713. public set BeamSlopeMaxAngle(value: number) {
  714. this.beamSlopeMaxAngle = value;
  715. }
  716. public get StemMinAllowedDistanceBetweenNoteHeadAndBeamLine(): number {
  717. return this.stemMinAllowedDistanceBetweenNoteHeadAndBeamLine;
  718. }
  719. public set StemMinAllowedDistanceBetweenNoteHeadAndBeamLine(value: number) {
  720. this.stemMinAllowedDistanceBetweenNoteHeadAndBeamLine = value;
  721. }
  722. public get SetWantedStemDirectionByXml(): boolean {
  723. return this.setWantedStemDirectionByXml;
  724. }
  725. public set SetWantedStemDirectionByXml(value: boolean) {
  726. this.setWantedStemDirectionByXml = value;
  727. }
  728. public get GraceNoteScalingFactor(): number {
  729. return this.graceNoteScalingFactor;
  730. }
  731. public set GraceNoteScalingFactor(value: number) {
  732. this.graceNoteScalingFactor = value;
  733. }
  734. public get GraceNoteXOffset(): number {
  735. return this.graceNoteXOffset;
  736. }
  737. public set GraceNoteXOffset(value: number) {
  738. this.graceNoteXOffset = value;
  739. }
  740. public get WedgeOpeningLength(): number {
  741. return this.wedgeOpeningLength;
  742. }
  743. public set WedgeOpeningLength(value: number) {
  744. this.wedgeOpeningLength = value;
  745. }
  746. public get WedgeMeasureEndOpeningLength(): number {
  747. return this.wedgeMeasureEndOpeningLength;
  748. }
  749. public set WedgeMeasureEndOpeningLength(value: number) {
  750. this.wedgeMeasureEndOpeningLength = value;
  751. }
  752. public get WedgeMeasureBeginOpeningLength(): number {
  753. return this.wedgeMeasureBeginOpeningLength;
  754. }
  755. public set WedgeMeasureBeginOpeningLength(value: number) {
  756. this.wedgeMeasureBeginOpeningLength = value;
  757. }
  758. public get WedgePlacementAboveY(): number {
  759. return this.wedgePlacementAboveY;
  760. }
  761. public set WedgePlacementAboveY(value: number) {
  762. this.wedgePlacementAboveY = value;
  763. }
  764. public get WedgePlacementBelowY(): number {
  765. return this.wedgePlacementBelowY;
  766. }
  767. public set WedgePlacementBelowY(value: number) {
  768. this.wedgePlacementBelowY = value;
  769. }
  770. public get WedgeHorizontalMargin(): number {
  771. return this.wedgeHorizontalMargin;
  772. }
  773. public set WedgeHorizontalMargin(value: number) {
  774. this.wedgeHorizontalMargin = value;
  775. }
  776. public get WedgeVerticalMargin(): number {
  777. return this.wedgeVerticalMargin;
  778. }
  779. public set WedgeVerticalMargin(value: number) {
  780. this.wedgeVerticalMargin = value;
  781. }
  782. public get DistanceOffsetBetweenTwoHorizontallyCrossedWedges(): number {
  783. return this.distanceOffsetBetweenTwoHorizontallyCrossedWedges;
  784. }
  785. public set DistanceOffsetBetweenTwoHorizontallyCrossedWedges(value: number) {
  786. this.distanceOffsetBetweenTwoHorizontallyCrossedWedges = value;
  787. }
  788. public get WedgeMinLength(): number {
  789. return this.wedgeMinLength;
  790. }
  791. public set WedgeMinLength(value: number) {
  792. this.wedgeMinLength = value;
  793. }
  794. public get DistanceBetweenAdjacentDynamics(): number {
  795. return this.distanceBetweenAdjacentDynamics;
  796. }
  797. public set DistanceBetweenAdjacentDynamics(value: number) {
  798. this.distanceBetweenAdjacentDynamics = value;
  799. }
  800. public get TempoChangeMeasureValidity(): number {
  801. return this.tempoChangeMeasureValidity;
  802. }
  803. public set TempoChangeMeasureValidity(value: number) {
  804. this.tempoChangeMeasureValidity = value;
  805. }
  806. public get TempoContinousFactor(): number {
  807. return this.tempoContinousFactor;
  808. }
  809. public set TempoContinousFactor(value: number) {
  810. this.tempoContinousFactor = value;
  811. }
  812. public get StaccatoScalingFactor(): number {
  813. return this.staccatoScalingFactor;
  814. }
  815. public set StaccatoScalingFactor(value: number) {
  816. this.staccatoScalingFactor = value;
  817. }
  818. public get BetweenDotsDistance(): number {
  819. return this.betweenDotsDistance;
  820. }
  821. public set BetweenDotsDistance(value: number) {
  822. this.betweenDotsDistance = value;
  823. }
  824. public get OrnamentAccidentalScalingFactor(): number {
  825. return this.ornamentAccidentalScalingFactor;
  826. }
  827. public set OrnamentAccidentalScalingFactor(value: number) {
  828. this.ornamentAccidentalScalingFactor = value;
  829. }
  830. public get ChordSymbolTextHeight(): number {
  831. return this.chordSymbolTextHeight;
  832. }
  833. public set ChordSymbolTextHeight(value: number) {
  834. this.chordSymbolTextHeight = value;
  835. }
  836. public get ChordSymbolYOffset(): number {
  837. return this.chordSymbolYOffset;
  838. }
  839. public set ChordSymbolYOffset(value: number) {
  840. this.chordSymbolYOffset = value;
  841. }
  842. public get FingeringLabelFontHeight(): number {
  843. return this.fingeringLabelFontHeight;
  844. }
  845. public set FingeringLabelFontHeight(value: number) {
  846. this.fingeringLabelFontHeight = value;
  847. }
  848. public get MeasureNumberLabelHeight(): number {
  849. return this.measureNumberLabelHeight;
  850. }
  851. public set MeasureNumberLabelHeight(value: number) {
  852. this.measureNumberLabelHeight = value;
  853. }
  854. public get MeasureNumberLabelOffset(): number {
  855. return this.measureNumberLabelOffset;
  856. }
  857. public set MeasureNumberLabelOffset(value: number) {
  858. this.measureNumberLabelOffset = value;
  859. }
  860. public get TupletsRatioed(): boolean {
  861. return this.tupletsRatioed;
  862. }
  863. public set TupletsRatioed(value: boolean) {
  864. this.tupletsRatioed = value;
  865. }
  866. public get TupletsBracketed(): boolean {
  867. return this.tupletsBracketed;
  868. }
  869. public set TupletsBracketed(value: boolean) {
  870. this.tupletsBracketed = value;
  871. }
  872. public get TripletsBracketed(): boolean {
  873. return this.tripletsBracketed;
  874. }
  875. public set TripletsBracketed(value: boolean) {
  876. this.tripletsBracketed = value;
  877. }
  878. public get TupletNumberLabelHeight(): number {
  879. return this.tupletNumberLabelHeight;
  880. }
  881. public set TupletNumberLabelHeight(value: number) {
  882. this.tupletNumberLabelHeight = value;
  883. }
  884. public get TupletNumberYOffset(): number {
  885. return this.tupletNumberYOffset;
  886. }
  887. public set TupletNumberYOffset(value: number) {
  888. this.tupletNumberYOffset = value;
  889. }
  890. public get LabelMarginBorderFactor(): number {
  891. return this.labelMarginBorderFactor;
  892. }
  893. public set LabelMarginBorderFactor(value: number) {
  894. this.labelMarginBorderFactor = value;
  895. }
  896. public get TupletVerticalLineLength(): number {
  897. return this.tupletVerticalLineLength;
  898. }
  899. public set TupletVerticalLineLength(value: number) {
  900. this.tupletVerticalLineLength = value;
  901. }
  902. public get RepetitionEndingLabelHeight(): number {
  903. return this.repetitionEndingLabelHeight;
  904. }
  905. public set RepetitionEndingLabelHeight(value: number) {
  906. this.repetitionEndingLabelHeight = value;
  907. }
  908. public get RepetitionEndingLabelXOffset(): number {
  909. return this.repetitionEndingLabelXOffset;
  910. }
  911. public set RepetitionEndingLabelXOffset(value: number) {
  912. this.repetitionEndingLabelXOffset = value;
  913. }
  914. public get RepetitionEndingLabelYOffset(): number {
  915. return this.repetitionEndingLabelYOffset;
  916. }
  917. public set RepetitionEndingLabelYOffset(value: number) {
  918. this.repetitionEndingLabelYOffset = value;
  919. }
  920. public get RepetitionEndingLineYLowerOffset(): number {
  921. return this.repetitionEndingLineYLowerOffset;
  922. }
  923. public set RepetitionEndingLineYLowerOffset(value: number) {
  924. this.repetitionEndingLineYLowerOffset = value;
  925. }
  926. public get RepetitionEndingLineYUpperOffset(): number {
  927. return this.repetitionEndingLineYUpperOffset;
  928. }
  929. public set RepetitionEndingLineYUpperOffset(value: number) {
  930. this.repetitionEndingLineYUpperOffset = value;
  931. }
  932. public get LyricsAlignmentStandard(): TextAlignmentEnum {
  933. return this.lyricsAlignmentStandard;
  934. }
  935. public set LyricsAlignmentStandard(value: TextAlignmentEnum) {
  936. this.lyricsAlignmentStandard = value;
  937. }
  938. public get LyricsHeight(): number {
  939. return this.lyricsHeight;
  940. }
  941. public set LyricsHeight(value: number) {
  942. this.lyricsHeight = value;
  943. }
  944. public get LyricsYOffsetToStaffHeight(): number {
  945. return this.lyricsYOffsetToStaffHeight;
  946. }
  947. public set LyricsYOffsetToStaffHeight(value: number) {
  948. this.lyricsYOffsetToStaffHeight = value;
  949. }
  950. public get VerticalBetweenLyricsDistance(): number {
  951. return this.verticalBetweenLyricsDistance;
  952. }
  953. public set VerticalBetweenLyricsDistance(value: number) {
  954. this.verticalBetweenLyricsDistance = value;
  955. }
  956. public get HorizontalBetweenLyricsDistance(): number {
  957. return this.horizontalBetweenLyricsDistance;
  958. }
  959. public set HorizontalBetweenLyricsDistance(value: number) {
  960. this.horizontalBetweenLyricsDistance = value;
  961. }
  962. public get BetweenSyllableMaximumDistance(): number {
  963. return this.betweenSyllableMaximumDistance;
  964. }
  965. public set BetweenSyllableMaximumDistance(value: number) {
  966. this.betweenSyllableMaximumDistance = value;
  967. }
  968. public get BetweenSyllableMinimumDistance(): number {
  969. return this.betweenSyllableMinimumDistance;
  970. }
  971. public set BetweenSyllableMinimumDistance(value: number) {
  972. this.betweenSyllableMinimumDistance = value;
  973. }
  974. public get LyricOverlapAllowedIntoNextMeasure(): number {
  975. return this.lyricOverlapAllowedIntoNextMeasure;
  976. }
  977. public set LyricOverlapAllowedIntoNextMeasure(value: number) {
  978. this.lyricOverlapAllowedIntoNextMeasure = value;
  979. }
  980. public get MinimumDistanceBetweenDashes(): number {
  981. return this.minimumDistanceBetweenDashes;
  982. }
  983. public set MinimumDistanceBetweenDashes(value: number) {
  984. this.minimumDistanceBetweenDashes = value;
  985. }
  986. public get BezierCurveStepSize(): number {
  987. return this.bezierCurveStepSize;
  988. }
  989. public set BezierCurveStepSize(value: number) {
  990. this.bezierCurveStepSize = value;
  991. }
  992. public get TPow3(): number[] {
  993. return this.tPower3;
  994. }
  995. public set TPow3(value: number[]) {
  996. this.tPower3 = value;
  997. }
  998. public get OneMinusTPow3(): number[] {
  999. return this.oneMinusTPower3;
  1000. }
  1001. public set OneMinusTPow3(value: number[]) {
  1002. this.oneMinusTPower3 = value;
  1003. }
  1004. public get BezierFactorOne(): number[] {
  1005. return this.factorOne;
  1006. }
  1007. public set BezierFactorOne(value: number[]) {
  1008. this.factorOne = value;
  1009. }
  1010. public get BezierFactorTwo(): number[] {
  1011. return this.factorTwo;
  1012. }
  1013. public set BezierFactorTwo(value: number[]) {
  1014. this.factorTwo = value;
  1015. }
  1016. public get TieGhostObjectWidth(): number {
  1017. return this.tieGhostObjectWidth;
  1018. }
  1019. public set TieGhostObjectWidth(value: number) {
  1020. this.tieGhostObjectWidth = value;
  1021. }
  1022. public get TieYPositionOffsetFactor(): number {
  1023. return this.tieYPositionOffsetFactor;
  1024. }
  1025. public set TieYPositionOffsetFactor(value: number) {
  1026. this.tieYPositionOffsetFactor = value;
  1027. }
  1028. public get MinimumNeededXspaceForTieGhostObject(): number {
  1029. return this.minimumNeededXspaceForTieGhostObject;
  1030. }
  1031. public set MinimumNeededXspaceForTieGhostObject(value: number) {
  1032. this.minimumNeededXspaceForTieGhostObject = value;
  1033. }
  1034. public get TieHeightMinimum(): number {
  1035. return this.tieHeightMinimum;
  1036. }
  1037. public set TieHeightMinimum(value: number) {
  1038. this.tieHeightMinimum = value;
  1039. }
  1040. public get TieHeightMaximum(): number {
  1041. return this.tieHeightMaximum;
  1042. }
  1043. public set TieHeightMaximum(value: number) {
  1044. this.tieHeightMaximum = value;
  1045. }
  1046. public get TieHeightInterpolationK(): number {
  1047. return this.tieHeightInterpolationK;
  1048. }
  1049. public set TieHeightInterpolationK(value: number) {
  1050. this.tieHeightInterpolationK = value;
  1051. }
  1052. public get TieHeightInterpolationD(): number {
  1053. return this.tieHeightInterpolationD;
  1054. }
  1055. public set TieHeightInterpolationD(value: number) {
  1056. this.tieHeightInterpolationD = value;
  1057. }
  1058. public get SlurNoteHeadYOffset(): number {
  1059. return this.slurNoteHeadYOffset;
  1060. }
  1061. public set SlurNoteHeadYOffset(value: number) {
  1062. this.slurNoteHeadYOffset = value;
  1063. }
  1064. public get SlurStemXOffset(): number {
  1065. return this.slurStemXOffset;
  1066. }
  1067. public set SlurStemXOffset(value: number) {
  1068. this.slurStemXOffset = value;
  1069. }
  1070. public get SlurSlopeMaxAngle(): number {
  1071. return this.slurSlopeMaxAngle;
  1072. }
  1073. public set SlurSlopeMaxAngle(value: number) {
  1074. this.slurSlopeMaxAngle = value;
  1075. }
  1076. public get SlurTangentMinAngle(): number {
  1077. return this.slurTangentMinAngle;
  1078. }
  1079. public set SlurTangentMinAngle(value: number) {
  1080. this.slurTangentMinAngle = value;
  1081. }
  1082. public get SlurTangentMaxAngle(): number {
  1083. return this.slurTangentMaxAngle;
  1084. }
  1085. public set SlurTangentMaxAngle(value: number) {
  1086. this.slurTangentMaxAngle = value;
  1087. }
  1088. public get SlursStartingAtSameStaffEntryYOffset(): number {
  1089. return this.slursStartingAtSameStaffEntryYOffset;
  1090. }
  1091. public set SlursStartingAtSameStaffEntryYOffset(value: number) {
  1092. this.slursStartingAtSameStaffEntryYOffset = value;
  1093. }
  1094. public get InstantaneousTempoTextHeight(): number {
  1095. return this.instantaneousTempoTextHeight;
  1096. }
  1097. public set InstantaneousTempoTextHeight(value: number) {
  1098. this.instantaneousTempoTextHeight = value;
  1099. }
  1100. public get ContinuousDynamicTextHeight(): number {
  1101. return this.continuousDynamicTextHeight;
  1102. }
  1103. public set ContinuousDynamicTextHeight(value: number) {
  1104. this.continuousDynamicTextHeight = value;
  1105. }
  1106. public get MoodTextHeight(): number {
  1107. return this.moodTextHeight;
  1108. }
  1109. public set MoodTextHeight(value: number) {
  1110. this.moodTextHeight = value;
  1111. }
  1112. public get ContinuousTempoTextHeight(): number {
  1113. return this.continuousTempoTextHeight;
  1114. }
  1115. public set ContinuousTempoTextHeight(value: number) {
  1116. this.continuousTempoTextHeight = value;
  1117. }
  1118. /** Distance of expressions inside a group */
  1119. public get DynamicExpressionMaxDistance(): number {
  1120. return this.dynamicExpressionMaxDistance;
  1121. }
  1122. public set DynamicExpressionMaxDistance(value: number) {
  1123. this.dynamicExpressionMaxDistance = value;
  1124. }
  1125. /** Space between expressions in a group */
  1126. public get DynamicExpressionSpacer(): number {
  1127. return this.dynamicExpressionSpacer;
  1128. }
  1129. public set DynamicExpressionSpacer(value: number) {
  1130. this.dynamicExpressionSpacer = value;
  1131. }
  1132. public get UnknownTextHeight(): number {
  1133. return this.unknownTextHeight;
  1134. }
  1135. public set UnknownTextHeight(value: number) {
  1136. this.unknownTextHeight = value;
  1137. }
  1138. public get StaffLineWidth(): number {
  1139. return this.staffLineWidth;
  1140. }
  1141. public set StaffLineWidth(value: number) {
  1142. this.staffLineWidth = value;
  1143. }
  1144. public get LedgerLineWidth(): number {
  1145. return this.ledgerLineWidth;
  1146. }
  1147. public set LedgerLineWidth(value: number) {
  1148. this.ledgerLineWidth = value;
  1149. }
  1150. public get WedgeLineWidth(): number {
  1151. return this.wedgeLineWidth;
  1152. }
  1153. public set WedgeLineWidth(value: number) {
  1154. this.wedgeLineWidth = value;
  1155. }
  1156. public get TupletLineWidth(): number {
  1157. return this.tupletLineWidth;
  1158. }
  1159. public set TupletLineWidth(value: number) {
  1160. this.tupletLineWidth = value;
  1161. }
  1162. public get LyricUnderscoreLineWidth(): number {
  1163. return this.lyricUnderscoreLineWidth;
  1164. }
  1165. public set LyricUnderscoreLineWidth(value: number) {
  1166. this.lyricUnderscoreLineWidth = value;
  1167. }
  1168. public get SystemThinLineWidth(): number {
  1169. return this.systemThinLineWidth;
  1170. }
  1171. public set SystemThinLineWidth(value: number) {
  1172. this.systemThinLineWidth = value;
  1173. }
  1174. public get SystemBoldLineWidth(): number {
  1175. return this.systemBoldLineWidth;
  1176. }
  1177. public set SystemBoldLineWidth(value: number) {
  1178. this.systemBoldLineWidth = value;
  1179. }
  1180. public get SystemRepetitionEndingLineWidth(): number {
  1181. return this.systemRepetitionEndingLineWidth;
  1182. }
  1183. public set SystemRepetitionEndingLineWidth(value: number) {
  1184. this.systemRepetitionEndingLineWidth = value;
  1185. }
  1186. public get SystemDotWidth(): number {
  1187. return this.systemDotWidth;
  1188. }
  1189. public set SystemDotWidth(value: number) {
  1190. this.systemDotWidth = value;
  1191. }
  1192. public get DistanceBetweenVerticalSystemLines(): number {
  1193. return this.distanceBetweenVerticalSystemLines;
  1194. }
  1195. public set DistanceBetweenVerticalSystemLines(value: number) {
  1196. this.distanceBetweenVerticalSystemLines = value;
  1197. }
  1198. public get DistanceBetweenDotAndLine(): number {
  1199. return this.distanceBetweenDotAndLine;
  1200. }
  1201. public set DistanceBetweenDotAndLine(value: number) {
  1202. this.distanceBetweenDotAndLine = value;
  1203. }
  1204. public get OctaveShiftLineWidth(): number {
  1205. return this.octaveShiftLineWidth;
  1206. }
  1207. public set OctaveShiftLineWidth(value: number) {
  1208. this.octaveShiftLineWidth = value;
  1209. }
  1210. public get OctaveShiftVerticalLineLength(): number {
  1211. return this.octaveShiftVerticalLineLength;
  1212. }
  1213. public set OctaveShiftVerticalLineLength(value: number) {
  1214. this.octaveShiftVerticalLineLength = value;
  1215. }
  1216. public get GraceLineWidth(): number {
  1217. return this.graceLineWidth;
  1218. }
  1219. public set GraceLineWidth(value: number) {
  1220. this.graceLineWidth = value;
  1221. }
  1222. public get MinimumStaffLineDistance(): number {
  1223. return this.minimumStaffLineDistance;
  1224. }
  1225. public set MinimumStaffLineDistance(value: number) {
  1226. this.minimumStaffLineDistance = value;
  1227. }
  1228. public get MinimumCrossedBeamDifferenceMargin(): number {
  1229. return this.minimumCrossedBeamDifferenceMargin;
  1230. }
  1231. public set MinimumCrossedBeamDifferenceMargin(value: number) {
  1232. this.minimumCrossedBeamDifferenceMargin = value;
  1233. }
  1234. public get DisplacedNoteMargin(): number {
  1235. return this.displacedNoteMargin;
  1236. }
  1237. public set DisplacedNoteMargin(value: number) {
  1238. this.displacedNoteMargin = value;
  1239. }
  1240. public get MinNoteDistance(): number {
  1241. return this.minNoteDistance;
  1242. }
  1243. public set MinNoteDistance(value: number) {
  1244. this.minNoteDistance = value;
  1245. }
  1246. public get SubMeasureXSpacingThreshold(): number {
  1247. return this.subMeasureXSpacingThreshold;
  1248. }
  1249. public set SubMeasureXSpacingThreshold(value: number) {
  1250. this.subMeasureXSpacingThreshold = value;
  1251. }
  1252. public get MeasureDynamicsMaxScalingFactor(): number {
  1253. return this.measureDynamicsMaxScalingFactor;
  1254. }
  1255. public set MeasureDynamicsMaxScalingFactor(value: number) {
  1256. this.measureDynamicsMaxScalingFactor = value;
  1257. }
  1258. public get WholeRestXShiftVexflow(): number {
  1259. return this.wholeRestXShiftVexflow;
  1260. }
  1261. public set WholeRestXShiftVexflow(value: number) {
  1262. this.wholeRestXShiftVexflow = value;
  1263. }
  1264. public get MaxInstructionsConstValue(): number {
  1265. return this.maxInstructionsConstValue;
  1266. }
  1267. public set MaxInstructionsConstValue(value: number) {
  1268. this.maxInstructionsConstValue = value;
  1269. }
  1270. public get NoteDistances(): number[] {
  1271. return this.noteDistances;
  1272. }
  1273. public set NoteDistances(value: number[]) {
  1274. this.noteDistances = value;
  1275. }
  1276. public get NoteDistancesScalingFactors(): number[] {
  1277. return this.noteDistancesScalingFactors;
  1278. }
  1279. public set NoteDistancesScalingFactors(value: number[]) {
  1280. this.noteDistancesScalingFactors = value;
  1281. }
  1282. public get DurationDistanceDict(): {[_: number]: number; } {
  1283. return this.durationDistanceDict;
  1284. }
  1285. public get DurationScalingDistanceDict(): {[_: number]: number; } {
  1286. return this.durationScalingDistanceDict;
  1287. }
  1288. public get ColoringEnabled(): boolean {
  1289. return this.coloringEnabled;
  1290. }
  1291. public set ColoringEnabled(value: boolean) {
  1292. this.coloringEnabled = value;
  1293. }
  1294. public get ColorFlags(): boolean {
  1295. return this.colorFlags;
  1296. }
  1297. public set ColorFlags(value: boolean) {
  1298. this.colorFlags = value;
  1299. }
  1300. public get ColorBeams(): boolean {
  1301. return this.colorBeams;
  1302. }
  1303. public set ColorBeams(value: boolean) {
  1304. this.colorBeams = value;
  1305. }
  1306. public get DefaultColorNotehead(): string {
  1307. return this.defaultColorNotehead;
  1308. }
  1309. public set DefaultColorNotehead(value: string) {
  1310. this.defaultColorNotehead = value;
  1311. }
  1312. public get DefaultColorRest(): string {
  1313. return this.defaultColorRest;
  1314. }
  1315. public set DefaultColorRest(value: string) {
  1316. this.defaultColorRest = value;
  1317. }
  1318. public get DefaultColorStem(): string {
  1319. return this.defaultColorStem;
  1320. }
  1321. public set DefaultColorStem(value: string) {
  1322. this.defaultColorStem = value;
  1323. }
  1324. public get DefaultColorLabel(): string {
  1325. return this.defaultColorLabel;
  1326. }
  1327. public set DefaultColorLabel(value: string) {
  1328. this.defaultColorLabel = value;
  1329. }
  1330. public get DefaultColorTitle(): string {
  1331. return this.defaultColorTitle;
  1332. }
  1333. public set DefaultColorTitle(value: string) {
  1334. this.defaultColorTitle = value;
  1335. }
  1336. public get RenderComposer(): boolean {
  1337. return this.renderComposer;
  1338. }
  1339. public set RenderComposer(value: boolean) {
  1340. this.renderComposer = value;
  1341. }
  1342. public get RenderTitle(): boolean {
  1343. return this.renderTitle;
  1344. }
  1345. public set RenderTitle(value: boolean) {
  1346. this.renderTitle = value;
  1347. }
  1348. public get RenderSubtitle(): boolean {
  1349. return this.renderSubtitle;
  1350. }
  1351. public set RenderSubtitle(value: boolean) {
  1352. this.renderSubtitle = value;
  1353. }
  1354. public get RenderLyricist(): boolean {
  1355. return this.renderLyricist;
  1356. }
  1357. public set RenderLyricist(value: boolean) {
  1358. this.renderLyricist = value;
  1359. }
  1360. public get RenderInstrumentNames(): boolean {
  1361. return this.renderInstrumentNames;
  1362. }
  1363. public set RenderInstrumentNames(value: boolean) {
  1364. this.renderInstrumentNames = value;
  1365. }
  1366. public get RenderFingerings(): boolean {
  1367. return this.renderFingerings;
  1368. }
  1369. public set RenderFingerings(value: boolean) {
  1370. this.renderFingerings = value;
  1371. }
  1372. public get FingeringPosition(): PlacementEnum {
  1373. return this.fingeringPosition;
  1374. }
  1375. public set FingeringPosition(value: PlacementEnum) {
  1376. this.fingeringPosition = value;
  1377. }
  1378. public get FingeringInsideStafflines(): boolean {
  1379. return this.fingeringInsideStafflines;
  1380. }
  1381. public set FingeringInsideStafflines(value: boolean) {
  1382. this.fingeringInsideStafflines = value;
  1383. }
  1384. /**
  1385. * This method maps NoteDurations to Distances and DistancesScalingFactors.
  1386. */
  1387. private populateDictionaries(): void {
  1388. for (let i: number = 0; i < this.noteDistances.length; i++) {
  1389. switch (i) {
  1390. case 0:
  1391. this.durationDistanceDict[0.015625] = this.noteDistances[i];
  1392. this.durationScalingDistanceDict[0.015625] = this.noteDistancesScalingFactors[i];
  1393. break;
  1394. case 1:
  1395. this.durationDistanceDict[0.03125] = this.noteDistances[i];
  1396. this.durationScalingDistanceDict[0.03125] = this.noteDistancesScalingFactors[i];
  1397. break;
  1398. case 2:
  1399. this.durationDistanceDict[0.0625] = this.noteDistances[i];
  1400. this.durationScalingDistanceDict[0.0625] = this.noteDistancesScalingFactors[i];
  1401. break;
  1402. case 3:
  1403. this.durationDistanceDict[0.125] = this.noteDistances[i];
  1404. this.durationScalingDistanceDict[0.125] = this.noteDistancesScalingFactors[i];
  1405. break;
  1406. case 4:
  1407. this.durationDistanceDict[0.25] = this.noteDistances[i];
  1408. this.durationScalingDistanceDict[0.25] = this.noteDistancesScalingFactors[i];
  1409. break;
  1410. case 5:
  1411. this.durationDistanceDict[0.5] = this.noteDistances[i];
  1412. this.durationScalingDistanceDict[0.5] = this.noteDistancesScalingFactors[i];
  1413. break;
  1414. case 6:
  1415. this.durationDistanceDict[1.0] = this.noteDistances[i];
  1416. this.durationScalingDistanceDict[1.0] = this.noteDistancesScalingFactors[i];
  1417. break;
  1418. case 7:
  1419. this.durationDistanceDict[2.0] = this.noteDistances[i];
  1420. this.durationScalingDistanceDict[2.0] = this.noteDistancesScalingFactors[i];
  1421. break;
  1422. default:
  1423. // FIXME
  1424. }
  1425. }
  1426. }
  1427. /**
  1428. * Calculate Curve-independend factors, to be used later in the Slur- and TieCurvePoints calculation
  1429. */
  1430. private calculateCurveParametersArrays(): void {
  1431. this.tPower3 = new Array(this.bezierCurveStepSize);
  1432. this.oneMinusTPower3 = new Array(this.bezierCurveStepSize);
  1433. this.factorOne = new Array(this.bezierCurveStepSize);
  1434. this.factorTwo = new Array(this.bezierCurveStepSize);
  1435. for (let i: number = 0; i < this.bezierCurveStepSize; i++) {
  1436. const t: number = i / this.bezierCurveStepSize;
  1437. this.tPower3[i] = Math.pow(t, 3);
  1438. this.oneMinusTPower3[i] = Math.pow((1 - t), 3);
  1439. this.factorOne[i] = 3 * Math.pow((1 - t), 2) * t;
  1440. this.factorTwo[i] = 3 * (1 - t) * Math.pow(t, 2);
  1441. }
  1442. }
  1443. }