EngravingRules.ts 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175
  1. import {PagePlacementEnum} from "./GraphicalMusicPage";
  2. //import {MusicSymbol} from "./MusicSymbol";
  3. import {Logging} from "../../Common/Logging";
  4. export class EngravingRules {
  5. private static rules: EngravingRules;
  6. private static unit: number = 1.0;
  7. private samplingUnit: number;
  8. private staccatoShorteningFactor: number;
  9. private sheetTitleHeight: number;
  10. private sheetSubtitleHeight: number;
  11. private sheetMinimumDistanceBetweenTitleAndSubtitle: number;
  12. private sheetComposerHeight: number;
  13. private sheetAuthorHeight: number;
  14. private pagePlacementEnum: PagePlacementEnum;
  15. private pageHeight: number;
  16. private pageTopMargin: number;
  17. private pageBottomMargin: number;
  18. private pageLeftMargin: number;
  19. private pageRightMargin: number;
  20. private titleTopDistance: number;
  21. private titleBottomDistance: number;
  22. private systemDistance: number;
  23. private systemLeftMargin: number;
  24. private systemRightMargin: number;
  25. private firstSystemMargin: number;
  26. private systemLabelsRightMargin: number;
  27. private systemComposerDistance: number;
  28. private instrumentLabelTextHeight: number;
  29. private minimumAllowedDistanceBetweenSystems: number;
  30. private lastSystemMaxScalingFactor: number;
  31. private staffDistance: number;
  32. private betweenStaffDistance: number;
  33. private staffHeight: number;
  34. private betweenStaffLinesDistance: number;
  35. private beamWidth: number;
  36. private beamSpaceWidth: number;
  37. private beamForwardLength: number;
  38. private clefLeftMargin: number;
  39. private clefRightMargin: number;
  40. private betweenKeySymbolsDistance: number;
  41. private keyRightMargin: number;
  42. private rhythmRightMargin: number;
  43. private inStaffClefScalingFactor: number;
  44. private distanceBetweenNaturalAndSymbolWhenCancelling: number;
  45. private noteHelperLinesOffset: number;
  46. private measureLeftMargin: number;
  47. private measureRightMargin: number;
  48. private distanceBetweenLastInstructionAndRepetitionBarline: number;
  49. private arpeggioDistance: number;
  50. private idealStemLength: number;
  51. private stemNoteHeadBorderYOffset: number;
  52. private stemWidth: number;
  53. private stemMargin: number;
  54. private stemMinLength: number;
  55. private stemMaxLength: number;
  56. private beamSlopeMaxAngle: number;
  57. private stemMinAllowedDistanceBetweenNoteHeadAndBeamLine: number;
  58. private graceNoteScalingFactor: number;
  59. private graceNoteXOffset: number;
  60. private wedgeOpeningLength: number;
  61. private wedgeMeasureEndOpeningLength: number;
  62. private wedgeMeasureBeginOpeningLength: number;
  63. private wedgePlacementAboveY: number;
  64. private wedgePlacementBelowY: number;
  65. private wedgeHorizontalMargin: number;
  66. private wedgeVerticalMargin: number;
  67. private distanceOffsetBetweenTwoHorizontallyCrossedWedges: number;
  68. private wedgeMinLength: number;
  69. private distanceBetweenAdjacentDynamics: number;
  70. private tempoChangeMeasureValitidy: number;
  71. private tempoContinousFactor: number;
  72. private staccatoScalingFactor: number;
  73. private betweenDotsDistance: number;
  74. private ornamentAccidentalScalingFactor: number;
  75. private chordSymbolTextHeight: number;
  76. //private chordSymbolYOffset: number;
  77. private fingeringLabelFontHeight: number;
  78. private measureNumberLabelHeight: number;
  79. private measureNumberLabelOffset: number;
  80. private tupletNumberLabelHeight: number;
  81. private tupletNumberYOffset: number;
  82. private labelMarginBorderFactor: number;
  83. private tupletVerticalLineLength: number;
  84. private repetitionEndingLabelHeight: number;
  85. private repetitionEndingLabelXOffset: number;
  86. private repetitionEndingLabelYOffset: number;
  87. private repetitionEndingLineYLowerOffset: number;
  88. private repetitionEndingLineYUpperOffset: number;
  89. private lyricsHeight: number;
  90. private verticalBetweenLyricsDistance: number;
  91. private betweenSyllabelMaximumDistance: number;
  92. private minimumDistanceBetweenDashes: number;
  93. private bezierCurveStepSize: number;
  94. private tPower3: number[];
  95. private oneMinusTPower3: number[];
  96. private factorOne: number[];
  97. private factorTwo: number[];
  98. private tieGhostObjectWidth: number;
  99. private tieYPositionOffsetFactor: number;
  100. private minimumNeededXspaceForTieGhostObject: number;
  101. private tieHeightMinimum: number;
  102. private tieHeightMaximum: number;
  103. private tieHeightInterpolationK: number;
  104. private tieHeightInterpolationD: number;
  105. private slurNoteHeadYOffset: number;
  106. private slurStemXOffset: number;
  107. private slurSlopeMaxAngle: number;
  108. private slurTangentMinAngle: number;
  109. private slurTangentMaxAngle: number;
  110. private slursStartingAtSameStaffEntryYOffset: number;
  111. private instantaniousTempoTextHeight: number;
  112. private continuousDynamicTextHeight: number;
  113. private moodTextHeight: number;
  114. private unknownTextHeight: number;
  115. private continuousTempoTextHeight: number;
  116. private staffLineWidth: number;
  117. private ledgerLineWidth: number;
  118. private wedgeLineWidth: number;
  119. private tupletLineWidth: number;
  120. private lyricUnderscoreLineWidth: number;
  121. private systemThinLineWidth: number;
  122. private systemBoldLineWidth: number;
  123. private systemRepetitionEndingLineWidth: number;
  124. private systemDotWidth: number;
  125. private distanceBetweenVerticalSystemLines: number;
  126. private distanceBetweenDotAndLine: number;
  127. private octaveShiftLineWidth: number;
  128. private octaveShiftVerticalLineLength: number;
  129. private graceLineWidth: number;
  130. private minimumStaffLineDistance: number;
  131. private minimumCrossedBeamDifferenceMargin: number;
  132. private displacedNoteMargin: number;
  133. private minNoteDistance: number;
  134. private subMeasureXSpacingThreshold: number;
  135. private measureDynamicsMaxScalingFactor: number;
  136. private maxInstructionsConstValue: number;
  137. private noteDistances: number[] = [1.0, 1.0, 1.3, 1.6, 2.0, 2.5, 3.0, 4.0];
  138. private noteDistancesScalingFactors: number[] = [1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0];
  139. private durationDistanceDict: {[_: number]: number; } = {};
  140. private durationScalingDistanceDict: {[_: number]: number; } = {};
  141. constructor() {
  142. // global variables
  143. this.samplingUnit = EngravingRules.unit * 3;
  144. // Page Label Variables
  145. this.sheetTitleHeight = 4.0;
  146. this.sheetSubtitleHeight = 2.0;
  147. this.sheetMinimumDistanceBetweenTitleAndSubtitle = 1.0;
  148. this.sheetComposerHeight = 2.0;
  149. this.sheetAuthorHeight = 2.0;
  150. // Staff sizing Variables
  151. this.pagePlacementEnum = PagePlacementEnum.Down;
  152. this.pageHeight = 100001.0;
  153. this.pageTopMargin = 5.0;
  154. this.pageBottomMargin = 5.0;
  155. this.pageLeftMargin = 5.0;
  156. this.pageRightMargin = 5.0;
  157. this.titleTopDistance = 9.0;
  158. this.titleBottomDistance = 1.0;
  159. this.staffDistance = 7.0;
  160. this.betweenStaffDistance = 5.0;
  161. // System Sizing and Label Variables
  162. this.staffHeight = 4.0;
  163. this.betweenStaffLinesDistance = EngravingRules.unit;
  164. this.systemDistance = 10.0;
  165. this.systemLeftMargin = 0.0;
  166. this.systemRightMargin = 0.0;
  167. this.firstSystemMargin = 15.0;
  168. this.systemLabelsRightMargin = 2.0;
  169. this.systemComposerDistance = 2.0;
  170. this.instrumentLabelTextHeight = 2;
  171. this.minimumAllowedDistanceBetweenSystems = 3.0;
  172. this.lastSystemMaxScalingFactor = 1.4;
  173. // Beam Sizing Variables
  174. this.beamWidth = EngravingRules.unit / 2.0;
  175. this.beamSpaceWidth = EngravingRules.unit / 3.0;
  176. this.beamForwardLength = 1.25 * EngravingRules.unit;
  177. // Beam Sizing Variables
  178. this.clefLeftMargin = 0.5;
  179. this.clefRightMargin = 0.75;
  180. this.betweenKeySymbolsDistance = 0.2;
  181. this.keyRightMargin = 0.75;
  182. this.rhythmRightMargin = 1.25;
  183. this.inStaffClefScalingFactor = 0.8;
  184. this.distanceBetweenNaturalAndSymbolWhenCancelling = 0.4;
  185. // Beam Sizing Variables
  186. this.noteHelperLinesOffset = 0.25;
  187. this.measureLeftMargin = 0.7;
  188. this.measureRightMargin = 0.0;
  189. this.distanceBetweenLastInstructionAndRepetitionBarline = 1.0;
  190. this.arpeggioDistance = 0.6;
  191. // Stems Variables
  192. this.staccatoShorteningFactor = 2;
  193. this.idealStemLength = 3.0;
  194. this.stemNoteHeadBorderYOffset = 0.2;
  195. this.stemWidth = 0.13;
  196. this.stemMargin = 0.2;
  197. this.stemMinLength = 2.5;
  198. this.stemMaxLength = 4.5;
  199. this.beamSlopeMaxAngle = 10.0;
  200. this.stemMinAllowedDistanceBetweenNoteHeadAndBeamLine = 1.0;
  201. // GraceNote Variables
  202. this.graceNoteScalingFactor = 0.6;
  203. this.graceNoteXOffset = 0.2;
  204. // GraceNote Variables
  205. this.wedgeOpeningLength = 1.2;
  206. this.wedgeMeasureEndOpeningLength = 0.75;
  207. this.wedgeMeasureBeginOpeningLength = 0.75;
  208. this.wedgePlacementAboveY = -1.5;
  209. this.wedgePlacementBelowY = 1.5;
  210. this.wedgeHorizontalMargin = 0.6;
  211. this.wedgeVerticalMargin = 0.5;
  212. this.distanceOffsetBetweenTwoHorizontallyCrossedWedges = 0.3;
  213. this.wedgeMinLength = 2.0;
  214. this.distanceBetweenAdjacentDynamics = 0.75;
  215. // GraceNote Variables
  216. this.tempoChangeMeasureValitidy = 4;
  217. this.tempoContinousFactor = 0.7;
  218. // various
  219. this.staccatoScalingFactor = 0.8;
  220. this.betweenDotsDistance = 0.8;
  221. this.ornamentAccidentalScalingFactor = 0.65;
  222. this.chordSymbolTextHeight = 2.0;
  223. this.fingeringLabelFontHeight = 1.7;
  224. // MeasureNumber- and TupletNumberLabel variables
  225. this.measureNumberLabelHeight = 1.5 * EngravingRules.unit;
  226. this.measureNumberLabelOffset = 2;
  227. this.tupletNumberLabelHeight = 1.5 * EngravingRules.unit;
  228. this.tupletNumberYOffset = 0.5;
  229. this.labelMarginBorderFactor = 0.1;
  230. this.tupletVerticalLineLength = 0.5;
  231. // MeasureNumber- and TupletNumberLabel variables
  232. this.bezierCurveStepSize = 1000;
  233. this.calculateCurveParametersArrays();
  234. this.tieGhostObjectWidth = 0.75;
  235. this.tieYPositionOffsetFactor = 0.3;
  236. this.minimumNeededXspaceForTieGhostObject = 1.0;
  237. this.tieHeightMinimum = 0.28;
  238. this.tieHeightMaximum = 1.2;
  239. this.tieHeightInterpolationK = 0.0288;
  240. this.tieHeightInterpolationD = 0.136;
  241. this.slurNoteHeadYOffset = 0.5;
  242. this.slurStemXOffset = 0.3;
  243. this.slurSlopeMaxAngle = 15.0;
  244. this.slurTangentMinAngle = 30.0;
  245. this.slurTangentMaxAngle = 80.0;
  246. this.slursStartingAtSameStaffEntryYOffset = 0.8;
  247. // MeasureNumber- and TupletNumberLabel variables
  248. this.repetitionEndingLabelHeight = 2.0;
  249. this.repetitionEndingLabelXOffset = 0.5;
  250. this.repetitionEndingLabelYOffset = 0.3;
  251. this.repetitionEndingLineYLowerOffset = 0.5;
  252. this.repetitionEndingLineYUpperOffset = 0.3;
  253. // Lyrics
  254. this.lyricsHeight = 2.0;
  255. this.verticalBetweenLyricsDistance = 0.5;
  256. this.betweenSyllabelMaximumDistance = 10.0;
  257. this.minimumDistanceBetweenDashes = 5.0;
  258. // expressions variables
  259. this.instantaniousTempoTextHeight = 2.3;
  260. this.continuousDynamicTextHeight = 2.3;
  261. this.moodTextHeight = 2.3;
  262. this.unknownTextHeight = 2.0;
  263. this.continuousTempoTextHeight = 2.3;
  264. // Line Widths
  265. this.staffLineWidth = 0.12;
  266. this.ledgerLineWidth = 0.12;
  267. this.wedgeLineWidth = 0.12;
  268. this.tupletLineWidth = 0.12;
  269. this.lyricUnderscoreLineWidth = 0.12;
  270. this.systemThinLineWidth = 0.12;
  271. this.systemBoldLineWidth = EngravingRules.unit / 2.0;
  272. this.systemRepetitionEndingLineWidth = 0.12;
  273. this.systemDotWidth = EngravingRules.unit / 5.0;
  274. this.distanceBetweenVerticalSystemLines = 0.35;
  275. this.distanceBetweenDotAndLine = 0.7;
  276. this.octaveShiftLineWidth = 0.12;
  277. this.octaveShiftVerticalLineLength = EngravingRules.unit;
  278. this.graceLineWidth = this.staffLineWidth * this.GraceNoteScalingFactor;
  279. // Line Widths
  280. this.minimumStaffLineDistance = 1.0;
  281. this.minimumCrossedBeamDifferenceMargin = 0.0001;
  282. // xSpacing Variables
  283. this.displacedNoteMargin = 0.1;
  284. this.minNoteDistance = 2.0;
  285. this.subMeasureXSpacingThreshold = 35;
  286. this.measureDynamicsMaxScalingFactor = 2.5;
  287. this.populateDictionaries();
  288. try {
  289. this.maxInstructionsConstValue = this.ClefLeftMargin + this.ClefRightMargin + this.KeyRightMargin + this.RhythmRightMargin + 11;
  290. //if (FontInfo.Info !== undefined) {
  291. // this.maxInstructionsConstValue += FontInfo.Info.getBoundingBox(MusicSymbol.G_CLEF).width
  292. // + FontInfo.Info.getBoundingBox(MusicSymbol.FOUR).width
  293. // + 7 * FontInfo.Info.getBoundingBox(MusicSymbol.SHARP).width;
  294. //}
  295. } catch (ex) {
  296. Logging.log("EngravingRules()", ex);
  297. }
  298. }
  299. public static get Rules(): EngravingRules {
  300. return EngravingRules.rules !== undefined ? EngravingRules.rules : (EngravingRules.rules = new EngravingRules());
  301. }
  302. public get SamplingUnit(): number {
  303. return this.samplingUnit;
  304. }
  305. public get SheetTitleHeight(): number {
  306. return this.sheetTitleHeight;
  307. }
  308. public set SheetTitleHeight(value: number) {
  309. this.sheetTitleHeight = value;
  310. }
  311. public get SheetSubtitleHeight(): number {
  312. return this.sheetSubtitleHeight;
  313. }
  314. public set SheetSubtitleHeight(value: number) {
  315. this.sheetSubtitleHeight = value;
  316. }
  317. public get SheetMinimumDistanceBetweenTitleAndSubtitle(): number {
  318. return this.sheetMinimumDistanceBetweenTitleAndSubtitle;
  319. }
  320. public set SheetMinimumDistanceBetweenTitleAndSubtitle(value: number) {
  321. this.sheetMinimumDistanceBetweenTitleAndSubtitle = value;
  322. }
  323. public get SheetComposerHeight(): number {
  324. return this.sheetComposerHeight;
  325. }
  326. public set SheetComposerHeight(value: number) {
  327. this.sheetComposerHeight = value;
  328. }
  329. public get SheetAuthorHeight(): number {
  330. return this.sheetAuthorHeight;
  331. }
  332. public set SheetAuthorHeight(value: number) {
  333. this.sheetAuthorHeight = value;
  334. }
  335. public get PagePlacement(): PagePlacementEnum {
  336. return this.pagePlacementEnum;
  337. }
  338. public set PagePlacement(value: PagePlacementEnum) {
  339. this.pagePlacementEnum = value;
  340. }
  341. public get PageHeight(): number {
  342. return this.pageHeight;
  343. }
  344. public set PageHeight(value: number) {
  345. this.pageHeight = value;
  346. }
  347. public get PageTopMargin(): number {
  348. return this.pageTopMargin;
  349. }
  350. public set PageTopMargin(value: number) {
  351. this.pageTopMargin = value;
  352. }
  353. public get PageBottomMargin(): number {
  354. return this.pageBottomMargin;
  355. }
  356. public set PageBottomMargin(value: number) {
  357. this.pageBottomMargin = value;
  358. }
  359. public get PageLeftMargin(): number {
  360. return this.pageLeftMargin;
  361. }
  362. public set PageLeftMargin(value: number) {
  363. this.pageLeftMargin = value;
  364. }
  365. public get PageRightMargin(): number {
  366. return this.pageRightMargin;
  367. }
  368. public set PageRightMargin(value: number) {
  369. this.pageRightMargin = value;
  370. }
  371. public get TitleTopDistance(): number {
  372. return this.titleTopDistance;
  373. }
  374. public set TitleTopDistance(value: number) {
  375. this.titleTopDistance = value;
  376. }
  377. public get TitleBottomDistance(): number {
  378. return this.titleBottomDistance;
  379. }
  380. public set TitleBottomDistance(value: number) {
  381. this.titleBottomDistance = value;
  382. }
  383. public get SystemComposerDistance(): number {
  384. return this.systemComposerDistance;
  385. }
  386. public set SystemComposerDistance(value: number) {
  387. this.systemComposerDistance = value;
  388. }
  389. public get InstrumentLabelTextHeight(): number {
  390. return this.instrumentLabelTextHeight;
  391. }
  392. public set InstrumentLabelTextHeight(value: number) {
  393. this.instrumentLabelTextHeight = value;
  394. }
  395. public get SystemDistance(): number {
  396. return this.systemDistance;
  397. }
  398. public set SystemDistance(value: number) {
  399. this.systemDistance = value;
  400. }
  401. public get SystemLeftMargin(): number {
  402. return this.systemLeftMargin;
  403. }
  404. public set SystemLeftMargin(value: number) {
  405. this.systemLeftMargin = value;
  406. }
  407. public get SystemRightMargin(): number {
  408. return this.systemRightMargin;
  409. }
  410. public set SystemRightMargin(value: number) {
  411. this.systemRightMargin = value;
  412. }
  413. public get FirstSystemMargin(): number {
  414. return this.firstSystemMargin;
  415. }
  416. public set FirstSystemMargin(value: number) {
  417. this.firstSystemMargin = value;
  418. }
  419. public get SystemLabelsRightMargin(): number {
  420. return this.systemLabelsRightMargin;
  421. }
  422. public set SystemLabelsRightMargin(value: number) {
  423. this.systemLabelsRightMargin = value;
  424. }
  425. public get MinimumAllowedDistanceBetweenSystems(): number {
  426. return this.minimumAllowedDistanceBetweenSystems;
  427. }
  428. public set MinimumAllowedDistanceBetweenSystems(value: number) {
  429. this.minimumAllowedDistanceBetweenSystems = value;
  430. }
  431. public get LastSystemMaxScalingFactor(): number {
  432. return this.lastSystemMaxScalingFactor;
  433. }
  434. public set LastSystemMaxScalingFactor(value: number) {
  435. this.lastSystemMaxScalingFactor = value;
  436. }
  437. public get StaffDistance(): number {
  438. return this.staffDistance;
  439. }
  440. public set StaffDistance(value: number) {
  441. this.staffDistance = value;
  442. }
  443. public get BetweenStaffDistance(): number {
  444. return this.betweenStaffDistance;
  445. }
  446. public set BetweenStaffDistance(value: number) {
  447. this.betweenStaffDistance = value;
  448. }
  449. public get StaffHeight(): number {
  450. return this.staffHeight;
  451. }
  452. public set StaffHeight(value: number) {
  453. this.staffHeight = value;
  454. }
  455. public get BetweenStaffLinesDistance(): number {
  456. return this.betweenStaffLinesDistance;
  457. }
  458. public set BetweenStaffLinesDistance(value: number) {
  459. this.betweenStaffLinesDistance = value;
  460. }
  461. public get BeamWidth(): number {
  462. return this.beamWidth;
  463. }
  464. public set BeamWidth(value: number) {
  465. this.beamWidth = value;
  466. }
  467. public get BeamSpaceWidth(): number {
  468. return this.beamSpaceWidth;
  469. }
  470. public set BeamSpaceWidth(value: number) {
  471. this.beamSpaceWidth = value;
  472. }
  473. public get BeamForwardLength(): number {
  474. return this.beamForwardLength;
  475. }
  476. public set BeamForwardLength(value: number) {
  477. this.beamForwardLength = value;
  478. }
  479. public get BetweenKeySymbolsDistance(): number {
  480. return this.betweenKeySymbolsDistance;
  481. }
  482. public set BetweenKeySymbolsDistance(value: number) {
  483. this.betweenKeySymbolsDistance = value;
  484. }
  485. public get ClefLeftMargin(): number {
  486. return this.clefLeftMargin;
  487. }
  488. public set ClefLeftMargin(value: number) {
  489. this.clefLeftMargin = value;
  490. }
  491. public get ClefRightMargin(): number {
  492. return this.clefRightMargin;
  493. }
  494. public set ClefRightMargin(value: number) {
  495. this.clefRightMargin = value;
  496. }
  497. public get KeyRightMargin(): number {
  498. return this.keyRightMargin;
  499. }
  500. public set KeyRightMargin(value: number) {
  501. this.keyRightMargin = value;
  502. }
  503. public get RhythmRightMargin(): number {
  504. return this.rhythmRightMargin;
  505. }
  506. public set RhythmRightMargin(value: number) {
  507. this.rhythmRightMargin = value;
  508. }
  509. public get InStaffClefScalingFactor(): number {
  510. return this.inStaffClefScalingFactor;
  511. }
  512. public set InStaffClefScalingFactor(value: number) {
  513. this.inStaffClefScalingFactor = value;
  514. }
  515. public get DistanceBetweenNaturalAndSymbolWhenCancelling(): number {
  516. return this.distanceBetweenNaturalAndSymbolWhenCancelling;
  517. }
  518. public set DistanceBetweenNaturalAndSymbolWhenCancelling(value: number) {
  519. this.distanceBetweenNaturalAndSymbolWhenCancelling = value;
  520. }
  521. public get NoteHelperLinesOffset(): number {
  522. return this.noteHelperLinesOffset;
  523. }
  524. public set NoteHelperLinesOffset(value: number) {
  525. this.noteHelperLinesOffset = value;
  526. }
  527. public get MeasureLeftMargin(): number {
  528. return this.measureLeftMargin;
  529. }
  530. public set MeasureLeftMargin(value: number) {
  531. this.measureLeftMargin = value;
  532. }
  533. public get MeasureRightMargin(): number {
  534. return this.measureRightMargin;
  535. }
  536. public set MeasureRightMargin(value: number) {
  537. this.measureRightMargin = value;
  538. }
  539. public get DistanceBetweenLastInstructionAndRepetitionBarline(): number {
  540. return this.distanceBetweenLastInstructionAndRepetitionBarline;
  541. }
  542. public set DistanceBetweenLastInstructionAndRepetitionBarline(value: number) {
  543. this.distanceBetweenLastInstructionAndRepetitionBarline = value;
  544. }
  545. public get ArpeggioDistance(): number {
  546. return this.arpeggioDistance;
  547. }
  548. public set ArpeggioDistance(value: number) {
  549. this.arpeggioDistance = value;
  550. }
  551. public get StaccatoShorteningFactor(): number {
  552. return this.staccatoShorteningFactor;
  553. }
  554. public set StaccatoShorteningFactor(value: number) {
  555. this.staccatoShorteningFactor = value;
  556. }
  557. public get IdealStemLength(): number {
  558. return this.idealStemLength;
  559. }
  560. public set IdealStemLength(value: number) {
  561. this.idealStemLength = value;
  562. }
  563. public get StemNoteHeadBorderYOffset(): number {
  564. return this.stemNoteHeadBorderYOffset;
  565. }
  566. public set StemNoteHeadBorderYOffset(value: number) {
  567. this.stemNoteHeadBorderYOffset = value;
  568. }
  569. public get StemWidth(): number {
  570. return this.stemWidth;
  571. }
  572. public set StemWidth(value: number) {
  573. this.stemWidth = value;
  574. }
  575. public get StemMargin(): number {
  576. return this.stemMargin;
  577. }
  578. public set StemMargin(value: number) {
  579. this.stemMargin = value;
  580. }
  581. public get StemMinLength(): number {
  582. return this.stemMinLength;
  583. }
  584. public set StemMinLength(value: number) {
  585. this.stemMinLength = value;
  586. }
  587. public get StemMaxLength(): number {
  588. return this.stemMaxLength;
  589. }
  590. public set StemMaxLength(value: number) {
  591. this.stemMaxLength = value;
  592. }
  593. public get BeamSlopeMaxAngle(): number {
  594. return this.beamSlopeMaxAngle;
  595. }
  596. public set BeamSlopeMaxAngle(value: number) {
  597. this.beamSlopeMaxAngle = value;
  598. }
  599. public get StemMinAllowedDistanceBetweenNoteHeadAndBeamLine(): number {
  600. return this.stemMinAllowedDistanceBetweenNoteHeadAndBeamLine;
  601. }
  602. public set StemMinAllowedDistanceBetweenNoteHeadAndBeamLine(value: number) {
  603. this.stemMinAllowedDistanceBetweenNoteHeadAndBeamLine = value;
  604. }
  605. public get GraceNoteScalingFactor(): number {
  606. return this.graceNoteScalingFactor;
  607. }
  608. public set GraceNoteScalingFactor(value: number) {
  609. this.graceNoteScalingFactor = value;
  610. }
  611. public get GraceNoteXOffset(): number {
  612. return this.graceNoteXOffset;
  613. }
  614. public set GraceNoteXOffset(value: number) {
  615. this.graceNoteXOffset = value;
  616. }
  617. public get WedgeOpeningLength(): number {
  618. return this.wedgeOpeningLength;
  619. }
  620. public set WedgeOpeningLength(value: number) {
  621. this.wedgeOpeningLength = value;
  622. }
  623. public get WedgeMeasureEndOpeningLength(): number {
  624. return this.wedgeMeasureEndOpeningLength;
  625. }
  626. public set WedgeMeasureEndOpeningLength(value: number) {
  627. this.wedgeMeasureEndOpeningLength = value;
  628. }
  629. public get WedgeMeasureBeginOpeningLength(): number {
  630. return this.wedgeMeasureBeginOpeningLength;
  631. }
  632. public set WedgeMeasureBeginOpeningLength(value: number) {
  633. this.wedgeMeasureBeginOpeningLength = value;
  634. }
  635. public get WedgePlacementAboveY(): number {
  636. return this.wedgePlacementAboveY;
  637. }
  638. public set WedgePlacementAboveY(value: number) {
  639. this.wedgePlacementAboveY = value;
  640. }
  641. public get WedgePlacementBelowY(): number {
  642. return this.wedgePlacementBelowY;
  643. }
  644. public set WedgePlacementBelowY(value: number) {
  645. this.wedgePlacementBelowY = value;
  646. }
  647. public get WedgeHorizontalMargin(): number {
  648. return this.wedgeHorizontalMargin;
  649. }
  650. public set WedgeHorizontalMargin(value: number) {
  651. this.wedgeHorizontalMargin = value;
  652. }
  653. public get WedgeVerticalMargin(): number {
  654. return this.wedgeVerticalMargin;
  655. }
  656. public set WedgeVerticalMargin(value: number) {
  657. this.wedgeVerticalMargin = value;
  658. }
  659. public get DistanceOffsetBetweenTwoHorizontallyCrossedWedges(): number {
  660. return this.distanceOffsetBetweenTwoHorizontallyCrossedWedges;
  661. }
  662. public set DistanceOffsetBetweenTwoHorizontallyCrossedWedges(value: number) {
  663. this.distanceOffsetBetweenTwoHorizontallyCrossedWedges = value;
  664. }
  665. public get WedgeMinLength(): number {
  666. return this.wedgeMinLength;
  667. }
  668. public set WedgeMinLength(value: number) {
  669. this.wedgeMinLength = value;
  670. }
  671. public get DistanceBetweenAdjacentDynamics(): number {
  672. return this.distanceBetweenAdjacentDynamics;
  673. }
  674. public set DistanceBetweenAdjacentDynamics(value: number) {
  675. this.distanceBetweenAdjacentDynamics = value;
  676. }
  677. public get TempoChangeMeasureValitidy(): number {
  678. return this.tempoChangeMeasureValitidy;
  679. }
  680. public set TempoChangeMeasureValitidy(value: number) {
  681. this.tempoChangeMeasureValitidy = value;
  682. }
  683. public get TempoContinousFactor(): number {
  684. return this.tempoContinousFactor;
  685. }
  686. public set TempoContinousFactor(value: number) {
  687. this.tempoContinousFactor = value;
  688. }
  689. public get StaccatoScalingFactor(): number {
  690. return this.staccatoScalingFactor;
  691. }
  692. public set StaccatoScalingFactor(value: number) {
  693. this.staccatoScalingFactor = value;
  694. }
  695. public get BetweenDotsDistance(): number {
  696. return this.betweenDotsDistance;
  697. }
  698. public set BetweenDotsDistance(value: number) {
  699. this.betweenDotsDistance = value;
  700. }
  701. public get OrnamentAccidentalScalingFactor(): number {
  702. return this.ornamentAccidentalScalingFactor;
  703. }
  704. public set OrnamentAccidentalScalingFactor(value: number) {
  705. this.ornamentAccidentalScalingFactor = value;
  706. }
  707. public get ChordSymbolTextHeight(): number {
  708. return this.chordSymbolTextHeight;
  709. }
  710. public set ChordSymbolTextHeight(value: number) {
  711. this.chordSymbolTextHeight = value;
  712. }
  713. public get FingeringLabelFontHeight(): number {
  714. return this.fingeringLabelFontHeight;
  715. }
  716. public set FingeringLabelFontHeight(value: number) {
  717. this.fingeringLabelFontHeight = value;
  718. }
  719. public get MeasureNumberLabelHeight(): number {
  720. return this.measureNumberLabelHeight;
  721. }
  722. public set MeasureNumberLabelHeight(value: number) {
  723. this.measureNumberLabelHeight = value;
  724. }
  725. public get MeasureNumberLabelOffset(): number {
  726. return this.measureNumberLabelOffset;
  727. }
  728. public set MeasureNumberLabelOffset(value: number) {
  729. this.measureNumberLabelOffset = value;
  730. }
  731. public get TupletNumberLabelHeight(): number {
  732. return this.tupletNumberLabelHeight;
  733. }
  734. public set TupletNumberLabelHeight(value: number) {
  735. this.tupletNumberLabelHeight = value;
  736. }
  737. public get TupletNumberYOffset(): number {
  738. return this.tupletNumberYOffset;
  739. }
  740. public set TupletNumberYOffset(value: number) {
  741. this.tupletNumberYOffset = value;
  742. }
  743. public get LabelMarginBorderFactor(): number {
  744. return this.labelMarginBorderFactor;
  745. }
  746. public set LabelMarginBorderFactor(value: number) {
  747. this.labelMarginBorderFactor = value;
  748. }
  749. public get TupletVerticalLineLength(): number {
  750. return this.tupletVerticalLineLength;
  751. }
  752. public set TupletVerticalLineLength(value: number) {
  753. this.tupletVerticalLineLength = value;
  754. }
  755. public get RepetitionEndingLabelHeight(): number {
  756. return this.repetitionEndingLabelHeight;
  757. }
  758. public set RepetitionEndingLabelHeight(value: number) {
  759. this.repetitionEndingLabelHeight = value;
  760. }
  761. public get RepetitionEndingLabelXOffset(): number {
  762. return this.repetitionEndingLabelXOffset;
  763. }
  764. public set RepetitionEndingLabelXOffset(value: number) {
  765. this.repetitionEndingLabelXOffset = value;
  766. }
  767. public get RepetitionEndingLabelYOffset(): number {
  768. return this.repetitionEndingLabelYOffset;
  769. }
  770. public set RepetitionEndingLabelYOffset(value: number) {
  771. this.repetitionEndingLabelYOffset = value;
  772. }
  773. public get RepetitionEndingLineYLowerOffset(): number {
  774. return this.repetitionEndingLineYLowerOffset;
  775. }
  776. public set RepetitionEndingLineYLowerOffset(value: number) {
  777. this.repetitionEndingLineYLowerOffset = value;
  778. }
  779. public get RepetitionEndingLineYUpperOffset(): number {
  780. return this.repetitionEndingLineYUpperOffset;
  781. }
  782. public set RepetitionEndingLineYUpperOffset(value: number) {
  783. this.repetitionEndingLineYUpperOffset = value;
  784. }
  785. public get LyricsHeight(): number {
  786. return this.lyricsHeight;
  787. }
  788. public set LyricsHeight(value: number) {
  789. this.lyricsHeight = value;
  790. }
  791. public get VerticalBetweenLyricsDistance(): number {
  792. return this.verticalBetweenLyricsDistance;
  793. }
  794. public set VerticalBetweenLyricsDistance(value: number) {
  795. this.verticalBetweenLyricsDistance = value;
  796. }
  797. public get BetweenSyllabelMaximumDistance(): number {
  798. return this.betweenSyllabelMaximumDistance;
  799. }
  800. public set BetweenSyllabelMaximumDistance(value: number) {
  801. this.betweenSyllabelMaximumDistance = value;
  802. }
  803. public get MinimumDistanceBetweenDashes(): number {
  804. return this.minimumDistanceBetweenDashes;
  805. }
  806. public set MinimumDistanceBetweenDashes(value: number) {
  807. this.minimumDistanceBetweenDashes = value;
  808. }
  809. public get BezierCurveStepSize(): number {
  810. return this.bezierCurveStepSize;
  811. }
  812. public set BezierCurveStepSize(value: number) {
  813. this.bezierCurveStepSize = value;
  814. }
  815. public get TPow3(): number[] {
  816. return this.tPower3;
  817. }
  818. public set TPow3(value: number[]) {
  819. this.tPower3 = value;
  820. }
  821. public get OneMinusTPow3(): number[] {
  822. return this.oneMinusTPower3;
  823. }
  824. public set OneMinusTPow3(value: number[]) {
  825. this.oneMinusTPower3 = value;
  826. }
  827. public get BezierFactorOne(): number[] {
  828. return this.factorOne;
  829. }
  830. public set BezierFactorOne(value: number[]) {
  831. this.factorOne = value;
  832. }
  833. public get BezierFactorTwo(): number[] {
  834. return this.factorTwo;
  835. }
  836. public set BezierFactorTwo(value: number[]) {
  837. this.factorTwo = value;
  838. }
  839. public get TieGhostObjectWidth(): number {
  840. return this.tieGhostObjectWidth;
  841. }
  842. public set TieGhostObjectWidth(value: number) {
  843. this.tieGhostObjectWidth = value;
  844. }
  845. public get TieYPositionOffsetFactor(): number {
  846. return this.tieYPositionOffsetFactor;
  847. }
  848. public set TieYPositionOffsetFactor(value: number) {
  849. this.tieYPositionOffsetFactor = value;
  850. }
  851. public get MinimumNeededXspaceForTieGhostObject(): number {
  852. return this.minimumNeededXspaceForTieGhostObject;
  853. }
  854. public set MinimumNeededXspaceForTieGhostObject(value: number) {
  855. this.minimumNeededXspaceForTieGhostObject = value;
  856. }
  857. public get TieHeightMinimum(): number {
  858. return this.tieHeightMinimum;
  859. }
  860. public set TieHeightMinimum(value: number) {
  861. this.tieHeightMinimum = value;
  862. }
  863. public get TieHeightMaximum(): number {
  864. return this.tieHeightMaximum;
  865. }
  866. public set TieHeightMaximum(value: number) {
  867. this.tieHeightMaximum = value;
  868. }
  869. public get TieHeightInterpolationK(): number {
  870. return this.tieHeightInterpolationK;
  871. }
  872. public set TieHeightInterpolationK(value: number) {
  873. this.tieHeightInterpolationK = value;
  874. }
  875. public get TieHeightInterpolationD(): number {
  876. return this.tieHeightInterpolationD;
  877. }
  878. public set TieHeightInterpolationD(value: number) {
  879. this.tieHeightInterpolationD = value;
  880. }
  881. public get SlurNoteHeadYOffset(): number {
  882. return this.slurNoteHeadYOffset;
  883. }
  884. public set SlurNoteHeadYOffset(value: number) {
  885. this.slurNoteHeadYOffset = value;
  886. }
  887. public get SlurStemXOffset(): number {
  888. return this.slurStemXOffset;
  889. }
  890. public set SlurStemXOffset(value: number) {
  891. this.slurStemXOffset = value;
  892. }
  893. public get SlurSlopeMaxAngle(): number {
  894. return this.slurSlopeMaxAngle;
  895. }
  896. public set SlurSlopeMaxAngle(value: number) {
  897. this.slurSlopeMaxAngle = value;
  898. }
  899. public get SlurTangentMinAngle(): number {
  900. return this.slurTangentMinAngle;
  901. }
  902. public set SlurTangentMinAngle(value: number) {
  903. this.slurTangentMinAngle = value;
  904. }
  905. public get SlurTangentMaxAngle(): number {
  906. return this.slurTangentMaxAngle;
  907. }
  908. public set SlurTangentMaxAngle(value: number) {
  909. this.slurTangentMaxAngle = value;
  910. }
  911. public get SlursStartingAtSameStaffEntryYOffset(): number {
  912. return this.slursStartingAtSameStaffEntryYOffset;
  913. }
  914. public set SlursStartingAtSameStaffEntryYOffset(value: number) {
  915. this.slursStartingAtSameStaffEntryYOffset = value;
  916. }
  917. public get InstantaniousTempoTextHeight(): number {
  918. return this.instantaniousTempoTextHeight;
  919. }
  920. public set InstantaniousTempoTextHeight(value: number) {
  921. this.instantaniousTempoTextHeight = value;
  922. }
  923. public get ContinuousDynamicTextHeight(): number {
  924. return this.continuousDynamicTextHeight;
  925. }
  926. public set ContinuousDynamicTextHeight(value: number) {
  927. this.continuousDynamicTextHeight = value;
  928. }
  929. public get MoodTextHeight(): number {
  930. return this.moodTextHeight;
  931. }
  932. public set MoodTextHeight(value: number) {
  933. this.moodTextHeight = value;
  934. }
  935. public get ContinuousTempoTextHeight(): number {
  936. return this.continuousTempoTextHeight;
  937. }
  938. public set ContinuousTempoTextHeight(value: number) {
  939. this.continuousTempoTextHeight = value;
  940. }
  941. public get UnknownTextHeight(): number {
  942. return this.unknownTextHeight;
  943. }
  944. public set UnknownTextHeight(value: number) {
  945. this.unknownTextHeight = value;
  946. }
  947. public get StaffLineWidth(): number {
  948. return this.staffLineWidth;
  949. }
  950. public set StaffLineWidth(value: number) {
  951. this.staffLineWidth = value;
  952. }
  953. public get LedgerLineWidth(): number {
  954. return this.ledgerLineWidth;
  955. }
  956. public set LedgerLineWidth(value: number) {
  957. this.ledgerLineWidth = value;
  958. }
  959. public get WedgeLineWidth(): number {
  960. return this.wedgeLineWidth;
  961. }
  962. public set WedgeLineWidth(value: number) {
  963. this.wedgeLineWidth = value;
  964. }
  965. public get TupletLineWidth(): number {
  966. return this.tupletLineWidth;
  967. }
  968. public set TupletLineWidth(value: number) {
  969. this.tupletLineWidth = value;
  970. }
  971. public get LyricUnderscoreLineWidth(): number {
  972. return this.lyricUnderscoreLineWidth;
  973. }
  974. public set LyricUnderscoreLineWidth(value: number) {
  975. this.lyricUnderscoreLineWidth = value;
  976. }
  977. public get SystemThinLineWidth(): number {
  978. return this.systemThinLineWidth;
  979. }
  980. public set SystemThinLineWidth(value: number) {
  981. this.systemThinLineWidth = value;
  982. }
  983. public get SystemBoldLineWidth(): number {
  984. return this.systemBoldLineWidth;
  985. }
  986. public set SystemBoldLineWidth(value: number) {
  987. this.systemBoldLineWidth = value;
  988. }
  989. public get SystemRepetitionEndingLineWidth(): number {
  990. return this.systemRepetitionEndingLineWidth;
  991. }
  992. public set SystemRepetitionEndingLineWidth(value: number) {
  993. this.systemRepetitionEndingLineWidth = value;
  994. }
  995. public get SystemDotWidth(): number {
  996. return this.systemDotWidth;
  997. }
  998. public set SystemDotWidth(value: number) {
  999. this.systemDotWidth = value;
  1000. }
  1001. public get DistanceBetweenVerticalSystemLines(): number {
  1002. return this.distanceBetweenVerticalSystemLines;
  1003. }
  1004. public set DistanceBetweenVerticalSystemLines(value: number) {
  1005. this.distanceBetweenVerticalSystemLines = value;
  1006. }
  1007. public get DistanceBetweenDotAndLine(): number {
  1008. return this.distanceBetweenDotAndLine;
  1009. }
  1010. public set DistanceBetweenDotAndLine(value: number) {
  1011. this.distanceBetweenDotAndLine = value;
  1012. }
  1013. public get OctaveShiftLineWidth(): number {
  1014. return this.octaveShiftLineWidth;
  1015. }
  1016. public set OctaveShiftLineWidth(value: number) {
  1017. this.octaveShiftLineWidth = value;
  1018. }
  1019. public get OctaveShiftVerticalLineLength(): number {
  1020. return this.octaveShiftVerticalLineLength;
  1021. }
  1022. public set OctaveShiftVerticalLineLength(value: number) {
  1023. this.octaveShiftVerticalLineLength = value;
  1024. }
  1025. public get GraceLineWidth(): number {
  1026. return this.graceLineWidth;
  1027. }
  1028. public set GraceLineWidth(value: number) {
  1029. this.graceLineWidth = value;
  1030. }
  1031. public get MinimumStaffLineDistance(): number {
  1032. return this.minimumStaffLineDistance;
  1033. }
  1034. public set MinimumStaffLineDistance(value: number) {
  1035. this.minimumStaffLineDistance = value;
  1036. }
  1037. public get MinimumCrossedBeamDifferenceMargin(): number {
  1038. return this.minimumCrossedBeamDifferenceMargin;
  1039. }
  1040. public set MinimumCrossedBeamDifferenceMargin(value: number) {
  1041. this.minimumCrossedBeamDifferenceMargin = value;
  1042. }
  1043. public get DisplacedNoteMargin(): number {
  1044. return this.displacedNoteMargin;
  1045. }
  1046. public set DisplacedNoteMargin(value: number) {
  1047. this.displacedNoteMargin = value;
  1048. }
  1049. public get MinNoteDistance(): number {
  1050. return this.minNoteDistance;
  1051. }
  1052. public set MinNoteDistance(value: number) {
  1053. this.minNoteDistance = value;
  1054. }
  1055. public get SubMeasureXSpacingThreshold(): number {
  1056. return this.subMeasureXSpacingThreshold;
  1057. }
  1058. public set SubMeasureXSpacingThreshold(value: number) {
  1059. this.subMeasureXSpacingThreshold = value;
  1060. }
  1061. public get MeasureDynamicsMaxScalingFactor(): number {
  1062. return this.measureDynamicsMaxScalingFactor;
  1063. }
  1064. public set MeasureDynamicsMaxScalingFactor(value: number) {
  1065. this.measureDynamicsMaxScalingFactor = value;
  1066. }
  1067. public get MaxInstructionsConstValue(): number {
  1068. return this.maxInstructionsConstValue;
  1069. }
  1070. public set MaxInstructionsConstValue(value: number) {
  1071. this.maxInstructionsConstValue = value;
  1072. }
  1073. public get NoteDistances(): number[] {
  1074. return this.noteDistances;
  1075. }
  1076. public set NoteDistances(value: number[]) {
  1077. this.noteDistances = value;
  1078. }
  1079. public get NoteDistancesScalingFactors(): number[] {
  1080. return this.noteDistancesScalingFactors;
  1081. }
  1082. public set NoteDistancesScalingFactors(value: number[]) {
  1083. this.noteDistancesScalingFactors = value;
  1084. }
  1085. public get DurationDistanceDict(): {[_: number]: number; } {
  1086. return this.durationDistanceDict;
  1087. }
  1088. public get DurationScalingDistanceDict(): {[_: number]: number; } {
  1089. return this.durationScalingDistanceDict;
  1090. }
  1091. /**
  1092. * This method maps NoteDurations to Distances and DistancesScalingFactors.
  1093. */
  1094. private populateDictionaries(): void {
  1095. for (let i: number = 0; i < this.noteDistances.length; i++) {
  1096. switch (i) {
  1097. case 0:
  1098. this.durationDistanceDict[0.015625] = this.noteDistances[i];
  1099. this.durationScalingDistanceDict[0.015625] = this.noteDistancesScalingFactors[i];
  1100. break;
  1101. case 1:
  1102. this.durationDistanceDict[0.03125] = this.noteDistances[i];
  1103. this.durationScalingDistanceDict[0.03125] = this.noteDistancesScalingFactors[i];
  1104. break;
  1105. case 2:
  1106. this.durationDistanceDict[0.0625] = this.noteDistances[i];
  1107. this.durationScalingDistanceDict[0.0625] = this.noteDistancesScalingFactors[i];
  1108. break;
  1109. case 3:
  1110. this.durationDistanceDict[0.125] = this.noteDistances[i];
  1111. this.durationScalingDistanceDict[0.125] = this.noteDistancesScalingFactors[i];
  1112. break;
  1113. case 4:
  1114. this.durationDistanceDict[0.25] = this.noteDistances[i];
  1115. this.durationScalingDistanceDict[0.25] = this.noteDistancesScalingFactors[i];
  1116. break;
  1117. case 5:
  1118. this.durationDistanceDict[0.5] = this.noteDistances[i];
  1119. this.durationScalingDistanceDict[0.5] = this.noteDistancesScalingFactors[i];
  1120. break;
  1121. case 6:
  1122. this.durationDistanceDict[1.0] = this.noteDistances[i];
  1123. this.durationScalingDistanceDict[1.0] = this.noteDistancesScalingFactors[i];
  1124. break;
  1125. case 7:
  1126. this.durationDistanceDict[2.0] = this.noteDistances[i];
  1127. this.durationScalingDistanceDict[2.0] = this.noteDistancesScalingFactors[i];
  1128. break;
  1129. default:
  1130. // FIXME
  1131. }
  1132. }
  1133. }
  1134. /**
  1135. * Calculate Curve-independend factors, to be used later in the Slur- and TieCurvePoints calculation
  1136. */
  1137. private calculateCurveParametersArrays(): void {
  1138. this.tPower3 = new Array(this.bezierCurveStepSize);
  1139. this.oneMinusTPower3 = new Array(this.bezierCurveStepSize);
  1140. this.factorOne = new Array(this.bezierCurveStepSize);
  1141. this.factorTwo = new Array(this.bezierCurveStepSize);
  1142. for (let i: number = 0; i < this.bezierCurveStepSize; i++) {
  1143. let t: number = i / this.bezierCurveStepSize;
  1144. this.tPower3[i] = Math.pow(t, 3);
  1145. this.oneMinusTPower3[i] = Math.pow((1 - t), 3);
  1146. this.factorOne[i] = 3 * Math.pow((1 - t), 2) * t;
  1147. this.factorTwo[i] = 3 * (1 - t) * Math.pow(t, 2);
  1148. }
  1149. }
  1150. }