notations 0.0.46 → 0.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/lib/cjs/beats.d.ts +34 -69
  2. package/lib/cjs/beats.js +178 -439
  3. package/lib/cjs/beats.js.map +1 -1
  4. package/lib/cjs/beatutils.d.ts +3 -0
  5. package/lib/cjs/beatutils.js +64 -0
  6. package/lib/cjs/beatutils.js.map +1 -0
  7. package/lib/cjs/beatview.d.ts +18 -0
  8. package/lib/cjs/beatview.js +62 -0
  9. package/lib/cjs/beatview.js.map +1 -0
  10. package/lib/cjs/carnatic/LineView.d.ts +2 -7
  11. package/lib/cjs/carnatic/LineView.js +13 -31
  12. package/lib/cjs/carnatic/LineView.js.map +1 -1
  13. package/lib/cjs/carnatic/NotationView.d.ts +8 -7
  14. package/lib/cjs/carnatic/NotationView.js +76 -153
  15. package/lib/cjs/carnatic/NotationView.js.map +1 -1
  16. package/lib/cjs/carnatic/atomviews.js +149 -287
  17. package/lib/cjs/carnatic/atomviews.js.map +1 -1
  18. package/lib/cjs/carnatic/beatviews.d.ts +4 -13
  19. package/lib/cjs/carnatic/beatviews.js +23 -118
  20. package/lib/cjs/carnatic/beatviews.js.map +1 -1
  21. package/lib/cjs/carnatic/embelishments.d.ts +1 -1
  22. package/lib/cjs/carnatic/embelishments.js +189 -283
  23. package/lib/cjs/carnatic/embelishments.js.map +1 -1
  24. package/lib/cjs/carnatic/gamakas.js +15 -47
  25. package/lib/cjs/carnatic/gamakas.js.map +1 -1
  26. package/lib/cjs/commands.js +111 -271
  27. package/lib/cjs/commands.js.map +1 -1
  28. package/lib/cjs/core.d.ts +14 -1
  29. package/lib/cjs/core.js +291 -477
  30. package/lib/cjs/core.js.map +1 -1
  31. package/lib/cjs/cycle.js +175 -367
  32. package/lib/cjs/cycle.js.map +1 -1
  33. package/lib/cjs/entity.js +48 -102
  34. package/lib/cjs/entity.js.map +1 -1
  35. package/lib/cjs/grids.d.ts +125 -0
  36. package/lib/cjs/grids.js +550 -0
  37. package/lib/cjs/grids.js.map +1 -0
  38. package/lib/cjs/iterators.js +96 -234
  39. package/lib/cjs/iterators.js.map +1 -1
  40. package/lib/cjs/layouts.d.ts +1 -1
  41. package/lib/cjs/layouts.js +62 -98
  42. package/lib/cjs/layouts.js.map +1 -1
  43. package/lib/cjs/loader.d.ts +2 -2
  44. package/lib/cjs/loader.js +23 -123
  45. package/lib/cjs/loader.js.map +1 -1
  46. package/lib/cjs/notation.d.ts +0 -3
  47. package/lib/cjs/notation.js +139 -241
  48. package/lib/cjs/notation.js.map +1 -1
  49. package/lib/cjs/parser.d.ts +2 -0
  50. package/lib/cjs/parser.js +225 -214
  51. package/lib/cjs/parser.js.map +1 -1
  52. package/lib/cjs/shapes.js +149 -283
  53. package/lib/cjs/shapes.js.map +1 -1
  54. package/lib/cjs/utils.d.ts +8 -0
  55. package/lib/cjs/utils.js +60 -55
  56. package/lib/cjs/utils.js.map +1 -1
  57. package/lib/esm/beats.d.ts +34 -69
  58. package/lib/esm/beats.js +172 -438
  59. package/lib/esm/beats.js.map +1 -1
  60. package/lib/esm/beatutils.d.ts +3 -0
  61. package/lib/esm/beatutils.js +37 -0
  62. package/lib/esm/beatutils.js.map +1 -0
  63. package/lib/esm/beatview.d.ts +18 -0
  64. package/lib/esm/beatview.js +35 -0
  65. package/lib/esm/beatview.js.map +1 -0
  66. package/lib/esm/carnatic/LineView.d.ts +2 -7
  67. package/lib/esm/carnatic/LineView.js +12 -31
  68. package/lib/esm/carnatic/LineView.js.map +1 -1
  69. package/lib/esm/carnatic/NotationView.d.ts +8 -7
  70. package/lib/esm/carnatic/NotationView.js +74 -152
  71. package/lib/esm/carnatic/NotationView.js.map +1 -1
  72. package/lib/esm/carnatic/atomviews.js +144 -284
  73. package/lib/esm/carnatic/atomviews.js.map +1 -1
  74. package/lib/esm/carnatic/beatviews.d.ts +4 -13
  75. package/lib/esm/carnatic/beatviews.js +21 -94
  76. package/lib/esm/carnatic/beatviews.js.map +1 -1
  77. package/lib/esm/carnatic/embelishments.d.ts +1 -1
  78. package/lib/esm/carnatic/embelishments.js +187 -296
  79. package/lib/esm/carnatic/embelishments.js.map +1 -1
  80. package/lib/esm/carnatic/gamakas.js +14 -48
  81. package/lib/esm/carnatic/gamakas.js.map +1 -1
  82. package/lib/esm/commands.js +100 -271
  83. package/lib/esm/commands.js.map +1 -1
  84. package/lib/esm/core.d.ts +14 -1
  85. package/lib/esm/core.js +287 -484
  86. package/lib/esm/core.js.map +1 -1
  87. package/lib/esm/cycle.js +172 -367
  88. package/lib/esm/cycle.js.map +1 -1
  89. package/lib/esm/entity.js +48 -104
  90. package/lib/esm/entity.js.map +1 -1
  91. package/lib/esm/grids.d.ts +125 -0
  92. package/lib/esm/grids.js +517 -0
  93. package/lib/esm/grids.js.map +1 -0
  94. package/lib/esm/iterators.js +93 -235
  95. package/lib/esm/iterators.js.map +1 -1
  96. package/lib/esm/layouts.d.ts +1 -1
  97. package/lib/esm/layouts.js +60 -97
  98. package/lib/esm/layouts.js.map +1 -1
  99. package/lib/esm/loader.d.ts +2 -2
  100. package/lib/esm/loader.js +20 -120
  101. package/lib/esm/loader.js.map +1 -1
  102. package/lib/esm/notation.d.ts +0 -3
  103. package/lib/esm/notation.js +135 -242
  104. package/lib/esm/notation.js.map +1 -1
  105. package/lib/esm/parser.d.ts +2 -0
  106. package/lib/esm/parser.js +220 -210
  107. package/lib/esm/parser.js.map +1 -1
  108. package/lib/esm/shapes.js +148 -288
  109. package/lib/esm/shapes.js.map +1 -1
  110. package/lib/esm/utils.d.ts +8 -0
  111. package/lib/esm/utils.js +55 -51
  112. package/lib/esm/utils.js.map +1 -1
  113. package/package.json +18 -17
@@ -1 +1 @@
1
- {"version":3,"file":"embelishments.js","sourceRoot":"","sources":["../../../src/carnatic/embelishments.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAuC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AC/B,CAAC;IAED,6BAAa,GAAb;QACE,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC;IACH,YAAC;AAAD,CAAC,AAvDD,CAA2B,wBAAwB,GAuDlD;AAvDY,sBAAK","sourcesContent":["import * as TSU from \"@panyam/tsutils\";\nimport { Note } from \"../core\";\nimport { BeatView } from \"../beats\";\nimport { Embelishment } from \"../shapes\";\nimport { LeafAtomView } from \"./atomviews\";\nimport { JaaruGamaka } from \"./gamakas\";\n\n/**\n * Embelishments specifically \"around\" a single atom view.\n */\nexport abstract class LeafAtomViewEmbelishment extends Embelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super();\n }\n}\n\nexport class OctaveIndicator extends LeafAtomViewEmbelishment {\n dotRadius = 1;\n dotSpacing = 2.5;\n dotsElem: SVGGElement;\n\n constructor(public readonly noteView: LeafAtomView, public readonly note: Note) {\n super(noteView);\n const rootElem = this.noteView.embRoot();\n const numDots = Math.abs(note.octave);\n this.dotsElem = TSU.DOM.createSVGNode(\"g\", {\n doc: document,\n parent: rootElem,\n attrs: {\n width: this.dotRadius * 2 * numDots + (numDots - 1) * this.dotSpacing,\n height: this.dotRadius * 2,\n source: \"atom\" + this.noteView.leafAtom.uuid,\n },\n });\n let cx = 0;\n for (let i = 0; i < numDots; i++) {\n TSU.DOM.createSVGNode(\"circle\", {\n doc: document,\n parent: this.dotsElem,\n attrs: {\n cx: cx,\n cy: 0,\n r: this.dotRadius,\n stroke: \"black\",\n \"stroke-width\": \"1\",\n },\n });\n cx += this.dotRadius + this.dotRadius + this.dotSpacing;\n }\n }\n\n protected refreshBBox(): TSU.Geom.Rect {\n return TSU.DOM.svgBBox(this.dotsElem);\n }\n\n protected refreshMinSize(): TSU.Geom.Size {\n const numDots = Math.abs(this.note.octave);\n return {\n width: this.dotRadius * 2 * numDots + (numDots - 1) * this.dotSpacing,\n height: this.dotRadius * 2,\n };\n }\n\n protected updateBounds(\n x: null | number,\n y: null | number,\n w: null | number,\n h: null | number,\n ): [number | null, number | null, number | null, number | null] {\n if (x == null) x = this.x;\n if (y == null) y = this.y;\n // cannot set w/h\n // this.bbox.x = x;\n // this.bbox.y = y;\n return [x, y, null, null];\n }\n\n refreshLayout(): void {\n this.dotsElem.setAttribute(\"transform\", \"translate(\" + this.x + \",\" + this.y + \")\");\n }\n}\n\n////////// Carnatic embelishments\nexport class LabelEmbelishment extends LeafAtomViewEmbelishment {\n labelElem: SVGTextElement;\n constructor(public readonly label: string, public readonly atomView: LeafAtomView) {\n super(atomView);\n const rootElem = this.atomView.embRoot();\n this.labelElem = TSU.DOM.createSVGNode(\"text\", {\n doc: document,\n parent: rootElem,\n text: label,\n attrs: {\n source: \"atom\" + this.atomView.leafAtom.uuid,\n \"dominant-baseline\": \"hanging\",\n },\n });\n }\n\n protected refreshBBox(): TSU.Geom.Rect {\n return TSU.DOM.svgBBox(this.labelElem);\n }\n\n protected refreshMinSize(): TSU.Geom.Size {\n return TSU.DOM.svgBBox(this.labelElem);\n }\n\n protected updateBounds(\n x: null | number,\n y: null | number,\n w: null | number,\n h: null | number,\n ): [number | null, number | null, number | null, number | null] {\n return [x, y, w, h];\n }\n\n refreshLayout(): void {\n this.labelElem.setAttribute(\"x\", \"\" + this.x);\n this.labelElem.setAttribute(\"y\", \"\" + this.y);\n }\n}\n\nexport class BeatStartLines extends Embelishment {\n barSpacing = 10;\n protected line: SVGLineElement;\n\n constructor(public readonly source: BeatView, public readonly rootElement: SVGGraphicsElement) {\n super();\n this.line = TSU.DOM.createSVGNode(\"line\", {\n doc: document,\n parent: this.rootElement,\n attrs: {\n stroke: \"black\",\n \"stroke-width\": \"1\",\n class: \"bar-start-line\",\n },\n });\n }\n\n protected refreshBBox(): TSU.Geom.Rect {\n return new TSU.Geom.Rect(0, 0, 0, 0);\n }\n\n protected refreshMinSize(): TSU.Geom.Size {\n return new TSU.Geom.Rect(0, 0, 0, 0);\n }\n\n refreshLayout(): void {\n const line = this.line;\n const x = this.source.x - this.barSpacing;\n line.setAttribute(\"x1\", \"\" + x);\n line.setAttribute(\"x2\", \"\" + x);\n const y = this.source.y + this.source.bbox.y;\n const h = this.source.bbox.height;\n line.setAttribute(\"y1\", \"\" + y);\n line.setAttribute(\"y2\", \"\" + (y + h));\n }\n\n protected updateBounds(\n x: null | number,\n y: null | number,\n w: null | number,\n h: null | number,\n ): [number | null, number | null, number | null, number | null] {\n return [x, y, null, h];\n }\n}\n\nexport class BeatEndLines extends Embelishment {\n lineSpacing = 2;\n protected lines: SVGLineElement[];\n\n constructor(public readonly source: BeatView, public readonly rootElement: SVGGraphicsElement, nLines = 1) {\n super();\n this.lines = [];\n for (let i = 0; i < nLines; i++) {\n this.lines.push(\n TSU.DOM.createSVGNode(\"line\", {\n doc: document,\n // parent: l2g,\n parent: this.rootElement,\n attrs: {\n stroke: \"black\",\n \"stroke-width\": \"1\",\n class: \"bar-end-line\",\n },\n }),\n );\n }\n }\n\n protected refreshBBox(): TSU.Geom.Rect {\n return new TSU.Geom.Rect(0, 0, 0, 0);\n }\n\n protected refreshMinSize(): TSU.Geom.Size {\n return new TSU.Geom.Rect(0, 0, 0, 0);\n }\n\n protected updatePosition(x: null | number, y: null | number): [number | null, number | null] {\n return [x, y];\n }\n\n barSpacing = 15;\n\n refreshLayout(): void {\n // const x = this.source.width + this.barSpacing;\n // const y = 0;\n // const h = this.source.height;\n const x = this.source.x + this.source.width + this.barSpacing;\n const y = this.source.y + this.source.bbox.y;\n const h = this.source.bbox.height;\n let currX = x;\n for (const line of this.lines) {\n const lx = \"\" + currX;\n line.setAttribute(\"x1\", lx);\n line.setAttribute(\"x2\", lx);\n currX += 4;\n }\n for (const line of this.lines) {\n line.setAttribute(\"y1\", \"\" + y);\n line.setAttribute(\"y2\", \"\" + (y + h));\n }\n }\n\n protected updateBounds(\n x: null | number,\n y: null | number,\n w: null | number,\n h: null | number,\n ): [number | null, number | null, number | null, number | null] {\n return [null, null, null, null];\n }\n}\n\n/// Carnatic Embelishments\nexport class Kampitham extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"~\", atomView);\n }\n}\n\nexport class Nokku extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"w\", atomView);\n }\n}\n\nexport class Prathyagatham extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"∵\", atomView);\n }\n}\nexport class Spuritham extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"∴\", atomView);\n }\n}\nexport class Raavi extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"^\", atomView);\n }\n}\nexport class Kandippu extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"✓\", atomView);\n }\n}\n\nexport class Vaali extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"⌒\", atomView);\n }\n}\nexport class Odukkal extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"x\", atomView);\n }\n}\nexport class Orikkai extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"γ\", atomView);\n }\n}\n\nexport class Jaaru extends LeafAtomViewEmbelishment {\n pathElem: SVGPathElement;\n constructor(public readonly jaaru: JaaruGamaka, public readonly atomView: LeafAtomView) {\n super(atomView);\n // TODO - Create the \"fancier\" view\n // for now represent this with just a slant line (like a slash)\n const rootElem = this.atomView.embRoot();\n this.pathElem = TSU.DOM.createSVGNode(\"path\", {\n doc: document,\n parent: rootElem,\n attrs: {\n source: \"atom\" + this.atomView.leafAtom.uuid,\n stroke: \"black\",\n fill: \"transparent\",\n d: this.pathAttribute(),\n },\n });\n }\n\n pathAttribute(x = 0): string {\n const avbbox = this.atomView.glyph.minSize;\n let y2 = 0;\n const h2 = avbbox.height / 2;\n const x2 = x + h2;\n let y = this.atomView.y;\n if (this.jaaru.ascending) {\n y += avbbox.height;\n y2 = y - h2;\n } else {\n y -= h2;\n y2 = y + h2;\n }\n return [`M ${x} ${y}`, `Q ${x2} ${y} ${x2} ${y2}`].join(\" \");\n }\n\n protected refreshMinSize(): TSU.Geom.Size {\n return TSU.DOM.svgBBox(this.pathElem);\n }\n\n protected refreshBBox(): TSU.Geom.Rect {\n return TSU.DOM.svgBBox(this.pathElem);\n }\n\n protected updateBounds(\n x: null | number,\n y: null | number,\n w: null | number,\n h: null | number,\n ): [number | null, number | null, number | null, number | null] {\n return [x, null, null, null];\n }\n\n refreshLayout(): void {\n this.pathElem.setAttribute(\"d\", this.pathAttribute(this.x));\n }\n}\n"]}
1
+ {"version":3,"file":"embelishments.js","sourceRoot":"","sources":["../../../src/carnatic/embelishments.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AAGvC,sCAAyC;AAOzC,MAAsB,wBAAyB,SAAQ,qBAAY;IACjE,YAA4B,QAAsB;QAChD,KAAK,EAAE,CAAC;QADkB,aAAQ,GAAR,QAAQ,CAAc;IAElD,CAAC;CACF;AAJD,4DAIC;AAED,MAAa,eAAgB,SAAQ,wBAAwB;IAK3D,YAA4B,QAAsB,EAAkB,IAAU;QAC5E,KAAK,CAAC,QAAQ,CAAC,CAAC;QADU,aAAQ,GAAR,QAAQ,CAAc;QAAkB,SAAI,GAAJ,IAAI,CAAM;QAJ9E,cAAS,GAAG,CAAC,CAAC;QACd,eAAU,GAAG,GAAG,CAAC;QAKf,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,EAAE;YACzC,GAAG,EAAE,QAAQ;YACb,MAAM,EAAE,QAAQ;YAChB,KAAK,EAAE;gBACL,KAAK,EAAE,IAAI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,CAAC,MAAM,GAAG,CAAC,CAAC;QAC7B,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QACxB,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;YACxB,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC;YACnB,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;SACb;aAAM;YACL,CAAC,IAAI,EAAE,CAAC;YACR,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;SACb;QACD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/D,CAAC;IAES,cAAc;QACtB,OAAO,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAES,WAAW;QACnB,OAAO,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAES,YAAY,CACpB,CAAgB,EAChB,CAAgB,EAChB,CAAgB,EAChB,CAAgB;QAEhB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,aAAa;QACX,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC;CACF;AAvDD,sBAuDC","sourcesContent":["import * as TSU from \"@panyam/tsutils\";\nimport { Note } from \"../core\";\nimport { BeatView } from \"../beatview\";\nimport { Embelishment } from \"../shapes\";\nimport { LeafAtomView } from \"./atomviews\";\nimport { JaaruGamaka } from \"./gamakas\";\n\n/**\n * Embelishments specifically \"around\" a single atom view.\n */\nexport abstract class LeafAtomViewEmbelishment extends Embelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super();\n }\n}\n\nexport class OctaveIndicator extends LeafAtomViewEmbelishment {\n dotRadius = 1;\n dotSpacing = 2.5;\n dotsElem: SVGGElement;\n\n constructor(public readonly noteView: LeafAtomView, public readonly note: Note) {\n super(noteView);\n const rootElem = this.noteView.embRoot();\n const numDots = Math.abs(note.octave);\n this.dotsElem = TSU.DOM.createSVGNode(\"g\", {\n doc: document,\n parent: rootElem,\n attrs: {\n width: this.dotRadius * 2 * numDots + (numDots - 1) * this.dotSpacing,\n height: this.dotRadius * 2,\n source: \"atom\" + this.noteView.leafAtom.uuid,\n },\n });\n let cx = 0;\n for (let i = 0; i < numDots; i++) {\n TSU.DOM.createSVGNode(\"circle\", {\n doc: document,\n parent: this.dotsElem,\n attrs: {\n cx: cx,\n cy: 0,\n r: this.dotRadius,\n stroke: \"black\",\n \"stroke-width\": \"1\",\n },\n });\n cx += this.dotRadius + this.dotRadius + this.dotSpacing;\n }\n }\n\n protected refreshBBox(): TSU.Geom.Rect {\n return TSU.DOM.svgBBox(this.dotsElem);\n }\n\n protected refreshMinSize(): TSU.Geom.Size {\n const numDots = Math.abs(this.note.octave);\n return {\n width: this.dotRadius * 2 * numDots + (numDots - 1) * this.dotSpacing,\n height: this.dotRadius * 2,\n };\n }\n\n protected updateBounds(\n x: null | number,\n y: null | number,\n w: null | number,\n h: null | number,\n ): [number | null, number | null, number | null, number | null] {\n if (x == null) x = this.x;\n if (y == null) y = this.y;\n // cannot set w/h\n // this.bbox.x = x;\n // this.bbox.y = y;\n return [x, y, null, null];\n }\n\n refreshLayout(): void {\n this.dotsElem.setAttribute(\"transform\", \"translate(\" + this.x + \",\" + this.y + \")\");\n }\n}\n\n////////// Carnatic embelishments\nexport class LabelEmbelishment extends LeafAtomViewEmbelishment {\n labelElem: SVGTextElement;\n constructor(public readonly label: string, public readonly atomView: LeafAtomView) {\n super(atomView);\n const rootElem = this.atomView.embRoot();\n this.labelElem = TSU.DOM.createSVGNode(\"text\", {\n doc: document,\n parent: rootElem,\n text: label,\n attrs: {\n source: \"atom\" + this.atomView.leafAtom.uuid,\n \"dominant-baseline\": \"hanging\",\n },\n });\n }\n\n protected refreshBBox(): TSU.Geom.Rect {\n return TSU.DOM.svgBBox(this.labelElem);\n }\n\n protected refreshMinSize(): TSU.Geom.Size {\n return TSU.DOM.svgBBox(this.labelElem);\n }\n\n protected updateBounds(\n x: null | number,\n y: null | number,\n w: null | number,\n h: null | number,\n ): [number | null, number | null, number | null, number | null] {\n return [x, y, w, h];\n }\n\n refreshLayout(): void {\n this.labelElem.setAttribute(\"x\", \"\" + this.x);\n this.labelElem.setAttribute(\"y\", \"\" + this.y);\n }\n}\n\nexport class BeatStartLines extends Embelishment {\n barSpacing = 10;\n protected line: SVGLineElement;\n\n constructor(public readonly source: BeatView, public readonly rootElement: SVGGraphicsElement) {\n super();\n this.line = TSU.DOM.createSVGNode(\"line\", {\n doc: document,\n parent: this.rootElement,\n attrs: {\n stroke: \"black\",\n \"stroke-width\": \"1\",\n class: \"bar-start-line\",\n },\n });\n }\n\n protected refreshBBox(): TSU.Geom.Rect {\n return new TSU.Geom.Rect(0, 0, 0, 0);\n }\n\n protected refreshMinSize(): TSU.Geom.Size {\n return new TSU.Geom.Rect(0, 0, 0, 0);\n }\n\n refreshLayout(): void {\n const line = this.line;\n const x = this.source.x - this.barSpacing;\n line.setAttribute(\"x1\", \"\" + x);\n line.setAttribute(\"x2\", \"\" + x);\n const y = this.source.y + this.source.bbox.y;\n const h = this.source.bbox.height;\n line.setAttribute(\"y1\", \"\" + y);\n line.setAttribute(\"y2\", \"\" + (y + h));\n }\n\n protected updateBounds(\n x: null | number,\n y: null | number,\n w: null | number,\n h: null | number,\n ): [number | null, number | null, number | null, number | null] {\n return [x, y, null, h];\n }\n}\n\nexport class BeatEndLines extends Embelishment {\n lineSpacing = 2;\n protected lines: SVGLineElement[];\n\n constructor(public readonly source: BeatView, public readonly rootElement: SVGGraphicsElement, nLines = 1) {\n super();\n this.lines = [];\n for (let i = 0; i < nLines; i++) {\n this.lines.push(\n TSU.DOM.createSVGNode(\"line\", {\n doc: document,\n // parent: l2g,\n parent: this.rootElement,\n attrs: {\n stroke: \"black\",\n \"stroke-width\": \"1\",\n class: \"bar-end-line\",\n },\n }),\n );\n }\n }\n\n protected refreshBBox(): TSU.Geom.Rect {\n return new TSU.Geom.Rect(0, 0, 0, 0);\n }\n\n protected refreshMinSize(): TSU.Geom.Size {\n return new TSU.Geom.Rect(0, 0, 0, 0);\n }\n\n protected updatePosition(x: null | number, y: null | number): [number | null, number | null] {\n return [x, y];\n }\n\n barSpacing = 15;\n\n refreshLayout(): void {\n // const x = this.source.width + this.barSpacing;\n // const y = 0;\n // const h = this.source.height;\n const x = this.source.x + this.source.width + this.barSpacing;\n const y = this.source.y + this.source.bbox.y;\n const h = this.source.bbox.height;\n let currX = x;\n for (const line of this.lines) {\n const lx = \"\" + currX;\n line.setAttribute(\"x1\", lx);\n line.setAttribute(\"x2\", lx);\n currX += 4;\n }\n for (const line of this.lines) {\n line.setAttribute(\"y1\", \"\" + y);\n line.setAttribute(\"y2\", \"\" + (y + h));\n }\n }\n\n protected updateBounds(\n x: null | number,\n y: null | number,\n w: null | number,\n h: null | number,\n ): [number | null, number | null, number | null, number | null] {\n return [null, null, null, null];\n }\n}\n\n/// Carnatic Embelishments\nexport class Kampitham extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"~\", atomView);\n }\n}\n\nexport class Nokku extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"w\", atomView);\n }\n}\n\nexport class Prathyagatham extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"∵\", atomView);\n }\n}\nexport class Spuritham extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"∴\", atomView);\n }\n}\nexport class Raavi extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"^\", atomView);\n }\n}\nexport class Kandippu extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"✓\", atomView);\n }\n}\n\nexport class Vaali extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"⌒\", atomView);\n }\n}\nexport class Odukkal extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"x\", atomView);\n }\n}\nexport class Orikkai extends LabelEmbelishment {\n constructor(public readonly atomView: LeafAtomView) {\n super(\"γ\", atomView);\n }\n}\n\nexport class Jaaru extends LeafAtomViewEmbelishment {\n pathElem: SVGPathElement;\n constructor(public readonly jaaru: JaaruGamaka, public readonly atomView: LeafAtomView) {\n super(atomView);\n // TODO - Create the \"fancier\" view\n // for now represent this with just a slant line (like a slash)\n const rootElem = this.atomView.embRoot();\n this.pathElem = TSU.DOM.createSVGNode(\"path\", {\n doc: document,\n parent: rootElem,\n attrs: {\n source: \"atom\" + this.atomView.leafAtom.uuid,\n stroke: \"black\",\n fill: \"transparent\",\n d: this.pathAttribute(),\n },\n });\n }\n\n pathAttribute(x = 0): string {\n const avbbox = this.atomView.glyph.minSize;\n let y2 = 0;\n const h2 = avbbox.height / 2;\n const x2 = x + h2;\n let y = this.atomView.y;\n if (this.jaaru.ascending) {\n y += avbbox.height;\n y2 = y - h2;\n } else {\n y -= h2;\n y2 = y + h2;\n }\n return [`M ${x} ${y}`, `Q ${x2} ${y} ${x2} ${y2}`].join(\" \");\n }\n\n protected refreshMinSize(): TSU.Geom.Size {\n return TSU.DOM.svgBBox(this.pathElem);\n }\n\n protected refreshBBox(): TSU.Geom.Rect {\n return TSU.DOM.svgBBox(this.pathElem);\n }\n\n protected updateBounds(\n x: null | number,\n y: null | number,\n w: null | number,\n h: null | number,\n ): [number | null, number | null, number | null, number | null] {\n return [x, null, null, null];\n }\n\n refreshLayout(): void {\n this.pathElem.setAttribute(\"d\", this.pathAttribute(this.x));\n }\n}\n"]}
@@ -1,33 +1,7 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __assign = (this && this.__assign) || function () {
18
- __assign = Object.assign || function(t) {
19
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20
- s = arguments[i];
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
- t[p] = s[p];
23
- }
24
- return t;
25
- };
26
- return __assign.apply(this, arguments);
27
- };
28
2
  Object.defineProperty(exports, "__esModule", { value: true });
29
3
  exports.parseEmbelishment = exports.JaaruGamaka = exports.Gamaka = exports.GamakaType = void 0;
30
- var core_1 = require("../core");
4
+ const core_1 = require("../core");
31
5
  var GamakaType;
32
6
  (function (GamakaType) {
33
7
  GamakaType["Kampitham"] = "Kampitham";
@@ -42,34 +16,28 @@ var GamakaType;
42
16
  GamakaType["Jaaru_Irakka"] = "IrakkaJaaru";
43
17
  GamakaType["Orikkai"] = "Orikkai";
44
18
  })(GamakaType = exports.GamakaType || (exports.GamakaType = {}));
45
- var Gamaka = (function () {
46
- function Gamaka(type) {
19
+ class Gamaka {
20
+ constructor(type) {
47
21
  this.type = type;
48
22
  }
49
- Gamaka.prototype.debugValue = function () {
23
+ debugValue() {
50
24
  return { type: this.type };
51
- };
52
- return Gamaka;
53
- }());
25
+ }
26
+ }
54
27
  exports.Gamaka = Gamaka;
55
- var JaaruGamaka = (function (_super) {
56
- __extends(JaaruGamaka, _super);
57
- function JaaruGamaka(ascending, startingNote) {
58
- if (ascending === void 0) { ascending = true; }
59
- if (startingNote === void 0) { startingNote = null; }
60
- var _this = _super.call(this, ascending ? GamakaType.Jaaru_Eetra : GamakaType.Jaaru_Irakka) || this;
61
- _this.ascending = ascending;
62
- _this.startingNote = startingNote;
63
- return _this;
28
+ class JaaruGamaka extends Gamaka {
29
+ constructor(ascending = true, startingNote = null) {
30
+ super(ascending ? GamakaType.Jaaru_Eetra : GamakaType.Jaaru_Irakka);
31
+ this.ascending = ascending;
32
+ this.startingNote = startingNote;
64
33
  }
65
- JaaruGamaka.prototype.debugValue = function () {
66
- var out = __assign(__assign({}, _super.prototype.debugValue.call(this)), { ascending: this.ascending });
34
+ debugValue() {
35
+ const out = Object.assign(Object.assign({}, super.debugValue()), { ascending: this.ascending });
67
36
  if (this.startingNote)
68
37
  out["startingNote"] = this.startingNote.debugValue();
69
38
  return out;
70
- };
71
- return JaaruGamaka;
72
- }(Gamaka));
39
+ }
40
+ }
73
41
  exports.JaaruGamaka = JaaruGamaka;
74
42
  function parseEmbelishment(value) {
75
43
  value = value.substring(1);
@@ -1 +1 @@
1
- {"version":3,"file":"gamakas.js","sourceRoot":"","sources":["../../../src/carnatic/gamakas.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gCAA+B;AAE/B,IAAY,UAwCX;AAxCD,WAAY,UAAU;IAGpB,qCAAuB,CAAA;IAGvB,6BAAe,CAAA;IAGf,qCAAuB,CAAA;IAGvB,6CAA+B,CAAA;IAG/B,sCAAwB,CAAA;IAIxB,4CAA8B,CAAA;IAG9B,6BAAe,CAAA;IAOf,iCAAmB,CAAA;IAGnB,wCAA0B,CAAA;IAG1B,0CAA4B,CAAA;IAI5B,iCAAmB,CAAA;AACrB,CAAC,EAxCW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAwCrB;AAED;IACE,gBAA4B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAChD,2B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AC,IAAI,WAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;KAClF;SAAM,IAAI,KAAK,IAAI,GAAG,EAAE;QACvB,OAAO,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;KAC/C;SAAM,IAAI,KAAK,IAAI,GAAG,IAAI,KAAK,IAAI,GAAG,EAAE;QACvC,OAAO,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;KAC/C;IAED,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACvB,CAAC;AA7BD,8CA6BC","sourcesContent":["import { Note } from \"../core\";\n\nexport enum GamakaType {\n // Kampitam (~)\n // The oscilation between 2 notes - eg p , S..n S..n S..n\n Kampitham = \"Kampitham\",\n\n // Nokku (w)\n Nokku = \"Nokku\",\n\n // Spuritham (∴ / u+2234) - Stress on the second note of a jantai\n Spuritham = \"Spuritham\",\n\n // Prathyagatham (∵ / u+2235) - Similar to reverse of Spuritham (in descending order)\n Prathyagatham = \"Prathyagatham\",\n\n // Raavi (^)\n Aahaatam_Raavi = \"Raavi\",\n\n // Kandippu (✓)\n // eg - Shankarabharanam's S. ,,, n , P ,,, - where the n is subtle\n Aahaatam_Kandippu = \"Kandippu\",\n\n // Vali (⌒ - U+2312)\n Vaali = \"Vaali\",\n\n // Odukkal (x):\n // A veena gamakam where the note itself is stretched more to get the next\n // note effect (instead of plucking the next note itself).\n // Not possible where plucking of strings is not possible.\n // On voice etc it just will sound like an Eetra Jaaru.\n Odukkal = \"Odukkal\",\n\n // (/) Ascension from one note to another - eg S / P\n Jaaru_Eetra = \"EetraJaaru\",\n\n // (\\) Descending from one note to another - eg P \\ S\n Jaaru_Irakka = \"IrakkaJaaru\",\n\n // Orikkai (γ)\n // eg S~~ RN N~~S.D D~~~NP\n Orikkai = \"Orikkai\",\n}\n\nexport class Gamaka {\n constructor(public readonly type: GamakaType) {}\n debugValue(): any {\n return { type: this.type };\n }\n}\n\nexport class JaaruGamaka extends Gamaka {\n constructor(public readonly ascending = true, public readonly startingNote: null | Note = null) {\n super(ascending ? GamakaType.Jaaru_Eetra : GamakaType.Jaaru_Irakka);\n }\n\n debugValue(): any {\n const out = { ...super.debugValue(), ascending: this.ascending };\n if (this.startingNote) out[\"startingNote\"] = this.startingNote.debugValue();\n return out;\n }\n}\n\nexport function parseEmbelishment(value: string): [any, boolean] {\n value = value.substring(1);\n if (value == \"\") {\n return [new Gamaka(GamakaType.Kampitham), true];\n } else if (value == \"^\") {\n return [new Gamaka(GamakaType.Aahaatam_Raavi), true];\n } else if (value == \"~\") {\n return [new Gamaka(GamakaType.Vaali), true];\n } else if (value == \"w\" || value == \"W\") {\n return [new Gamaka(GamakaType.Nokku), true];\n } else if (value == \"∴\" || value == \":-\") {\n return [new Gamaka(GamakaType.Spuritham), true];\n } else if (value == \"∵\" || value == \"-:\") {\n return [new Gamaka(GamakaType.Prathyagatham), true];\n } else if (value == \"✓\" || value == \"./\" || value == \".\\\\\") {\n return [new Gamaka(GamakaType.Aahaatam_Kandippu), true];\n } else if (value.endsWith(\"/\")) {\n value = value.substring(0, value.length - 1).trim();\n return [new JaaruGamaka(true, value.length > 0 ? new Note(value) : null), true];\n } else if (value.endsWith(\"\\\\\")) {\n value = value.substring(0, value.length - 1);\n return [new JaaruGamaka(false, value.length > 0 ? new Note(value) : null), true];\n } else if (value == \"x\") {\n return [new Gamaka(GamakaType.Odukkal), true];\n } else if (value == \"γ\" || value == \"Y\") {\n return [new Gamaka(GamakaType.Orikkai), true];\n }\n // throw new Error(\"Invalid carnatic embelishment: \" + value);\n return [null, false];\n}\n"]}
1
+ {"version":3,"file":"gamakas.js","sourceRoot":"","sources":["../../../src/carnatic/gamakas.ts"],"names":[],"mappings":";;;AAAA,kCAA+B;AAE/B,IAAY,UAwCX;AAxCD,WAAY,UAAU;IAGpB,qCAAuB,CAA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I,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QAC/B,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC7C,OAAO,CAAC,IAAI,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,WAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;KAClF;SAAM,IAAI,KAAK,IAAI,GAAG,EAAE;QACvB,OAAO,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;KAC/C;SAAM,IAAI,KAAK,IAAI,GAAG,IAAI,KAAK,IAAI,GAAG,EAAE;QACvC,OAAO,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;KAC/C;IAED,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACvB,CAAC;AA7BD,8CA6BC","sourcesContent":["import { Note } from \"../core\";\n\nexport enum GamakaType {\n // Kampitam (~)\n // The oscilation between 2 notes - eg p , S..n S..n S..n\n Kampitham = \"Kampitham\",\n\n // Nokku (w)\n Nokku = \"Nokku\",\n\n // Spuritham (∴ / u+2234) - Stress on the second note of a jantai\n Spuritham = \"Spuritham\",\n\n // Prathyagatham (∵ / u+2235) - Similar to reverse of Spuritham (in descending order)\n Prathyagatham = \"Prathyagatham\",\n\n // Raavi (^)\n Aahaatam_Raavi = \"Raavi\",\n\n // Kandippu (✓)\n // eg - Shankarabharanam's S. ,,, n , P ,,, - where the n is subtle\n Aahaatam_Kandippu = \"Kandippu\",\n\n // Vali (⌒ - U+2312)\n Vaali = \"Vaali\",\n\n // Odukkal (x):\n // A veena gamakam where the note itself is stretched more to get the next\n // note effect (instead of plucking the next note itself).\n // Not possible where plucking of strings is not possible.\n // On voice etc it just will sound like an Eetra Jaaru.\n Odukkal = \"Odukkal\",\n\n // (/) Ascension from one note to another - eg S / P\n Jaaru_Eetra = \"EetraJaaru\",\n\n // (\\) Descending from one note to another - eg P \\ S\n Jaaru_Irakka = \"IrakkaJaaru\",\n\n // Orikkai (γ)\n // eg S~~ RN N~~S.D D~~~NP\n Orikkai = \"Orikkai\",\n}\n\nexport class Gamaka {\n constructor(public readonly type: GamakaType) {}\n debugValue(): any {\n return { type: this.type };\n }\n}\n\nexport class JaaruGamaka extends Gamaka {\n constructor(public readonly ascending = true, public readonly startingNote: null | Note = null) {\n super(ascending ? GamakaType.Jaaru_Eetra : GamakaType.Jaaru_Irakka);\n }\n\n debugValue(): any {\n const out = { ...super.debugValue(), ascending: this.ascending };\n if (this.startingNote) out[\"startingNote\"] = this.startingNote.debugValue();\n return out;\n }\n}\n\nexport function parseEmbelishment(value: string): [any, boolean] {\n value = value.substring(1);\n if (value == \"\") {\n return [new Gamaka(GamakaType.Kampitham), true];\n } else if (value == \"^\") {\n return [new Gamaka(GamakaType.Aahaatam_Raavi), true];\n } else if (value == \"~\") {\n return [new Gamaka(GamakaType.Vaali), true];\n } else if (value == \"w\" || value == \"W\") {\n return [new Gamaka(GamakaType.Nokku), true];\n } else if (value == \"∴\" || value == \":-\") {\n return [new Gamaka(GamakaType.Spuritham), true];\n } else if (value == \"∵\" || value == \"-:\") {\n return [new Gamaka(GamakaType.Prathyagatham), true];\n } else if (value == \"✓\" || value == \"./\" || value == \".\\\\\") {\n return [new Gamaka(GamakaType.Aahaatam_Kandippu), true];\n } else if (value.endsWith(\"/\")) {\n value = value.substring(0, value.length - 1).trim();\n return [new JaaruGamaka(true, value.length > 0 ? new Note(value) : null), true];\n } else if (value.endsWith(\"\\\\\")) {\n value = value.substring(0, value.length - 1);\n return [new JaaruGamaka(false, value.length > 0 ? new Note(value) : null), true];\n } else if (value == \"x\") {\n return [new Gamaka(GamakaType.Odukkal), true];\n } else if (value == \"γ\" || value == \"Y\") {\n return [new Gamaka(GamakaType.Orikkai), true];\n }\n // throw new Error(\"Invalid carnatic embelishment: \" + value);\n return [null, false];\n}\n"]}
@@ -1,19 +1,4 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
3
  if (k2 === undefined) k2 = k;
19
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -37,311 +22,166 @@ var __importStar = (this && this.__importStar) || function (mod) {
37
22
  __setModuleDefault(result, mod);
38
23
  return result;
39
24
  };
40
- var __read = (this && this.__read) || function (o, n) {
41
- var m = typeof Symbol === "function" && o[Symbol.iterator];
42
- if (!m) return o;
43
- var i = m.call(o), r, ar = [], e;
44
- try {
45
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
46
- }
47
- catch (error) { e = { error: error }; }
48
- finally {
49
- try {
50
- if (r && !r.done && (m = i["return"])) m.call(i);
51
- }
52
- finally { if (e) throw e.error; }
53
- }
54
- return ar;
55
- };
56
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
57
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
58
- if (ar || !(i in from)) {
59
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
60
- ar[i] = from[i];
61
- }
62
- }
63
- return to.concat(ar || Array.prototype.slice.call(from));
64
- };
65
- var __values = (this && this.__values) || function(o) {
66
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
67
- if (m) return m.call(o);
68
- if (o && typeof o.length === "number") return {
69
- next: function () {
70
- if (o && i >= o.length) o = void 0;
71
- return { value: o && o[i++], done: !o };
72
- }
73
- };
74
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
75
- };
76
25
  Object.defineProperty(exports, "__esModule", { value: true });
77
26
  exports.SetBeatDuration = exports.SetCycle = exports.SetBreaks = exports.ApplyLayout = exports.LayoutParamCommand = exports.CreateRole = exports.CreateLine = exports.AddAtoms = exports.ActivateRole = exports.MetaData = exports.RawEmbedding = void 0;
78
- var TSU = __importStar(require("@panyam/tsutils"));
79
- var utils_1 = require("./utils");
80
- var notation_1 = require("./notation");
81
- var RawEmbedding = (function (_super) {
82
- __extends(RawEmbedding, _super);
83
- function RawEmbedding() {
84
- return _super !== null && _super.apply(this, arguments) || this;
27
+ const TSU = __importStar(require("@panyam/tsutils"));
28
+ const utils_1 = require("./utils");
29
+ const notation_1 = require("./notation");
30
+ class RawEmbedding extends notation_1.Command {
31
+ get rawContents() {
32
+ return this.getParamAt(0);
85
33
  }
86
- Object.defineProperty(RawEmbedding.prototype, "rawContents", {
87
- get: function () {
88
- return this.getParamAt(0);
89
- },
90
- enumerable: false,
91
- configurable: true
92
- });
93
- RawEmbedding.prototype.applyToNotation = function (notation) {
94
- var raw = new notation_1.RawBlock(this.rawContents);
34
+ applyToNotation(notation) {
35
+ const raw = new notation_1.RawBlock(this.rawContents);
95
36
  notation.addRawBlock(raw);
96
- };
97
- return RawEmbedding;
98
- }(notation_1.Command));
99
- exports.RawEmbedding = RawEmbedding;
100
- var MetaData = (function (_super) {
101
- __extends(MetaData, _super);
102
- function MetaData() {
103
- return _super !== null && _super.apply(this, arguments) || this;
104
37
  }
105
- MetaData.prototype.applyToNotation = function (notation) {
38
+ }
39
+ exports.RawEmbedding = RawEmbedding;
40
+ class MetaData extends notation_1.Command {
41
+ applyToNotation(notation) {
106
42
  notation.addMetaData(this.meta);
107
- };
108
- Object.defineProperty(MetaData.prototype, "meta", {
109
- get: function () {
110
- var out = new notation_1.MetaData(this.key, this.value);
111
- return out;
112
- },
113
- enumerable: false,
114
- configurable: true
115
- });
116
- Object.defineProperty(MetaData.prototype, "key", {
117
- get: function () {
118
- return this.getParamAt(0);
119
- },
120
- enumerable: false,
121
- configurable: true
122
- });
123
- Object.defineProperty(MetaData.prototype, "value", {
124
- get: function () {
125
- return this.getParamAt(1);
126
- },
127
- enumerable: false,
128
- configurable: true
129
- });
130
- return MetaData;
131
- }(notation_1.Command));
132
- exports.MetaData = MetaData;
133
- var ActivateRole = (function (_super) {
134
- __extends(ActivateRole, _super);
135
- function ActivateRole() {
136
- return _super !== null && _super.apply(this, arguments) || this;
137
43
  }
138
- ActivateRole.prototype.applyToNotation = function (notation) {
44
+ get meta() {
45
+ const out = new notation_1.MetaData(this.key, this.value);
46
+ return out;
47
+ }
48
+ get key() {
49
+ return this.getParamAt(0);
50
+ }
51
+ get value() {
52
+ return this.getParamAt(1);
53
+ }
54
+ }
55
+ exports.MetaData = MetaData;
56
+ class ActivateRole extends notation_1.Command {
57
+ applyToNotation(notation) {
139
58
  notation.setCurrRole(this.roleName);
140
- };
141
- Object.defineProperty(ActivateRole.prototype, "roleName", {
142
- get: function () {
143
- return this.getParamAt(0);
144
- },
145
- enumerable: false,
146
- configurable: true
147
- });
148
- return ActivateRole;
149
- }(notation_1.Command));
59
+ }
60
+ get roleName() {
61
+ return this.getParamAt(0);
62
+ }
63
+ }
150
64
  exports.ActivateRole = ActivateRole;
151
- var AddAtoms = (function (_super) {
152
- __extends(AddAtoms, _super);
153
- function AddAtoms() {
154
- var atoms = [];
155
- for (var _i = 0; _i < arguments.length; _i++) {
156
- atoms[_i] = arguments[_i];
157
- }
158
- var _this = _super.call(this) || this;
159
- _this.atoms = atoms;
160
- _this.index = 0;
161
- return _this;
65
+ class AddAtoms extends notation_1.Command {
66
+ constructor(...atoms) {
67
+ super();
68
+ this.atoms = atoms;
69
+ this.index = 0;
162
70
  }
163
- AddAtoms.prototype.debugValue = function () {
71
+ debugValue() {
164
72
  return {
165
73
  name: this.name,
166
74
  index: this.index,
167
- atoms: this.atoms.map(function (a) { return a.debugValue(); }),
75
+ atoms: this.atoms.map((a) => a.debugValue()),
168
76
  };
169
- };
170
- AddAtoms.prototype.applyToNotation = function (notation) {
171
- var _a;
172
- var roleDef = notation.currRoleDef;
77
+ }
78
+ applyToNotation(notation) {
79
+ let roleDef = notation.currRoleDef;
173
80
  if (roleDef == null) {
174
81
  roleDef = notation.newRoleDef("Sw", true);
175
82
  }
176
- var lpForLine = notation.layoutParamsForLine(notation.currentLine);
83
+ const lpForLine = notation.currentLine.layoutParams;
177
84
  if (lpForLine == null) {
178
- notation.setLayoutParamsForLine(notation.currentLine, notation.layoutParams);
85
+ notation.currentLine.layoutParams = notation.layoutParams;
179
86
  }
180
87
  else {
181
88
  TSU.assert(lpForLine == notation.layoutParams, "Layout parameters have changed so a new line should have been started");
182
89
  }
183
- var finalised = this.atoms;
184
- (_a = notation.currentLine).addAtoms.apply(_a, __spreadArray([roleDef.name, roleDef.notesOnly], __read(finalised), false));
185
- };
186
- return AddAtoms;
187
- }(notation_1.Command));
188
- exports.AddAtoms = AddAtoms;
189
- var CreateLine = (function (_super) {
190
- __extends(CreateLine, _super);
191
- function CreateLine() {
192
- return _super !== null && _super.apply(this, arguments) || this;
90
+ const finalised = this.atoms;
91
+ notation.currentLine.addAtoms(roleDef.name, roleDef.notesOnly, ...finalised);
193
92
  }
194
- CreateLine.prototype.applyToNotation = function (notation) {
195
- var line = notation.newLine();
93
+ }
94
+ exports.AddAtoms = AddAtoms;
95
+ class CreateLine extends notation_1.Command {
96
+ applyToNotation(notation) {
97
+ const line = notation.newLine();
196
98
  line.offset = this.offset;
197
99
  line.marginText = this.marginText;
198
- };
199
- Object.defineProperty(CreateLine.prototype, "offset", {
200
- get: function () {
201
- var offset = this.getParam("offset") || TSU.Num.Fraction.ZERO;
202
- if (typeof offset === "number")
203
- offset = new TSU.Num.Fraction(offset);
204
- return offset;
205
- },
206
- enumerable: false,
207
- configurable: true
208
- });
209
- Object.defineProperty(CreateLine.prototype, "marginText", {
210
- get: function () {
211
- if (this.params.length > 0) {
212
- if (this.params[0].key == null && typeof this.params[0].value === "string") {
213
- return this.params[0].value.trim();
214
- }
100
+ }
101
+ get offset() {
102
+ let offset = this.getParam("offset") || TSU.Num.Fraction.ZERO;
103
+ if (typeof offset === "number")
104
+ offset = new TSU.Num.Fraction(offset);
105
+ return offset;
106
+ }
107
+ get marginText() {
108
+ if (this.params.length > 0) {
109
+ if (this.params[0].key == null && typeof this.params[0].value === "string") {
110
+ return this.params[0].value.trim();
215
111
  }
216
- return this.getParam("marginText") || "";
217
- },
218
- enumerable: false,
219
- configurable: true
220
- });
221
- return CreateLine;
222
- }(notation_1.Command));
223
- exports.CreateLine = CreateLine;
224
- var CreateRole = (function (_super) {
225
- __extends(CreateRole, _super);
226
- function CreateRole() {
227
- return _super !== null && _super.apply(this, arguments) || this;
112
+ }
113
+ return this.getParam("marginText") || "";
228
114
  }
229
- CreateRole.prototype.applyToNotation = function (notation) {
230
- var name = this.getParamAt(0);
115
+ }
116
+ exports.CreateLine = CreateLine;
117
+ class CreateRole extends notation_1.Command {
118
+ applyToNotation(notation) {
119
+ const name = this.getParamAt(0);
231
120
  notation.newRoleDef(name, this.notesOnly);
232
- };
233
- Object.defineProperty(CreateRole.prototype, "notesOnly", {
234
- get: function () {
235
- var notesOnly = this.getParam("notes");
236
- return notesOnly == "true" || notesOnly == "yes" || notesOnly == true;
237
- },
238
- enumerable: false,
239
- configurable: true
240
- });
241
- return CreateRole;
242
- }(notation_1.Command));
243
- exports.CreateRole = CreateRole;
244
- var LayoutParamCommand = (function (_super) {
245
- __extends(LayoutParamCommand, _super);
246
- function LayoutParamCommand() {
247
- return _super !== null && _super.apply(this, arguments) || this;
248
121
  }
249
- return LayoutParamCommand;
250
- }(notation_1.Command));
251
- exports.LayoutParamCommand = LayoutParamCommand;
252
- var ApplyLayout = (function (_super) {
253
- __extends(ApplyLayout, _super);
254
- function ApplyLayout() {
255
- return _super !== null && _super.apply(this, arguments) || this;
122
+ get notesOnly() {
123
+ const notesOnly = this.getParam("notes");
124
+ return notesOnly == "true" || notesOnly == "yes" || notesOnly == true;
256
125
  }
257
- ApplyLayout.prototype.validateParams = function () {
126
+ }
127
+ exports.CreateRole = CreateRole;
128
+ class LayoutParamCommand extends notation_1.Command {
129
+ }
130
+ exports.LayoutParamCommand = LayoutParamCommand;
131
+ class ApplyLayout extends notation_1.Command {
132
+ validateParams() {
258
133
  if (this.params.length != 1 || typeof this.params[0].value !== "string") {
259
134
  throw new Error("layout command must contain one string argument");
260
135
  }
261
- };
262
- ApplyLayout.prototype.applyToNotation = function (notation) {
263
- var value = this.params[0].value;
136
+ }
137
+ applyToNotation(notation) {
138
+ const value = this.params[0].value;
264
139
  notation.ensureNamedLayoutParams(value);
265
- };
266
- return ApplyLayout;
267
- }(notation_1.Command));
140
+ }
141
+ }
268
142
  exports.ApplyLayout = ApplyLayout;
269
- var SetBreaks = (function (_super) {
270
- __extends(SetBreaks, _super);
271
- function SetBreaks() {
272
- return _super !== null && _super.apply(this, arguments) || this;
143
+ class SetBreaks extends LayoutParamCommand {
144
+ get pattern() {
145
+ return this.params.map((cmd) => cmd.value);
273
146
  }
274
- Object.defineProperty(SetBreaks.prototype, "pattern", {
275
- get: function () {
276
- return this.params.map(function (cmd) { return cmd.value; });
277
- },
278
- enumerable: false,
279
- configurable: true
280
- });
281
- SetBreaks.prototype.validateParams = function () {
282
- var e_1, _a;
283
- try {
284
- for (var _b = __values(this.params), _c = _b.next(); !_c.done; _c = _b.next()) {
285
- var param = _c.value;
286
- if (param.key != null) {
287
- throw new Error("Breaks command cannot have keyword params");
288
- }
289
- if (typeof param.value !== "number") {
290
- throw new Error("Breaks command must be a list of integers");
291
- }
147
+ validateParams() {
148
+ for (const param of this.params) {
149
+ if (param.key != null) {
150
+ throw new Error("Breaks command cannot have keyword params");
292
151
  }
293
- }
294
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
295
- finally {
296
- try {
297
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
152
+ if (typeof param.value !== "number") {
153
+ throw new Error("Breaks command must be a list of integers");
298
154
  }
299
- finally { if (e_1) throw e_1.error; }
300
155
  }
301
- };
302
- SetBreaks.prototype.applyToNotation = function (notation) {
156
+ }
157
+ applyToNotation(notation) {
303
158
  notation.currentBreaks = this.pattern;
304
159
  notation.resetLayoutParams();
305
- };
306
- return SetBreaks;
307
- }(LayoutParamCommand));
308
- exports.SetBreaks = SetBreaks;
309
- var SetCycle = (function (_super) {
310
- __extends(SetCycle, _super);
311
- function SetCycle() {
312
- return _super !== null && _super.apply(this, arguments) || this;
313
160
  }
314
- SetCycle.prototype.applyToNotation = function (notation) {
315
- var value = this.params[0].value;
316
- var cycle = (0, utils_1.parseCycle)(value);
161
+ }
162
+ exports.SetBreaks = SetBreaks;
163
+ class SetCycle extends LayoutParamCommand {
164
+ applyToNotation(notation) {
165
+ const value = this.params[0].value;
166
+ const cycle = (0, utils_1.parseCycle)(value);
317
167
  notation.currentCycle = cycle;
318
168
  notation.resetLayoutParams();
319
- };
320
- return SetCycle;
321
- }(LayoutParamCommand));
322
- exports.SetCycle = SetCycle;
323
- var SetBeatDuration = (function (_super) {
324
- __extends(SetBeatDuration, _super);
325
- function SetBeatDuration() {
326
- return _super !== null && _super.apply(this, arguments) || this;
327
169
  }
328
- SetBeatDuration.prototype.validateParams = function () {
170
+ }
171
+ exports.SetCycle = SetCycle;
172
+ class SetBeatDuration extends LayoutParamCommand {
173
+ validateParams() {
329
174
  if (this.params.length != 1 || typeof this.params[0].value !== "number") {
330
175
  throw new Error("beatDuration command must contain one number");
331
176
  }
332
- };
333
- Object.defineProperty(SetBeatDuration.prototype, "beatDuration", {
334
- get: function () {
335
- return this.params[0].value;
336
- },
337
- enumerable: false,
338
- configurable: true
339
- });
340
- SetBeatDuration.prototype.applyToNotation = function (notation) {
177
+ }
178
+ get beatDuration() {
179
+ return this.params[0].value;
180
+ }
181
+ applyToNotation(notation) {
341
182
  notation.currentAPB = this.beatDuration;
342
183
  notation.resetLayoutParams();
343
- };
344
- return SetBeatDuration;
345
- }(LayoutParamCommand));
184
+ }
185
+ }
346
186
  exports.SetBeatDuration = SetBeatDuration;
347
187
  //# sourceMappingURL=commands.js.map