@sudobility/music_types 0.11.30 → 0.11.32

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 (251) hide show
  1. package/dist/domain/commands/edit-commands.d.ts +3 -3
  2. package/dist/domain/commands/edit-commands.d.ts.map +1 -1
  3. package/dist/domain/commands/edit-commands.js +25 -25
  4. package/dist/domain/commands/edit-commands.js.map +1 -1
  5. package/dist/domain/commands/history.d.ts +32 -0
  6. package/dist/domain/commands/history.d.ts.map +1 -0
  7. package/dist/domain/commands/history.js +63 -0
  8. package/dist/domain/commands/history.js.map +1 -0
  9. package/dist/domain/commands/note-commands.d.ts +9 -12
  10. package/dist/domain/commands/note-commands.d.ts.map +1 -1
  11. package/dist/domain/commands/note-commands.js +42 -72
  12. package/dist/domain/commands/note-commands.js.map +1 -1
  13. package/dist/domain/commands/note-marks.d.ts +171 -0
  14. package/dist/domain/commands/note-marks.d.ts.map +1 -0
  15. package/dist/domain/commands/note-marks.js +427 -0
  16. package/dist/domain/commands/note-marks.js.map +1 -0
  17. package/dist/domain/commands/reflow.d.ts +1 -1
  18. package/dist/domain/commands/reflow.js +17 -17
  19. package/dist/domain/commands/reflow.js.map +1 -1
  20. package/dist/domain/commands/region-commands.d.ts +4 -4
  21. package/dist/domain/commands/region-commands.d.ts.map +1 -1
  22. package/dist/domain/commands/region-commands.js +7 -7
  23. package/dist/domain/commands/region-commands.js.map +1 -1
  24. package/dist/domain/commands/relocate-commands.d.ts +3 -3
  25. package/dist/domain/commands/relocate-commands.js +15 -15
  26. package/dist/domain/commands/relocate-commands.js.map +1 -1
  27. package/dist/domain/commands/ripple-commands.d.ts +2 -2
  28. package/dist/domain/commands/ripple-commands.js +13 -13
  29. package/dist/domain/commands/ripple-commands.js.map +1 -1
  30. package/dist/domain/commands/snapshot.d.ts +3 -3
  31. package/dist/domain/commands/snapshot.js +5 -5
  32. package/dist/domain/commands/snapshot.js.map +1 -1
  33. package/dist/domain/commands/structure-commands.d.ts +86 -5
  34. package/dist/domain/commands/structure-commands.d.ts.map +1 -1
  35. package/dist/domain/commands/structure-commands.js +272 -36
  36. package/dist/domain/commands/structure-commands.js.map +1 -1
  37. package/dist/domain/commands/track-commands.d.ts +2 -2
  38. package/dist/domain/commands/track-commands.js +7 -7
  39. package/dist/domain/commands/track-commands.js.map +1 -1
  40. package/dist/domain/commands/types.d.ts +2 -2
  41. package/dist/domain/generation/replacement-region.d.ts +32 -0
  42. package/dist/domain/generation/replacement-region.d.ts.map +1 -0
  43. package/dist/domain/generation/replacement-region.js +79 -0
  44. package/dist/domain/generation/replacement-region.js.map +1 -0
  45. package/dist/domain/instruments/gm-icon.d.ts +12 -0
  46. package/dist/domain/instruments/gm-icon.d.ts.map +1 -0
  47. package/dist/domain/instruments/gm-icon.js +327 -0
  48. package/dist/domain/instruments/gm-icon.js.map +1 -0
  49. package/dist/domain/instruments/gm-kit.js +9 -9
  50. package/dist/domain/instruments/gm-kit.js.map +1 -1
  51. package/dist/domain/instruments/gm-percussion.js +48 -48
  52. package/dist/domain/instruments/gm-percussion.js.map +1 -1
  53. package/dist/domain/instruments/gm-polyphony.js +6 -6
  54. package/dist/domain/instruments/gm-range.js +6 -6
  55. package/dist/domain/instruments/gm-transposition.js +1 -1
  56. package/dist/domain/instruments/gm.d.ts +1 -1
  57. package/dist/domain/instruments/gm.js +161 -161
  58. package/dist/domain/instruments/gm.js.map +1 -1
  59. package/dist/domain/instruments/icon-art.d.ts +75 -0
  60. package/dist/domain/instruments/icon-art.d.ts.map +1 -0
  61. package/dist/domain/instruments/icon-art.js +93 -0
  62. package/dist/domain/instruments/icon-art.js.map +1 -0
  63. package/dist/domain/instruments/instrument-fit.d.ts +31 -0
  64. package/dist/domain/instruments/instrument-fit.d.ts.map +1 -0
  65. package/dist/domain/instruments/instrument-fit.js +117 -0
  66. package/dist/domain/instruments/instrument-fit.js.map +1 -0
  67. package/dist/domain/instruments/instrument-options.d.ts +62 -0
  68. package/dist/domain/instruments/instrument-options.d.ts.map +1 -0
  69. package/dist/domain/instruments/instrument-options.js +69 -0
  70. package/dist/domain/instruments/instrument-options.js.map +1 -0
  71. package/dist/domain/instruments/track-instrument.d.ts +80 -0
  72. package/dist/domain/instruments/track-instrument.d.ts.map +1 -0
  73. package/dist/domain/instruments/track-instrument.js +102 -0
  74. package/dist/domain/instruments/track-instrument.js.map +1 -0
  75. package/dist/domain/notation/chord-symbol.d.ts +26 -0
  76. package/dist/domain/notation/chord-symbol.d.ts.map +1 -0
  77. package/dist/domain/notation/chord-symbol.js +32 -0
  78. package/dist/domain/notation/chord-symbol.js.map +1 -0
  79. package/dist/domain/notation/lyric-syllables.d.ts +15 -0
  80. package/dist/domain/notation/lyric-syllables.d.ts.map +1 -0
  81. package/dist/domain/notation/lyric-syllables.js +15 -0
  82. package/dist/domain/notation/lyric-syllables.js.map +1 -0
  83. package/dist/domain/notation/music-vocabulary.d.ts +59 -0
  84. package/dist/domain/notation/music-vocabulary.d.ts.map +1 -0
  85. package/dist/domain/notation/music-vocabulary.js +164 -0
  86. package/dist/domain/notation/music-vocabulary.js.map +1 -0
  87. package/dist/domain/pitch/pitch.d.ts +1 -1
  88. package/dist/domain/pitch/pitch.js +29 -29
  89. package/dist/domain/pitch/transpose.d.ts +1 -1
  90. package/dist/domain/pitch/transpose.js +2 -2
  91. package/dist/domain/quantization/quantize.d.ts +2 -2
  92. package/dist/domain/quantization/quantize.js +9 -9
  93. package/dist/domain/quantization/quantize.js.map +1 -1
  94. package/dist/domain/score/articulation.d.ts +56 -0
  95. package/dist/domain/score/articulation.d.ts.map +1 -0
  96. package/dist/domain/score/articulation.js +56 -0
  97. package/dist/domain/score/articulation.js.map +1 -0
  98. package/dist/domain/score/bar-numbers.d.ts +38 -0
  99. package/dist/domain/score/bar-numbers.d.ts.map +1 -0
  100. package/dist/domain/score/bar-numbers.js +49 -0
  101. package/dist/domain/score/bar-numbers.js.map +1 -0
  102. package/dist/domain/score/collapse-rests.d.ts +23 -0
  103. package/dist/domain/score/collapse-rests.d.ts.map +1 -0
  104. package/dist/domain/score/collapse-rests.js +78 -0
  105. package/dist/domain/score/collapse-rests.js.map +1 -0
  106. package/dist/domain/score/cue-notes.d.ts +24 -0
  107. package/dist/domain/score/cue-notes.d.ts.map +1 -0
  108. package/dist/domain/score/cue-notes.js +105 -0
  109. package/dist/domain/score/cue-notes.js.map +1 -0
  110. package/dist/domain/score/dynamics.d.ts +62 -0
  111. package/dist/domain/score/dynamics.d.ts.map +1 -0
  112. package/dist/domain/score/dynamics.js +142 -0
  113. package/dist/domain/score/dynamics.js.map +1 -0
  114. package/dist/domain/score/effective-clef.d.ts +42 -0
  115. package/dist/domain/score/effective-clef.d.ts.map +1 -0
  116. package/dist/domain/score/effective-clef.js +39 -0
  117. package/dist/domain/score/effective-clef.js.map +1 -0
  118. package/dist/domain/score/extract-part.d.ts +10 -0
  119. package/dist/domain/score/extract-part.d.ts.map +1 -0
  120. package/dist/domain/score/extract-part.js +44 -0
  121. package/dist/domain/score/extract-part.js.map +1 -0
  122. package/dist/domain/score/factory.d.ts +1 -1
  123. package/dist/domain/score/factory.js +12 -12
  124. package/dist/domain/score/factory.js.map +1 -1
  125. package/dist/domain/score/fermata-tempo.d.ts +40 -0
  126. package/dist/domain/score/fermata-tempo.d.ts.map +1 -0
  127. package/dist/domain/score/fermata-tempo.js +95 -0
  128. package/dist/domain/score/fermata-tempo.js.map +1 -0
  129. package/dist/domain/score/flatten.d.ts +32 -0
  130. package/dist/domain/score/flatten.d.ts.map +1 -0
  131. package/dist/domain/score/flatten.js +132 -0
  132. package/dist/domain/score/flatten.js.map +1 -0
  133. package/dist/domain/score/fragment.d.ts +4 -8
  134. package/dist/domain/score/fragment.d.ts.map +1 -1
  135. package/dist/domain/score/fragment.js +8 -8
  136. package/dist/domain/score/fragment.js.map +1 -1
  137. package/dist/domain/score/ids.d.ts +1 -1
  138. package/dist/domain/score/ids.js +6 -6
  139. package/dist/domain/score/ottava.d.ts +41 -0
  140. package/dist/domain/score/ottava.d.ts.map +1 -0
  141. package/dist/domain/score/ottava.js +98 -0
  142. package/dist/domain/score/ottava.js.map +1 -0
  143. package/dist/domain/score/performance-timeline.d.ts +42 -0
  144. package/dist/domain/score/performance-timeline.d.ts.map +1 -0
  145. package/dist/domain/score/performance-timeline.js +78 -0
  146. package/dist/domain/score/performance-timeline.js.map +1 -0
  147. package/dist/domain/score/queries.d.ts +2 -2
  148. package/dist/domain/score/queries.js +7 -7
  149. package/dist/domain/score/queries.js.map +1 -1
  150. package/dist/domain/score/rehearsal-marks.d.ts +30 -0
  151. package/dist/domain/score/rehearsal-marks.d.ts.map +1 -0
  152. package/dist/domain/score/rehearsal-marks.js +126 -0
  153. package/dist/domain/score/rehearsal-marks.js.map +1 -0
  154. package/dist/domain/score/repeat-order.d.ts +21 -0
  155. package/dist/domain/score/repeat-order.d.ts.map +1 -0
  156. package/dist/domain/score/repeat-order.js +123 -0
  157. package/dist/domain/score/repeat-order.js.map +1 -0
  158. package/dist/domain/score/snapshot-tree.d.ts +23 -0
  159. package/dist/domain/score/snapshot-tree.d.ts.map +1 -0
  160. package/dist/domain/score/snapshot-tree.js +45 -0
  161. package/dist/domain/score/snapshot-tree.js.map +1 -0
  162. package/dist/domain/score/ties.d.ts +1 -1
  163. package/dist/domain/score/ties.js +7 -7
  164. package/dist/domain/score/ties.js.map +1 -1
  165. package/dist/domain/score/written-pitch.d.ts +33 -0
  166. package/dist/domain/score/written-pitch.d.ts.map +1 -0
  167. package/dist/domain/score/written-pitch.js +110 -0
  168. package/dist/domain/score/written-pitch.js.map +1 -0
  169. package/dist/domain/selection/range-select.d.ts +13 -0
  170. package/dist/domain/selection/range-select.d.ts.map +1 -0
  171. package/dist/domain/selection/range-select.js +40 -0
  172. package/dist/domain/selection/range-select.js.map +1 -0
  173. package/dist/domain/selection/selection-editing.d.ts +30 -0
  174. package/dist/domain/selection/selection-editing.d.ts.map +1 -0
  175. package/dist/domain/selection/selection-editing.js +31 -0
  176. package/dist/domain/selection/selection-editing.js.map +1 -0
  177. package/dist/domain/selection/selection.d.ts +2 -2
  178. package/dist/domain/selection/selection.js +7 -7
  179. package/dist/domain/selection/selection.js.map +1 -1
  180. package/dist/domain/selection/types.d.ts +2 -2
  181. package/dist/domain/selection/types.d.ts.map +1 -1
  182. package/dist/domain/time/duration-modifiers.d.ts +40 -0
  183. package/dist/domain/time/duration-modifiers.d.ts.map +1 -0
  184. package/dist/domain/time/duration-modifiers.js +50 -0
  185. package/dist/domain/time/duration-modifiers.js.map +1 -0
  186. package/dist/domain/time/duration-selection.d.ts +23 -0
  187. package/dist/domain/time/duration-selection.d.ts.map +1 -0
  188. package/dist/domain/time/duration-selection.js +50 -0
  189. package/dist/domain/time/duration-selection.js.map +1 -0
  190. package/dist/domain/time/durations.js +6 -6
  191. package/dist/domain/time/durations.js.map +1 -1
  192. package/dist/domain/time/fraction.d.ts +1 -1
  193. package/dist/domain/time/fraction.js +1 -1
  194. package/dist/domain/time/tap-to-note.d.ts +21 -0
  195. package/dist/domain/time/tap-to-note.d.ts.map +1 -0
  196. package/dist/domain/time/tap-to-note.js +43 -0
  197. package/dist/domain/time/tap-to-note.js.map +1 -0
  198. package/dist/domain/time/tempo-map.d.ts +1 -1
  199. package/dist/domain/time/ticks.d.ts +1 -1
  200. package/dist/domain/time/ticks.d.ts.map +1 -1
  201. package/dist/domain/time/ticks.js +14 -14
  202. package/dist/domain/time/ticks.js.map +1 -1
  203. package/dist/domain/time/tuplets.d.ts +42 -0
  204. package/dist/domain/time/tuplets.d.ts.map +1 -0
  205. package/dist/domain/time/tuplets.js +53 -0
  206. package/dist/domain/time/tuplets.js.map +1 -0
  207. package/dist/domain/validation/issues.d.ts +1 -1
  208. package/dist/domain/validation/issues.js +20 -20
  209. package/dist/domain/validation/validator.d.ts +2 -2
  210. package/dist/domain/validation/validator.d.ts.map +1 -1
  211. package/dist/domain/validation/validator.js +31 -31
  212. package/dist/domain/validation/validator.js.map +1 -1
  213. package/dist/domain/voicing/allocate.d.ts +2 -2
  214. package/dist/domain/voicing/allocate.js +6 -6
  215. package/dist/domain/voicing/allocate.js.map +1 -1
  216. package/dist/index.d.ts +72 -5535
  217. package/dist/index.d.ts.map +1 -1
  218. package/dist/index.js +79 -462
  219. package/dist/index.js.map +1 -1
  220. package/dist/model/api.d.ts +1696 -0
  221. package/dist/model/api.d.ts.map +1 -0
  222. package/dist/model/api.js +125 -0
  223. package/dist/model/api.js.map +1 -0
  224. package/dist/model/generation.d.ts +2178 -0
  225. package/dist/model/generation.d.ts.map +1 -0
  226. package/dist/model/generation.js +142 -0
  227. package/dist/model/generation.js.map +1 -0
  228. package/dist/model/schemas.d.ts +1200 -0
  229. package/dist/model/schemas.d.ts.map +1 -0
  230. package/dist/model/schemas.js +200 -0
  231. package/dist/model/schemas.js.map +1 -0
  232. package/dist/model/score.d.ts +462 -0
  233. package/dist/model/score.d.ts.map +1 -0
  234. package/dist/model/score.js +34 -0
  235. package/dist/model/score.js.map +1 -0
  236. package/dist/platform/audio.d.ts.map +1 -1
  237. package/dist/platform/file.d.ts.map +1 -1
  238. package/dist/platform/index.d.ts +7 -7
  239. package/dist/platform/index.js +7 -7
  240. package/dist/platform/midi-input.d.ts +2 -2
  241. package/dist/platform/midi.d.ts.map +1 -1
  242. package/dist/platform/mod.d.ts +2 -2
  243. package/dist/platform/playback.d.ts +7 -7
  244. package/dist/platform/xml.js +1 -1
  245. package/dist/services/regeneration/controller.d.ts +6 -6
  246. package/dist/services/regeneration/controller.js +12 -12
  247. package/dist/services/regeneration/controller.js.map +1 -1
  248. package/dist/test/fixtures.d.ts +1 -1
  249. package/dist/test/fixtures.js +103 -103
  250. package/dist/test/fixtures.js.map +1 -1
  251. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"note-commands.js","sourceRoot":"","sources":["../../../src/domain/commands/note-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,O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
3
+ * sounds.
4
+ *
5
+ * Pitch, velocity, accidental and voice aside, everything here is notation a
6
+ * reader acts on: articulations, ornaments, the fermata, dynamics and their
7
+ * hairpins, ties and slurs, octave brackets, slides, arpeggios, fingering,
8
+ * lyrics, chord symbols and grace notes.
9
+ *
10
+ * Split from `note-commands.ts`, which had grown past 900 lines as these
11
+ * accumulated. The line between the two files is the one a musician would
12
+ * draw: those commands add, delete, move or resize a note, and these change
13
+ * what is written on one that already exists. `mapNotes` is shared and lives
14
+ * with the former.
15
+ */
16
+ import type { Accidental, Articulation, Dynamic, Hairpin, Lyric, Ornament, Ottava, Pitch, UUID } from "../../index.js";
17
+ import type { ScoreCommand } from "./types.js";
18
+ /** Sets the given notes' pitch to an absolute `Pitch`. */
19
+ export declare function changePitchCommand(eventIds: UUID[], pitch: Pitch, label: string): ScoreCommand;
20
+ /** Sets the given notes' velocity (0-127). */
21
+ export declare function changeVelocityCommand(eventIds: UUID[], velocity: number, label: string): ScoreCommand;
22
+ /** Sets (or clears, when `articulation` is `undefined`) the given notes' articulation. */
23
+ export declare function changeArticulationCommand(eventIds: UUID[], articulation: Articulation | undefined, label: string): ScoreCommand;
24
+ /**
25
+ * Sets (or clears, when `ornament` is `undefined`) the given notes' ornament.
26
+ *
27
+ * Shaped like `changeArticulationCommand` rather than like the fermata toggle,
28
+ * because an ornament is a choice among several rather than an on/off: a menu
29
+ * sets the one it names, and "None" clears. A note carries at most one sign —
30
+ * a trill that is also a turn is not a marking anybody writes.
31
+ */
32
+ export declare function changeOrnamentCommand(eventIds: UUID[], ornament: Ornament | undefined, label: string): ScoreCommand;
33
+ /**
34
+ * Puts a fermata on the given notes, or takes it off the ones that have one.
35
+ *
36
+ * Toggles on the *whole selection together* rather than per note: the state is
37
+ * read from whether every selected note already carries one, so a mixed
38
+ * selection gains fermatas rather than flipping each note independently. A
39
+ * control that did the latter would leave a selection half-marked and look
40
+ * broken.
41
+ *
42
+ * Unlike `toggleSlurCommand` this needs no endpoints and refuses nothing — a
43
+ * fermata is a property of a single note, so one note is a perfectly good
44
+ * selection and each marked note stands alone. Chords are marked note by note
45
+ * because that is what the selection contains; the renderer draws one fermata
46
+ * per notehead position, which is what a chord with a pause looks like.
47
+ */
48
+ export declare function toggleFermataCommand(eventIds: UUID[], label: string): ScoreCommand;
49
+ /**
50
+ * Sets or clears the dynamic marking the given notes start.
51
+ *
52
+ * A dynamic is stored on the note it applies *from* and governs until the next
53
+ * one on that track, so marking one note `f` is how a passage becomes loud —
54
+ * there is nothing to apply to the notes in between, and applying it to each
55
+ * would print a marking under every notehead.
56
+ */
57
+ export declare function changeDynamicCommand(eventIds: UUID[], dynamic: Dynamic | undefined, label: string): ScoreCommand;
58
+ /** Sets the given notes' pitch accidental, keeping their step/octave. */
59
+ export declare function changeAccidentalCommand(eventIds: UUID[], accidental: Accidental, label: string): ScoreCommand;
60
+ /** Toggles `tieStart` or `tieStop` on the given notes. */
61
+ export declare function toggleTieCommand(eventIds: UUID[], which: "tieStart" | "tieStop", label: string): ScoreCommand;
62
+ /**
63
+ * Slurs a selection, or removes the slur it already carries.
64
+ *
65
+ * Takes the whole selection rather than a flag per note, because that is what
66
+ * a slur is: one mark over a run of notes. The caller says "slur these" and
67
+ * this decides which of them is the start and which the stop — marking them
68
+ * individually would let a user create a start with no stop, which draws
69
+ * nothing and is invisible to fix.
70
+ *
71
+ * Endpoints are the earliest and latest note by tick, not the order the ids
72
+ * arrived in: a selection built by shift-clicking around a phrase is still
73
+ * that phrase.
74
+ *
75
+ * Fewer than two notes cannot be slurred — a phrase mark over one note means
76
+ * nothing — and toggling off is offered when the span is already slurred, so
77
+ * the same control removes what it made.
78
+ */
79
+ export declare function toggleSlurCommand(eventIds: UUID[], label: string): ScoreCommand;
80
+ /**
81
+ * Writes a hairpin across the selection, or removes the one it already has.
82
+ *
83
+ * Shaped like `toggleSlurCommand`, because a hairpin is the same kind of thing
84
+ * — one mark over a run of notes. The caller says "crescendo these" and this
85
+ * decides which of them opens it and which closes it; marking them one at a
86
+ * time would let a user create an opening with no close, which draws nothing
87
+ * and is invisible to fix.
88
+ *
89
+ * Endpoints are the earliest and latest note **by tick**, not the order the
90
+ * ids arrived in, so a selection built by shift-clicking around a phrase is
91
+ * still that phrase.
92
+ *
93
+ * Fewer than two notes is refused: a wedge over one note has nowhere to open
94
+ * to. Re-applying the **same** direction to a span that already carries it
95
+ * removes it, so one control undoes what it made; applying the **other**
96
+ * direction flips it, which is what reaching for the other button means.
97
+ */
98
+ export declare function toggleHairpinCommand(eventIds: UUID[], hairpin: Hairpin, label: string): ScoreCommand;
99
+ /**
100
+ * Rolls the selected chords, or stops rolling them.
101
+ *
102
+ * Toggles the whole selection together, like the fermata: the state is read
103
+ * from whether *every* selected note already carries the flag, so a partly
104
+ * marked selection becomes fully marked rather than inverting note by note.
105
+ *
106
+ * The mark belongs to a chord, but the selection is notes — so this simply
107
+ * sets the flag on what was selected and lets the renderer decide. A lone note
108
+ * keeps the flag harmlessly and draws nothing, which is better than refusing:
109
+ * selecting a bar and rolling its chords should not fail because one beat
110
+ * happens to be a single note.
111
+ */
112
+ export declare function toggleArpeggiateCommand(eventIds: UUID[], label: string): ScoreCommand;
113
+ /**
114
+ * Brackets the selection at an octave, or removes the bracket it has.
115
+ *
116
+ * A span like the hairpin: endpoints by tick, two notes minimum, the same
117
+ * displacement twice removes it and a different one replaces it.
118
+ */
119
+ export declare function toggleOttavaCommand(eventIds: UUID[], ottava: Ottava, label: string): ScoreCommand;
120
+ /**
121
+ * Slides between the selected notes, or removes the slide.
122
+ *
123
+ * Two notes exactly is the usual case and two is the minimum: a glissando is
124
+ * a line *between* noteheads, so one note has nothing to slide to. A wider
125
+ * selection slides from its first note to its last, which is what dragging
126
+ * across a run and asking for a slide means.
127
+ */
128
+ export declare function toggleGlissandoCommand(eventIds: UUID[], label: string): ScoreCommand;
129
+ /**
130
+ * Sets or clears the finger written on the given notes.
131
+ *
132
+ * Blank clears it rather than storing an empty string, which would reserve
133
+ * space beside the notehead and print nothing.
134
+ */
135
+ export declare function setFingeringCommand(eventIds: UUID[], fingering: string | undefined, label: string): ScoreCommand;
136
+ /**
137
+ * Sets or clears the syllable sung on one note.
138
+ *
139
+ * One note at a time, unlike the other note commands: every syllable in a line
140
+ * is different, so applying one across a selection could only ever write the
141
+ * same word repeatedly.
142
+ *
143
+ * Blank text clears the lyric rather than storing an empty one — an empty
144
+ * syllable would reserve space under the note and print nothing.
145
+ */
146
+ export declare function setLyricCommand(eventId: UUID, lyric: Lyric | undefined, label: string): ScoreCommand;
147
+ /**
148
+ * Sets or clears the chord symbol printed from a note.
149
+ *
150
+ * One note at a time, like a lyric: every chord in a progression is different,
151
+ * so applying one across a selection could only write the same symbol
152
+ * repeatedly. Blank text clears it rather than storing an empty symbol, which
153
+ * would reserve space above the stave and print nothing.
154
+ */
155
+ export declare function setChordSymbolCommand(eventId: UUID, symbol: string | undefined, label: string): ScoreCommand;
156
+ /**
157
+ * Turns a written note into a grace note on the note that follows it.
158
+ *
159
+ * The note leaves the voice and reappears hanging off its neighbour, and the
160
+ * gap it leaves is filled with a rest — so the bar still adds up, which is the
161
+ * whole reason grace notes are stored on their principal rather than as events
162
+ * of their own.
163
+ *
164
+ * The principal is the next note *in the same voice*, since that is what the
165
+ * ornament leads into. A note with nothing after it cannot become one: an
166
+ * ornament with nothing to ornament would simply vanish from the page.
167
+ */
168
+ export declare function toGraceNoteCommand(eventId: UUID, label: string): ScoreCommand;
169
+ /** Removes every ornament from the given notes. */
170
+ export declare function clearGraceNotesCommand(eventIds: UUID[], label: string): ScoreCommand;
171
+ //# sourceMappingURL=note-marks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"note-marks.d.ts","sourceRoot":"","sources":["../../../src/domain/commands/note-marks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,OAAO,EAEP,OAAO,EACP,KAAK,EAEL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,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AE,EAChB,KAAK,EAAE,MAAM,GACZ,YAAY,CAQd"}
@@ -0,0 +1,427 @@
1
+ import { isNoteEvent } from "../../model/score.js";
2
+ import { findEvent } from "../score/queries.js";
3
+ import { transformCommand } from "./snapshot.js";
4
+ import { withTracks } from "./reflow.js";
5
+ import { mapNotes } from "./note-commands.js";
6
+ // ---- simple per-note field commands ------------------------------------------
7
+ /** Sets the given notes' pitch to an absolute `Pitch`. */
8
+ export function changePitchCommand(eventIds, pitch, label) {
9
+ return transformCommand(label, (score) => mapNotes(score, eventIds, (note) => ({ ...note, pitch })));
10
+ }
11
+ /** Sets the given notes' velocity (0-127). */
12
+ export function changeVelocityCommand(eventIds, velocity, label) {
13
+ return transformCommand(label, (score) => mapNotes(score, eventIds, (note) => ({ ...note, velocity })));
14
+ }
15
+ /** Sets (or clears, when `articulation` is `undefined`) the given notes' articulation. */
16
+ export function changeArticulationCommand(eventIds, articulation, label) {
17
+ return transformCommand(label, (score) => mapNotes(score, eventIds, (note) => {
18
+ if (articulation)
19
+ return { ...note, articulation };
20
+ const updated = { ...note };
21
+ delete updated.articulation;
22
+ return updated;
23
+ }));
24
+ }
25
+ /**
26
+ * Sets (or clears, when `ornament` is `undefined`) the given notes' ornament.
27
+ *
28
+ * Shaped like `changeArticulationCommand` rather than like the fermata toggle,
29
+ * because an ornament is a choice among several rather than an on/off: a menu
30
+ * sets the one it names, and "None" clears. A note carries at most one sign —
31
+ * a trill that is also a turn is not a marking anybody writes.
32
+ */
33
+ export function changeOrnamentCommand(eventIds, ornament, label) {
34
+ return transformCommand(label, (score) => mapNotes(score, eventIds, (note) => {
35
+ if (ornament)
36
+ return { ...note, ornament };
37
+ const updated = { ...note };
38
+ delete updated.ornament;
39
+ return updated;
40
+ }));
41
+ }
42
+ /**
43
+ * Puts a fermata on the given notes, or takes it off the ones that have one.
44
+ *
45
+ * Toggles on the *whole selection together* rather than per note: the state is
46
+ * read from whether every selected note already carries one, so a mixed
47
+ * selection gains fermatas rather than flipping each note independently. A
48
+ * control that did the latter would leave a selection half-marked and look
49
+ * broken.
50
+ *
51
+ * Unlike `toggleSlurCommand` this needs no endpoints and refuses nothing — a
52
+ * fermata is a property of a single note, so one note is a perfectly good
53
+ * selection and each marked note stands alone. Chords are marked note by note
54
+ * because that is what the selection contains; the renderer draws one fermata
55
+ * per notehead position, which is what a chord with a pause looks like.
56
+ */
57
+ export function toggleFermataCommand(eventIds, label) {
58
+ return transformCommand(label, (score) => {
59
+ const notes = eventIds
60
+ .map((id) => findEvent(score, id))
61
+ .filter((event) => event !== null && isNoteEvent(event));
62
+ if (notes.length === 0)
63
+ return score;
64
+ // Only remove when every selected note already has one, so a selection
65
+ // that is partly marked becomes fully marked rather than inverting.
66
+ const allMarked = notes.every((note) => note.fermata);
67
+ return mapNotes(score, eventIds, (note) => {
68
+ if (allMarked) {
69
+ const updated = { ...note };
70
+ delete updated.fermata;
71
+ return updated;
72
+ }
73
+ return { ...note, fermata: true };
74
+ });
75
+ });
76
+ }
77
+ /**
78
+ * Sets or clears the dynamic marking the given notes start.
79
+ *
80
+ * A dynamic is stored on the note it applies *from* and governs until the next
81
+ * one on that track, so marking one note `f` is how a passage becomes loud —
82
+ * there is nothing to apply to the notes in between, and applying it to each
83
+ * would print a marking under every notehead.
84
+ */
85
+ export function changeDynamicCommand(eventIds, dynamic, label) {
86
+ return transformCommand(label, (score) => mapNotes(score, eventIds, (note) => {
87
+ if (dynamic)
88
+ return { ...note, dynamic };
89
+ const updated = { ...note };
90
+ delete updated.dynamic;
91
+ return updated;
92
+ }));
93
+ }
94
+ /** Sets the given notes' pitch accidental, keeping their step/octave. */
95
+ export function changeAccidentalCommand(eventIds, accidental, label) {
96
+ return transformCommand(label, (score) => mapNotes(score, eventIds, (note) => ({
97
+ ...note,
98
+ pitch: { ...note.pitch, accidental },
99
+ })));
100
+ }
101
+ /** Toggles `tieStart` or `tieStop` on the given notes. */
102
+ export function toggleTieCommand(eventIds, which, label) {
103
+ return transformCommand(label, (score) => mapNotes(score, eventIds, (note) => ({ ...note, [which]: !note[which] })));
104
+ }
105
+ /**
106
+ * Slurs a selection, or removes the slur it already carries.
107
+ *
108
+ * Takes the whole selection rather than a flag per note, because that is what
109
+ * a slur is: one mark over a run of notes. The caller says "slur these" and
110
+ * this decides which of them is the start and which the stop — marking them
111
+ * individually would let a user create a start with no stop, which draws
112
+ * nothing and is invisible to fix.
113
+ *
114
+ * Endpoints are the earliest and latest note by tick, not the order the ids
115
+ * arrived in: a selection built by shift-clicking around a phrase is still
116
+ * that phrase.
117
+ *
118
+ * Fewer than two notes cannot be slurred — a phrase mark over one note means
119
+ * nothing — and toggling off is offered when the span is already slurred, so
120
+ * the same control removes what it made.
121
+ */
122
+ export function toggleSlurCommand(eventIds, label) {
123
+ return transformCommand(label, (score) => {
124
+ const notes = eventIds
125
+ .map((id) => findEvent(score, id))
126
+ .filter((event) => event !== null && isNoteEvent(event))
127
+ .sort((a, b) => a.startTick - b.startTick);
128
+ if (notes.length < 2)
129
+ return score;
130
+ const first = notes[0];
131
+ const last = notes[notes.length - 1];
132
+ const alreadySlurred = Boolean(first.slurStart && last.slurStop);
133
+ return mapNotes(score, eventIds, (note) => {
134
+ const updated = { ...note };
135
+ delete updated.slurStart;
136
+ delete updated.slurStop;
137
+ if (alreadySlurred)
138
+ return updated;
139
+ if (note.id === first.id)
140
+ updated.slurStart = true;
141
+ if (note.id === last.id)
142
+ updated.slurStop = true;
143
+ return updated;
144
+ });
145
+ });
146
+ }
147
+ /**
148
+ * Writes a hairpin across the selection, or removes the one it already has.
149
+ *
150
+ * Shaped like `toggleSlurCommand`, because a hairpin is the same kind of thing
151
+ * — one mark over a run of notes. The caller says "crescendo these" and this
152
+ * decides which of them opens it and which closes it; marking them one at a
153
+ * time would let a user create an opening with no close, which draws nothing
154
+ * and is invisible to fix.
155
+ *
156
+ * Endpoints are the earliest and latest note **by tick**, not the order the
157
+ * ids arrived in, so a selection built by shift-clicking around a phrase is
158
+ * still that phrase.
159
+ *
160
+ * Fewer than two notes is refused: a wedge over one note has nowhere to open
161
+ * to. Re-applying the **same** direction to a span that already carries it
162
+ * removes it, so one control undoes what it made; applying the **other**
163
+ * direction flips it, which is what reaching for the other button means.
164
+ */
165
+ export function toggleHairpinCommand(eventIds, hairpin, label) {
166
+ return transformCommand(label, (score) => {
167
+ const notes = eventIds
168
+ .map((id) => findEvent(score, id))
169
+ .filter((event) => event !== null && isNoteEvent(event))
170
+ .sort((a, b) => a.startTick - b.startTick);
171
+ if (notes.length < 2)
172
+ return score;
173
+ const first = notes[0];
174
+ const last = notes[notes.length - 1];
175
+ const sameAlready = first.hairpinStart === hairpin && Boolean(last.hairpinStop);
176
+ return mapNotes(score, eventIds, (note) => {
177
+ const updated = { ...note };
178
+ delete updated.hairpinStart;
179
+ delete updated.hairpinStop;
180
+ if (sameAlready)
181
+ return updated;
182
+ if (note.id === first.id)
183
+ updated.hairpinStart = hairpin;
184
+ if (note.id === last.id)
185
+ updated.hairpinStop = true;
186
+ return updated;
187
+ });
188
+ });
189
+ }
190
+ /**
191
+ * Rolls the selected chords, or stops rolling them.
192
+ *
193
+ * Toggles the whole selection together, like the fermata: the state is read
194
+ * from whether *every* selected note already carries the flag, so a partly
195
+ * marked selection becomes fully marked rather than inverting note by note.
196
+ *
197
+ * The mark belongs to a chord, but the selection is notes — so this simply
198
+ * sets the flag on what was selected and lets the renderer decide. A lone note
199
+ * keeps the flag harmlessly and draws nothing, which is better than refusing:
200
+ * selecting a bar and rolling its chords should not fail because one beat
201
+ * happens to be a single note.
202
+ */
203
+ export function toggleArpeggiateCommand(eventIds, label) {
204
+ return transformCommand(label, (score) => {
205
+ const notes = eventIds
206
+ .map((id) => findEvent(score, id))
207
+ .filter((event) => event !== null && isNoteEvent(event));
208
+ if (notes.length === 0)
209
+ return score;
210
+ const allMarked = notes.every((note) => note.arpeggiate);
211
+ return mapNotes(score, eventIds, (note) => {
212
+ if (allMarked) {
213
+ const updated = { ...note };
214
+ delete updated.arpeggiate;
215
+ return updated;
216
+ }
217
+ return { ...note, arpeggiate: true };
218
+ });
219
+ });
220
+ }
221
+ /**
222
+ * Brackets the selection at an octave, or removes the bracket it has.
223
+ *
224
+ * A span like the hairpin: endpoints by tick, two notes minimum, the same
225
+ * displacement twice removes it and a different one replaces it.
226
+ */
227
+ export function toggleOttavaCommand(eventIds, ottava, label) {
228
+ return transformCommand(label, (score) => {
229
+ const notes = eventIds
230
+ .map((id) => findEvent(score, id))
231
+ .filter((event) => event !== null && isNoteEvent(event))
232
+ .sort((a, b) => a.startTick - b.startTick);
233
+ if (notes.length < 2)
234
+ return score;
235
+ const first = notes[0];
236
+ const last = notes[notes.length - 1];
237
+ const sameAlready = first.ottavaStart === ottava && Boolean(last.ottavaStop);
238
+ return mapNotes(score, eventIds, (note) => {
239
+ const updated = { ...note };
240
+ delete updated.ottavaStart;
241
+ delete updated.ottavaStop;
242
+ if (sameAlready)
243
+ return updated;
244
+ if (note.id === first.id)
245
+ updated.ottavaStart = ottava;
246
+ if (note.id === last.id)
247
+ updated.ottavaStop = true;
248
+ return updated;
249
+ });
250
+ });
251
+ }
252
+ /**
253
+ * Slides between the selected notes, or removes the slide.
254
+ *
255
+ * Two notes exactly is the usual case and two is the minimum: a glissando is
256
+ * a line *between* noteheads, so one note has nothing to slide to. A wider
257
+ * selection slides from its first note to its last, which is what dragging
258
+ * across a run and asking for a slide means.
259
+ */
260
+ export function toggleGlissandoCommand(eventIds, label) {
261
+ return transformCommand(label, (score) => {
262
+ const notes = eventIds
263
+ .map((id) => findEvent(score, id))
264
+ .filter((event) => event !== null && isNoteEvent(event))
265
+ .sort((a, b) => a.startTick - b.startTick);
266
+ if (notes.length < 2)
267
+ return score;
268
+ const first = notes[0];
269
+ const last = notes[notes.length - 1];
270
+ const already = Boolean(first.glissandoStart && last.glissandoStop);
271
+ return mapNotes(score, eventIds, (note) => {
272
+ const updated = { ...note };
273
+ delete updated.glissandoStart;
274
+ delete updated.glissandoStop;
275
+ if (already)
276
+ return updated;
277
+ if (note.id === first.id)
278
+ updated.glissandoStart = true;
279
+ if (note.id === last.id)
280
+ updated.glissandoStop = true;
281
+ return updated;
282
+ });
283
+ });
284
+ }
285
+ /**
286
+ * Sets or clears the finger written on the given notes.
287
+ *
288
+ * Blank clears it rather than storing an empty string, which would reserve
289
+ * space beside the notehead and print nothing.
290
+ */
291
+ export function setFingeringCommand(eventIds, fingering, label) {
292
+ const trimmed = fingering?.trim();
293
+ return transformCommand(label, (score) => mapNotes(score, eventIds, (note) => {
294
+ if (trimmed)
295
+ return { ...note, fingering: trimmed };
296
+ const updated = { ...note };
297
+ delete updated.fingering;
298
+ return updated;
299
+ }));
300
+ }
301
+ /**
302
+ * Sets or clears the syllable sung on one note.
303
+ *
304
+ * One note at a time, unlike the other note commands: every syllable in a line
305
+ * is different, so applying one across a selection could only ever write the
306
+ * same word repeatedly.
307
+ *
308
+ * Blank text clears the lyric rather than storing an empty one — an empty
309
+ * syllable would reserve space under the note and print nothing.
310
+ */
311
+ export function setLyricCommand(eventId, lyric, label) {
312
+ return transformCommand(label, (score) => mapNotes(score, [eventId], (note) => {
313
+ const updated = { ...note };
314
+ if (!lyric || lyric.text.trim() === "") {
315
+ delete updated.lyric;
316
+ return updated;
317
+ }
318
+ updated.lyric = {
319
+ text: lyric.text.trim(),
320
+ // `single` is the default the model states, so storing it would only
321
+ // be noise in every saved score.
322
+ ...(lyric.syllabic && lyric.syllabic !== "single"
323
+ ? { syllabic: lyric.syllabic }
324
+ : {}),
325
+ };
326
+ return updated;
327
+ }));
328
+ }
329
+ /**
330
+ * Sets or clears the chord symbol printed from a note.
331
+ *
332
+ * One note at a time, like a lyric: every chord in a progression is different,
333
+ * so applying one across a selection could only write the same symbol
334
+ * repeatedly. Blank text clears it rather than storing an empty symbol, which
335
+ * would reserve space above the stave and print nothing.
336
+ */
337
+ export function setChordSymbolCommand(eventId, symbol, label) {
338
+ return transformCommand(label, (score) => mapNotes(score, [eventId], (note) => {
339
+ const updated = { ...note };
340
+ const trimmed = symbol?.trim();
341
+ if (!trimmed) {
342
+ delete updated.chordSymbol;
343
+ return updated;
344
+ }
345
+ updated.chordSymbol = trimmed;
346
+ return updated;
347
+ }));
348
+ }
349
+ /**
350
+ * Turns a written note into a grace note on the note that follows it.
351
+ *
352
+ * The note leaves the voice and reappears hanging off its neighbour, and the
353
+ * gap it leaves is filled with a rest — so the bar still adds up, which is the
354
+ * whole reason grace notes are stored on their principal rather than as events
355
+ * of their own.
356
+ *
357
+ * The principal is the next note *in the same voice*, since that is what the
358
+ * ornament leads into. A note with nothing after it cannot become one: an
359
+ * ornament with nothing to ornament would simply vanish from the page.
360
+ */
361
+ export function toGraceNoteCommand(eventId, label) {
362
+ return transformCommand(label, (score) => {
363
+ const tracks = score.tracks.map((track) => ({
364
+ ...track,
365
+ measures: track.measures.map((measure) => ({
366
+ ...measure,
367
+ voices: measure.voices.map((voice) => {
368
+ const index = voice.events.findIndex((e) => e.id === eventId);
369
+ if (index === -1)
370
+ return voice;
371
+ const source = voice.events[index];
372
+ if (!isNoteEvent(source))
373
+ return voice;
374
+ // The principal: the next *note* after it in this voice.
375
+ const principalIndex = voice.events.findIndex((e, i) => i > index && isNoteEvent(e));
376
+ if (principalIndex === -1)
377
+ return voice;
378
+ const principal = voice.events[principalIndex];
379
+ const grace = {
380
+ pitch: source.pitch,
381
+ durationTicks: source.durationTicks,
382
+ slashed: true,
383
+ };
384
+ /*
385
+ Ornaments the source itself carried travel with it, ahead of the
386
+ note it becomes: turning a decorated note into a grace note should
387
+ move the whole ornamental run to the new principal, not silently
388
+ drop everything in front of it.
389
+ */
390
+ const carried = [...(source.graceNotes ?? []), grace];
391
+ return {
392
+ ...voice,
393
+ events: voice.events.map((event, i) => {
394
+ // The time the note occupied stays occupied, by a rest: an
395
+ // ornament borrows from its principal, it does not shorten the
396
+ // bar.
397
+ if (i === index)
398
+ return {
399
+ id: source.id,
400
+ startTick: source.startTick,
401
+ durationTicks: source.durationTicks,
402
+ voiceId: source.voiceId,
403
+ trackId: source.trackId,
404
+ };
405
+ if (i === principalIndex)
406
+ return {
407
+ ...principal,
408
+ graceNotes: [...(principal.graceNotes ?? []), ...carried],
409
+ };
410
+ return event;
411
+ }),
412
+ };
413
+ }),
414
+ })),
415
+ }));
416
+ return withTracks(score, tracks);
417
+ });
418
+ }
419
+ /** Removes every ornament from the given notes. */
420
+ export function clearGraceNotesCommand(eventIds, label) {
421
+ return transformCommand(label, (score) => mapNotes(score, eventIds, (note) => {
422
+ const updated = { ...note };
423
+ delete updated.graceNotes;
424
+ return updated;
425
+ }));
426
+ }
427
+ //# sourceMappingURL=note-marks.js.map