notations 0.0.48 → 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 +73 -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 +6 -1
  29. package/lib/cjs/core.js +288 -493
  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 +124 -1
  36. package/lib/cjs/grids.js +546 -6
  37. package/lib/cjs/grids.js.map +1 -1
  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 +217 -219
  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 +71 -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 +6 -1
  85. package/lib/esm/core.js +286 -502
  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 +124 -1
  92. package/lib/esm/grids.js +515 -5
  93. package/lib/esm/grids.js.map +1 -1
  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 +211 -214
  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 +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"embelishments.js","sourceRoot":"","sources":["../../../src/carnatic/embelishments.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;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DD,CAA2B,wBAAwB,GAuDlD","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,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AAGvC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAOzC,MAAM,OAAgB,wBAAyB,SAAQ,YAAY;IACjE,YAA4B,QAAsB;QAChD,KAAK,EAAE,CAAC;QADkB,aAAQ,GAAR,QAAQ,CAAc;IAElD,CAAC;CACF;AAED,MAAM,OAAO,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,CAAC,SAAS,GAAG,CAAC,GAAG,OAAO,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU;gBACrE,MAAM,EAAE,IAAI,CAAC,SAAS,GAAG,CAAC;gBAC1B,MAAM,EAAE,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AAC;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","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,29 +1,3 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- var __assign = (this && this.__assign) || function () {
17
- __assign = Object.assign || function(t) {
18
- for (var s, i = 1, n = arguments.length; i < n; i++) {
19
- s = arguments[i];
20
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
21
- t[p] = s[p];
22
- }
23
- return t;
24
- };
25
- return __assign.apply(this, arguments);
26
- };
27
1
  import { Note } from "../core";
28
2
  export var GamakaType;
29
3
  (function (GamakaType) {
@@ -39,35 +13,27 @@ export var GamakaType;
39
13
  GamakaType["Jaaru_Irakka"] = "IrakkaJaaru";
40
14
  GamakaType["Orikkai"] = "Orikkai";
41
15
  })(GamakaType || (GamakaType = {}));
42
- var Gamaka = (function () {
43
- function Gamaka(type) {
16
+ export class Gamaka {
17
+ constructor(type) {
44
18
  this.type = type;
45
19
  }
46
- Gamaka.prototype.debugValue = function () {
20
+ debugValue() {
47
21
  return { type: this.type };
48
- };
49
- return Gamaka;
50
- }());
51
- export { Gamaka };
52
- var JaaruGamaka = (function (_super) {
53
- __extends(JaaruGamaka, _super);
54
- function JaaruGamaka(ascending, startingNote) {
55
- if (ascending === void 0) { ascending = true; }
56
- if (startingNote === void 0) { startingNote = null; }
57
- var _this = _super.call(this, ascending ? GamakaType.Jaaru_Eetra : GamakaType.Jaaru_Irakka) || this;
58
- _this.ascending = ascending;
59
- _this.startingNote = startingNote;
60
- return _this;
61
22
  }
62
- JaaruGamaka.prototype.debugValue = function () {
63
- var out = __assign(__assign({}, _super.prototype.debugValue.call(this)), { ascending: this.ascending });
23
+ }
24
+ export class JaaruGamaka extends Gamaka {
25
+ constructor(ascending = true, startingNote = null) {
26
+ super(ascending ? GamakaType.Jaaru_Eetra : GamakaType.Jaaru_Irakka);
27
+ this.ascending = ascending;
28
+ this.startingNote = startingNote;
29
+ }
30
+ debugValue() {
31
+ const out = Object.assign(Object.assign({}, super.debugValue()), { ascending: this.ascending });
64
32
  if (this.startingNote)
65
33
  out["startingNote"] = this.startingNote.debugValue();
66
34
  return out;
67
- };
68
- return JaaruGamaka;
69
- }(Gamaka));
70
- export { JaaruGamaka };
35
+ }
36
+ }
71
37
  export function parseEmbelishment(value) {
72
38
  value = value.substring(1);
73
39
  if (value == "") {
@@ -1 +1 @@
1
- {"version":3,"file":"gamakas.js","sourceRoot":"","sources":["../../../src/carnatic/gamakas.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,MAAM,CAAN,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,KAAV,UAAU,QAwCrB;AAED;IACE,gBAA4B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAChD,2BAAU,GAAV;QACE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;IACH,aAAC;AAAD,CAAC,AALD,IAKC;;AAED;IAAiC,+BAAM;IACrC,qBAA4B,SAAgB,EAAkB,YAAgC;QAAlE,0BAAA,EAAA,gBAAgB;QAAkB,6BAAA,EAAA,mBAAgC;QAA9F,YACE,kBAAM,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,SACpE;QAF2B,eAAS,GAAT,SAAS,CAAO;QAAkB,kBAAY,GAAZ,YAAY,CAAoB;;IAE9F,CAAC;IAED,gCAAU,GAA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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,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,MAAM,CAAN,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,KAAV,UAAU,QAwCrB;AAED,MAAM,OAAO,MAAM;IACjB,YAA4B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAChD,UAAU;QACR,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;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/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","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,321 +1,150 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- var __read = (this && this.__read) || function (o, n) {
17
- var m = typeof Symbol === "function" && o[Symbol.iterator];
18
- if (!m) return o;
19
- var i = m.call(o), r, ar = [], e;
20
- try {
21
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
22
- }
23
- catch (error) { e = { error: error }; }
24
- finally {
25
- try {
26
- if (r && !r.done && (m = i["return"])) m.call(i);
27
- }
28
- finally { if (e) throw e.error; }
29
- }
30
- return ar;
31
- };
32
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
33
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
34
- if (ar || !(i in from)) {
35
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
36
- ar[i] = from[i];
37
- }
38
- }
39
- return to.concat(ar || Array.prototype.slice.call(from));
40
- };
41
- var __values = (this && this.__values) || function(o) {
42
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
43
- if (m) return m.call(o);
44
- if (o && typeof o.length === "number") return {
45
- next: function () {
46
- if (o && i >= o.length) o = void 0;
47
- return { value: o && o[i++], done: !o };
48
- }
49
- };
50
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
51
- };
52
1
  import * as TSU from "@panyam/tsutils";
53
2
  import { parseCycle } from "./utils";
54
3
  import { Command, RawBlock, MetaData as Meta } from "./notation";
55
- var RawEmbedding = (function (_super) {
56
- __extends(RawEmbedding, _super);
57
- function RawEmbedding() {
58
- return _super !== null && _super.apply(this, arguments) || this;
4
+ export class RawEmbedding extends Command {
5
+ get rawContents() {
6
+ return this.getParamAt(0);
59
7
  }
60
- Object.defineProperty(RawEmbedding.prototype, "rawContents", {
61
- get: function () {
62
- return this.getParamAt(0);
63
- },
64
- enumerable: false,
65
- configurable: true
66
- });
67
- RawEmbedding.prototype.applyToNotation = function (notation) {
68
- var raw = new RawBlock(this.rawContents);
8
+ applyToNotation(notation) {
9
+ const raw = new RawBlock(this.rawContents);
69
10
  notation.addRawBlock(raw);
70
- };
71
- return RawEmbedding;
72
- }(Command));
73
- export { RawEmbedding };
74
- var MetaData = (function (_super) {
75
- __extends(MetaData, _super);
76
- function MetaData() {
77
- return _super !== null && _super.apply(this, arguments) || this;
78
11
  }
79
- MetaData.prototype.applyToNotation = function (notation) {
12
+ }
13
+ export class MetaData extends Command {
14
+ applyToNotation(notation) {
80
15
  notation.addMetaData(this.meta);
81
- };
82
- Object.defineProperty(MetaData.prototype, "meta", {
83
- get: function () {
84
- var out = new Meta(this.key, this.value);
85
- return out;
86
- },
87
- enumerable: false,
88
- configurable: true
89
- });
90
- Object.defineProperty(MetaData.prototype, "key", {
91
- get: function () {
92
- return this.getParamAt(0);
93
- },
94
- enumerable: false,
95
- configurable: true
96
- });
97
- Object.defineProperty(MetaData.prototype, "value", {
98
- get: function () {
99
- return this.getParamAt(1);
100
- },
101
- enumerable: false,
102
- configurable: true
103
- });
104
- return MetaData;
105
- }(Command));
106
- export { MetaData };
107
- var ActivateRole = (function (_super) {
108
- __extends(ActivateRole, _super);
109
- function ActivateRole() {
110
- return _super !== null && _super.apply(this, arguments) || this;
111
16
  }
112
- ActivateRole.prototype.applyToNotation = function (notation) {
17
+ get meta() {
18
+ const out = new Meta(this.key, this.value);
19
+ return out;
20
+ }
21
+ get key() {
22
+ return this.getParamAt(0);
23
+ }
24
+ get value() {
25
+ return this.getParamAt(1);
26
+ }
27
+ }
28
+ export class ActivateRole extends Command {
29
+ applyToNotation(notation) {
113
30
  notation.setCurrRole(this.roleName);
114
- };
115
- Object.defineProperty(ActivateRole.prototype, "roleName", {
116
- get: function () {
117
- return this.getParamAt(0);
118
- },
119
- enumerable: false,
120
- configurable: true
121
- });
122
- return ActivateRole;
123
- }(Command));
124
- export { ActivateRole };
125
- var AddAtoms = (function (_super) {
126
- __extends(AddAtoms, _super);
127
- function AddAtoms() {
128
- var atoms = [];
129
- for (var _i = 0; _i < arguments.length; _i++) {
130
- atoms[_i] = arguments[_i];
131
- }
132
- var _this = _super.call(this) || this;
133
- _this.atoms = atoms;
134
- _this.index = 0;
135
- return _this;
136
31
  }
137
- AddAtoms.prototype.debugValue = function () {
32
+ get roleName() {
33
+ return this.getParamAt(0);
34
+ }
35
+ }
36
+ export class AddAtoms extends Command {
37
+ constructor(...atoms) {
38
+ super();
39
+ this.atoms = atoms;
40
+ this.index = 0;
41
+ }
42
+ debugValue() {
138
43
  return {
139
44
  name: this.name,
140
45
  index: this.index,
141
- atoms: this.atoms.map(function (a) { return a.debugValue(); }),
46
+ atoms: this.atoms.map((a) => a.debugValue()),
142
47
  };
143
- };
144
- AddAtoms.prototype.applyToNotation = function (notation) {
145
- var _a;
146
- var roleDef = notation.currRoleDef;
48
+ }
49
+ applyToNotation(notation) {
50
+ let roleDef = notation.currRoleDef;
147
51
  if (roleDef == null) {
148
52
  roleDef = notation.newRoleDef("Sw", true);
149
53
  }
150
- var lpForLine = notation.layoutParamsForLine(notation.currentLine);
54
+ const lpForLine = notation.currentLine.layoutParams;
151
55
  if (lpForLine == null) {
152
- notation.setLayoutParamsForLine(notation.currentLine, notation.layoutParams);
56
+ notation.currentLine.layoutParams = notation.layoutParams;
153
57
  }
154
58
  else {
155
59
  TSU.assert(lpForLine == notation.layoutParams, "Layout parameters have changed so a new line should have been started");
156
60
  }
157
- var finalised = this.atoms;
158
- (_a = notation.currentLine).addAtoms.apply(_a, __spreadArray([roleDef.name, roleDef.notesOnly], __read(finalised), false));
159
- };
160
- return AddAtoms;
161
- }(Command));
162
- export { AddAtoms };
163
- var CreateLine = (function (_super) {
164
- __extends(CreateLine, _super);
165
- function CreateLine() {
166
- return _super !== null && _super.apply(this, arguments) || this;
61
+ const finalised = this.atoms;
62
+ notation.currentLine.addAtoms(roleDef.name, roleDef.notesOnly, ...finalised);
167
63
  }
168
- CreateLine.prototype.applyToNotation = function (notation) {
169
- var line = notation.newLine();
64
+ }
65
+ export class CreateLine extends Command {
66
+ applyToNotation(notation) {
67
+ const line = notation.newLine();
170
68
  line.offset = this.offset;
171
69
  line.marginText = this.marginText;
172
- };
173
- Object.defineProperty(CreateLine.prototype, "offset", {
174
- get: function () {
175
- var offset = this.getParam("offset") || TSU.Num.Fraction.ZERO;
176
- if (typeof offset === "number")
177
- offset = new TSU.Num.Fraction(offset);
178
- return offset;
179
- },
180
- enumerable: false,
181
- configurable: true
182
- });
183
- Object.defineProperty(CreateLine.prototype, "marginText", {
184
- get: function () {
185
- if (this.params.length > 0) {
186
- if (this.params[0].key == null && typeof this.params[0].value === "string") {
187
- return this.params[0].value.trim();
188
- }
70
+ }
71
+ get offset() {
72
+ let offset = this.getParam("offset") || TSU.Num.Fraction.ZERO;
73
+ if (typeof offset === "number")
74
+ offset = new TSU.Num.Fraction(offset);
75
+ return offset;
76
+ }
77
+ get marginText() {
78
+ if (this.params.length > 0) {
79
+ if (this.params[0].key == null && typeof this.params[0].value === "string") {
80
+ return this.params[0].value.trim();
189
81
  }
190
- return this.getParam("marginText") || "";
191
- },
192
- enumerable: false,
193
- configurable: true
194
- });
195
- return CreateLine;
196
- }(Command));
197
- export { CreateLine };
198
- var CreateRole = (function (_super) {
199
- __extends(CreateRole, _super);
200
- function CreateRole() {
201
- return _super !== null && _super.apply(this, arguments) || this;
82
+ }
83
+ return this.getParam("marginText") || "";
202
84
  }
203
- CreateRole.prototype.applyToNotation = function (notation) {
204
- var name = this.getParamAt(0);
85
+ }
86
+ export class CreateRole extends Command {
87
+ applyToNotation(notation) {
88
+ const name = this.getParamAt(0);
205
89
  notation.newRoleDef(name, this.notesOnly);
206
- };
207
- Object.defineProperty(CreateRole.prototype, "notesOnly", {
208
- get: function () {
209
- var notesOnly = this.getParam("notes");
210
- return notesOnly == "true" || notesOnly == "yes" || notesOnly == true;
211
- },
212
- enumerable: false,
213
- configurable: true
214
- });
215
- return CreateRole;
216
- }(Command));
217
- export { CreateRole };
218
- var LayoutParamCommand = (function (_super) {
219
- __extends(LayoutParamCommand, _super);
220
- function LayoutParamCommand() {
221
- return _super !== null && _super.apply(this, arguments) || this;
222
90
  }
223
- return LayoutParamCommand;
224
- }(Command));
225
- export { LayoutParamCommand };
226
- var ApplyLayout = (function (_super) {
227
- __extends(ApplyLayout, _super);
228
- function ApplyLayout() {
229
- return _super !== null && _super.apply(this, arguments) || this;
91
+ get notesOnly() {
92
+ const notesOnly = this.getParam("notes");
93
+ return notesOnly == "true" || notesOnly == "yes" || notesOnly == true;
230
94
  }
231
- ApplyLayout.prototype.validateParams = function () {
95
+ }
96
+ export class LayoutParamCommand extends Command {
97
+ }
98
+ export class ApplyLayout extends Command {
99
+ validateParams() {
232
100
  if (this.params.length != 1 || typeof this.params[0].value !== "string") {
233
101
  throw new Error("layout command must contain one string argument");
234
102
  }
235
- };
236
- ApplyLayout.prototype.applyToNotation = function (notation) {
237
- var value = this.params[0].value;
103
+ }
104
+ applyToNotation(notation) {
105
+ const value = this.params[0].value;
238
106
  notation.ensureNamedLayoutParams(value);
239
- };
240
- return ApplyLayout;
241
- }(Command));
242
- export { ApplyLayout };
243
- var SetBreaks = (function (_super) {
244
- __extends(SetBreaks, _super);
245
- function SetBreaks() {
246
- return _super !== null && _super.apply(this, arguments) || this;
247
107
  }
248
- Object.defineProperty(SetBreaks.prototype, "pattern", {
249
- get: function () {
250
- return this.params.map(function (cmd) { return cmd.value; });
251
- },
252
- enumerable: false,
253
- configurable: true
254
- });
255
- SetBreaks.prototype.validateParams = function () {
256
- var e_1, _a;
257
- try {
258
- for (var _b = __values(this.params), _c = _b.next(); !_c.done; _c = _b.next()) {
259
- var param = _c.value;
260
- if (param.key != null) {
261
- throw new Error("Breaks command cannot have keyword params");
262
- }
263
- if (typeof param.value !== "number") {
264
- throw new Error("Breaks command must be a list of integers");
265
- }
108
+ }
109
+ export class SetBreaks extends LayoutParamCommand {
110
+ get pattern() {
111
+ return this.params.map((cmd) => cmd.value);
112
+ }
113
+ validateParams() {
114
+ for (const param of this.params) {
115
+ if (param.key != null) {
116
+ throw new Error("Breaks command cannot have keyword params");
266
117
  }
267
- }
268
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
269
- finally {
270
- try {
271
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
118
+ if (typeof param.value !== "number") {
119
+ throw new Error("Breaks command must be a list of integers");
272
120
  }
273
- finally { if (e_1) throw e_1.error; }
274
121
  }
275
- };
276
- SetBreaks.prototype.applyToNotation = function (notation) {
122
+ }
123
+ applyToNotation(notation) {
277
124
  notation.currentBreaks = this.pattern;
278
125
  notation.resetLayoutParams();
279
- };
280
- return SetBreaks;
281
- }(LayoutParamCommand));
282
- export { SetBreaks };
283
- var SetCycle = (function (_super) {
284
- __extends(SetCycle, _super);
285
- function SetCycle() {
286
- return _super !== null && _super.apply(this, arguments) || this;
287
126
  }
288
- SetCycle.prototype.applyToNotation = function (notation) {
289
- var value = this.params[0].value;
290
- var cycle = parseCycle(value);
127
+ }
128
+ export class SetCycle extends LayoutParamCommand {
129
+ applyToNotation(notation) {
130
+ const value = this.params[0].value;
131
+ const cycle = parseCycle(value);
291
132
  notation.currentCycle = cycle;
292
133
  notation.resetLayoutParams();
293
- };
294
- return SetCycle;
295
- }(LayoutParamCommand));
296
- export { SetCycle };
297
- var SetBeatDuration = (function (_super) {
298
- __extends(SetBeatDuration, _super);
299
- function SetBeatDuration() {
300
- return _super !== null && _super.apply(this, arguments) || this;
301
134
  }
302
- SetBeatDuration.prototype.validateParams = function () {
135
+ }
136
+ export class SetBeatDuration extends LayoutParamCommand {
137
+ validateParams() {
303
138
  if (this.params.length != 1 || typeof this.params[0].value !== "number") {
304
139
  throw new Error("beatDuration command must contain one number");
305
140
  }
306
- };
307
- Object.defineProperty(SetBeatDuration.prototype, "beatDuration", {
308
- get: function () {
309
- return this.params[0].value;
310
- },
311
- enumerable: false,
312
- configurable: true
313
- });
314
- SetBeatDuration.prototype.applyToNotation = function (notation) {
141
+ }
142
+ get beatDuration() {
143
+ return this.params[0].value;
144
+ }
145
+ applyToNotation(notation) {
315
146
  notation.currentAPB = this.beatDuration;
316
147
  notation.resetLayoutParams();
317
- };
318
- return SetBeatDuration;
319
- }(LayoutParamCommand));
320
- export { SetBeatDuration };
148
+ }
149
+ }
321
150
  //# sourceMappingURL=commands.js.map