@scorelabs/core 1.0.11 → 1.0.13

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 (50) hide show
  1. package/dist/importers/MusicXMLParser.d.ts +2 -0
  2. package/dist/importers/MusicXMLParser.js +518 -71
  3. package/dist/models/Measure.d.ts +19 -2
  4. package/dist/models/Measure.js +79 -27
  5. package/dist/models/Note.d.ts +35 -5
  6. package/dist/models/Note.js +97 -42
  7. package/dist/models/NoteSet.d.ts +11 -2
  8. package/dist/models/NoteSet.js +33 -2
  9. package/dist/models/Part.d.ts +1 -1
  10. package/dist/models/Part.js +2 -2
  11. package/dist/models/Score.d.ts +5 -5
  12. package/dist/models/Score.js +144 -121
  13. package/dist/models/Staff.d.ts +1 -1
  14. package/dist/models/Staff.js +2 -2
  15. package/dist/types/AccidentalDisplay.d.ts +6 -0
  16. package/dist/types/AccidentalDisplay.js +1 -0
  17. package/dist/types/Arpeggio.d.ts +2 -1
  18. package/dist/types/Arpeggio.js +1 -0
  19. package/dist/types/Articulation.d.ts +3 -1
  20. package/dist/types/Articulation.js +2 -0
  21. package/dist/types/Beam.d.ts +4 -0
  22. package/dist/types/Beam.js +1 -0
  23. package/dist/types/Duration.d.ts +1 -1
  24. package/dist/types/Duration.js +14 -14
  25. package/dist/types/Grace.d.ts +7 -0
  26. package/dist/types/Grace.js +1 -0
  27. package/dist/types/Hairpin.d.ts +2 -1
  28. package/dist/types/Language.d.ts +6 -0
  29. package/dist/types/Language.js +7 -0
  30. package/dist/types/Lyric.d.ts +2 -0
  31. package/dist/types/Ornament.d.ts +23 -1
  32. package/dist/types/Ornament.js +9 -0
  33. package/dist/types/Pedal.d.ts +3 -2
  34. package/dist/types/Placement.d.ts +7 -0
  35. package/dist/types/Placement.js +1 -0
  36. package/dist/types/Repeat.d.ts +1 -0
  37. package/dist/types/RestDisplay.d.ts +6 -0
  38. package/dist/types/RestDisplay.js +1 -0
  39. package/dist/types/Slur.d.ts +1 -0
  40. package/dist/types/Technical.d.ts +20 -0
  41. package/dist/types/Technical.js +5 -0
  42. package/dist/types/Tempo.d.ts +0 -1
  43. package/dist/types/Tie.d.ts +4 -0
  44. package/dist/types/Tie.js +1 -0
  45. package/dist/types/Tuplet.d.ts +6 -0
  46. package/dist/types/User.d.ts +13 -7
  47. package/dist/types/User.js +9 -7
  48. package/dist/types/index.d.ts +8 -0
  49. package/dist/types/index.js +8 -0
  50. package/package.json +2 -1
@@ -1,10 +1,10 @@
1
1
  import { Pitch } from './Pitch.js';
2
2
  import { Accidental, Duration, calculateDurationValue, } from './types.js';
3
- // TODO: replace dotCountOrIsDotted with dotCount: number and use it everywhere. Do not worry about legacy stuff.
4
3
  export class Note {
5
4
  duration;
6
5
  pitch;
7
6
  isRest;
7
+ dotCount;
8
8
  accidental;
9
9
  beamGroup;
10
10
  articulations;
@@ -14,6 +14,7 @@ export class Note {
14
14
  tuplet;
15
15
  hairpin;
16
16
  isGrace;
17
+ isCue;
17
18
  lyric;
18
19
  chord;
19
20
  glissando;
@@ -35,12 +36,24 @@ export class Note {
35
36
  palmMute;
36
37
  hammerOn;
37
38
  pullOff;
39
+ tieSpans;
40
+ slurs;
41
+ beamLevels;
42
+ grace;
43
+ accidentalDisplay;
44
+ restDisplay;
45
+ ornamentDetails;
46
+ harmonic;
47
+ bend;
48
+ vibrato;
49
+ placement;
38
50
  constructor(duration, pitch, // undefined for rests
39
- isRest = false, dotCountOrIsDotted = 0, accidental, beamGroup, // Group ID for beamed notes
40
- articulations = [], dynamic, tie, slur, tuplet, hairpin, isGrace = false, lyric, chord, glissando, arpeggio, ottava, pedal, ornament, fret, string, fretboardDiagram, lyrics, staffText, color, notehead, bowing, fingering, stemDirection, isStringCircled, palmMute, hammerOn, pullOff) {
51
+ isRest = false, dotCount = 0, accidental, beamGroup, // Group ID for beamed notes
52
+ articulations = [], dynamic, tie, slur, tuplet, hairpin, isGrace = false, isCue = false, lyric, chord, glissando, arpeggio, ottava, pedal, ornament, fret, string, fretboardDiagram, lyrics, staffText, color, notehead, bowing, fingering, stemDirection, isStringCircled, palmMute, hammerOn, pullOff, tieSpans = tie ? [{ placement: 'start', number: 1 }] : [], slurs = slur ? [slur] : [], beamLevels, grace, accidentalDisplay, restDisplay, ornamentDetails, harmonic, bend, vibrato, placement) {
41
53
  this.duration = duration;
42
54
  this.pitch = pitch;
43
55
  this.isRest = isRest;
56
+ this.dotCount = dotCount;
44
57
  this.accidental = accidental;
45
58
  this.beamGroup = beamGroup;
46
59
  this.articulations = articulations;
@@ -50,6 +63,7 @@ export class Note {
50
63
  this.tuplet = tuplet;
51
64
  this.hairpin = hairpin;
52
65
  this.isGrace = isGrace;
66
+ this.isCue = isCue;
53
67
  this.lyric = lyric;
54
68
  this.chord = chord;
55
69
  this.glissando = glissando;
@@ -71,10 +85,18 @@ export class Note {
71
85
  this.palmMute = palmMute;
72
86
  this.hammerOn = hammerOn;
73
87
  this.pullOff = pullOff;
74
- this.dotCount =
75
- typeof dotCountOrIsDotted === 'number' ? dotCountOrIsDotted : dotCountOrIsDotted ? 1 : 0;
88
+ this.tieSpans = tieSpans;
89
+ this.slurs = slurs;
90
+ this.beamLevels = beamLevels;
91
+ this.grace = grace;
92
+ this.accidentalDisplay = accidentalDisplay;
93
+ this.restDisplay = restDisplay;
94
+ this.ornamentDetails = ornamentDetails;
95
+ this.harmonic = harmonic;
96
+ this.bend = bend;
97
+ this.vibrato = vibrato;
98
+ this.placement = placement;
76
99
  }
77
- dotCount;
78
100
  get isDotted() {
79
101
  return this.dotCount > 0;
80
102
  }
@@ -121,10 +143,13 @@ export class Note {
121
143
  this.duration === Duration.TwoHundredFiftySixth));
122
144
  }
123
145
  withGrace(isGrace) {
124
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
146
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
147
+ }
148
+ withCue(isCue) {
149
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
125
150
  }
126
151
  withChord(chord) {
127
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
152
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
128
153
  }
129
154
  transpose(semitones) {
130
155
  if (this.isRest || !this.pitch) {
@@ -134,7 +159,7 @@ export class Note {
134
159
  const chromaticIdx = newPitch.midiNumber % 12;
135
160
  const hasSharp = [1, 3, 6, 8, 10].includes(chromaticIdx);
136
161
  const newAccidental = hasSharp ? Accidental.Sharp : undefined;
137
- return new Note(this.duration, newPitch, this.isRest, this.dotCount, newAccidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
162
+ return new Note(this.duration, newPitch, this.isRest, this.dotCount, newAccidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
138
163
  }
139
164
  transposeOctave(octaves) {
140
165
  if (!this.pitch || this.isRest)
@@ -167,97 +192,115 @@ export class Note {
167
192
  return this.withPitch(newPitch).withAccidental(newAccidental);
168
193
  }
169
194
  withPitch(pitch) {
170
- return new Note(this.duration, pitch, false, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
195
+ return new Note(this.duration, pitch, false, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
171
196
  }
172
197
  withArticulation(articulation) {
173
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, articulation ? [articulation] : [], this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
198
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, articulation ? [articulation] : [], this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
174
199
  }
175
200
  withArticulations(articulations) {
176
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
201
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
177
202
  }
178
203
  withDynamic(dynamic) {
179
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
204
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
180
205
  }
181
206
  withTie(tie) {
182
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
207
+ const tieSpans = tie ? [{ placement: 'start', number: 1 }] : [];
208
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
183
209
  }
184
210
  withSlur(slur) {
185
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
211
+ const slurs = slur ? [slur] : [];
212
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, slurs);
186
213
  }
187
214
  withTuplet(tuplet) {
188
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
215
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
189
216
  }
190
217
  withLyric(lyric) {
191
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
218
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
192
219
  }
193
220
  withLyrics(lyrics) {
194
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
221
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
195
222
  }
196
223
  withHairpin(hairpin) {
197
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
224
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
198
225
  }
199
226
  withAccidental(accidental) {
200
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
227
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
228
+ }
229
+ withAccidentalDisplay(accidentalDisplay) {
230
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
201
231
  }
202
- withDuration(duration, dotCountOrIsDotted = 0) {
203
- return new Note(duration, this.pitch, this.isRest, dotCountOrIsDotted, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
232
+ withDuration(duration, dotCount = 0) {
233
+ return new Note(duration, this.pitch, this.isRest, dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
204
234
  }
205
235
  withRest(isRest) {
206
- return new Note(this.duration, this.pitch, isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
236
+ return new Note(this.duration, this.pitch, isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
207
237
  }
208
238
  withFretboardDiagram(diagram) {
209
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, diagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
239
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, diagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
210
240
  }
211
241
  withBeamGroup(beamGroup) {
212
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
242
+ const preservedBeamLevels = beamGroup === this.beamGroup ? this.beamLevels : undefined;
243
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, preservedBeamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
213
244
  }
214
245
  withGlissando(glissando) {
215
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
246
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
216
247
  }
217
248
  withArpeggio(arpeggio) {
218
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
249
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
219
250
  }
220
251
  withOttava(ottava) {
221
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
252
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
222
253
  }
223
254
  withPedal(pedal) {
224
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
255
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
225
256
  }
226
257
  withOrnament(ornament) {
227
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
258
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, ornament ? this.ornamentDetails : undefined, this.harmonic, this.bend, this.vibrato);
259
+ }
260
+ withOrnamentDetails(ornamentDetails) {
261
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, ornamentDetails, this.harmonic, this.bend, this.vibrato);
228
262
  }
229
263
  withTab(fret, string) {
230
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, fret, string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
264
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, fret, string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
231
265
  }
232
266
  withStaffText(text) {
233
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, text, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
267
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, text, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
234
268
  }
235
269
  withColor(color) {
236
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
270
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
237
271
  }
238
272
  withNotehead(notehead) {
239
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
273
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
240
274
  }
241
275
  withBowing(bowing) {
242
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
276
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
243
277
  }
244
278
  withFingering(fingering) {
245
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
279
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
246
280
  }
247
281
  withStemDirection(stemDirection) {
248
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
282
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
249
283
  }
250
284
  withStringCircled(isStringCircled) {
251
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, isStringCircled, this.palmMute, this.hammerOn, this.pullOff);
285
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
252
286
  }
253
287
  withPalmMute(palmMute) {
254
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, palmMute, this.hammerOn, this.pullOff);
288
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
255
289
  }
256
290
  withHammerOn(hammerOn) {
257
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, hammerOn, this.pullOff);
291
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
258
292
  }
259
293
  withPullOff(pullOff) {
260
- return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, pullOff);
294
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, this.vibrato);
295
+ }
296
+ withHarmonic(harmonic) {
297
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, harmonic, this.bend, this.vibrato);
298
+ }
299
+ withBend(bend) {
300
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, bend, this.vibrato);
301
+ }
302
+ withVibrato(vibrato) {
303
+ return new Note(this.duration, this.pitch, this.isRest, this.dotCount, this.accidental, this.beamGroup, this.articulations, this.dynamic, this.tie, this.slur, this.tuplet, this.hairpin, this.isGrace, this.isCue, this.lyric, this.chord, this.glissando, this.arpeggio, this.ottava, this.pedal, this.ornament, this.fret, this.string, this.fretboardDiagram, this.lyrics, this.staffText, this.color, this.notehead, this.bowing, this.fingering, this.stemDirection, this.isStringCircled, this.palmMute, this.hammerOn, this.pullOff, this.tieSpans, this.slurs, this.beamLevels, this.grace, this.accidentalDisplay, this.restDisplay, this.ornamentDetails, this.harmonic, this.bend, vibrato);
261
304
  }
262
305
  toJSON() {
263
306
  return {
@@ -277,13 +320,17 @@ export class Note {
277
320
  dotCount: this.dotCount || undefined,
278
321
  accidental: this.accidental,
279
322
  beamGroup: this.beamGroup,
323
+ beamLevels: this.beamLevels,
280
324
  articulations: this.articulations.length > 0 ? this.articulations : undefined,
281
325
  dynamic: this.dynamic,
282
326
  tie: this.tie,
283
327
  slur: this.slur,
328
+ tieSpans: this.tieSpans.length > 0 ? this.tieSpans : undefined,
329
+ slurs: this.slurs.length > 0 ? this.slurs : undefined,
284
330
  tuplet: this.tuplet,
285
331
  hairpin: this.hairpin,
286
332
  isGrace: this.isGrace || undefined,
333
+ isCue: this.isCue || undefined,
287
334
  lyric: this.lyric,
288
335
  chord: this.chord,
289
336
  glissando: this.glissando,
@@ -305,6 +352,14 @@ export class Note {
305
352
  palmMute: this.palmMute,
306
353
  hammerOn: this.hammerOn,
307
354
  pullOff: this.pullOff,
355
+ grace: this.grace,
356
+ accidentalDisplay: this.accidentalDisplay,
357
+ restDisplay: this.restDisplay,
358
+ ornamentDetails: this.ornamentDetails,
359
+ harmonic: this.harmonic,
360
+ bend: this.bend,
361
+ vibrato: this.vibrato,
362
+ placement: this.placement,
308
363
  // Legacy field (optional)
309
364
  articulation: this.articulations.length > 0 ? this.articulations[0] : undefined,
310
365
  };
@@ -321,6 +376,6 @@ export class Note {
321
376
  else if (data.articulation) {
322
377
  articulations = [data.articulation];
323
378
  }
324
- return new Note(data.duration, pitch, data.isRest ?? false, data.dotCount !== undefined ? data.dotCount : data.isDotted ? 1 : 0, data.accidental, data.beamGroup, articulations, data.dynamic, data.tie, data.slur, data.tuplet, data.hairpin, data.isGrace ?? false, data.lyric, data.chord, data.glissando, data.arpeggio, data.ottava, data.pedal, data.ornament, data.fret, data.string, data.fretboardDiagram, data.lyrics, data.staffText, data.color, data.notehead, data.bowing, data.fingering, data.stemDirection, data.isStringCircled, data.palmMute, data.hammerOn, data.pullOff);
379
+ return new Note(data.duration, pitch, data.isRest ?? false, data.dotCount !== undefined ? data.dotCount : data.isDotted ? 1 : 0, data.accidental, data.beamGroup, articulations, data.dynamic, data.tie, data.slur, data.tuplet, data.hairpin, data.isGrace ?? false, data.isCue ?? false, data.lyric, data.chord, data.glissando, data.arpeggio, data.ottava, data.pedal, data.ornament, data.fret, data.string, data.fretboardDiagram, data.lyrics, data.staffText, data.color, data.notehead, data.bowing, data.fingering, data.stemDirection, data.isStringCircled, data.palmMute, data.hammerOn, data.pullOff, data.tieSpans || [], data.slurs || (data.slur ? [data.slur] : []), data.beamLevels, data.grace, data.accidentalDisplay, data.restDisplay, data.ornamentDetails, data.harmonic, data.bend, data.vibrato, data.placement);
325
380
  }
326
381
  }
@@ -1,6 +1,6 @@
1
1
  import { Note, NoteJSON } from './Note.js';
2
2
  import { Pitch } from './Pitch.js';
3
- import { Accidental, Arpeggio, Articulation, Bowing, Duration, Dynamic, FretboardDiagram, Glissando, Hairpin, Lyric, NoteheadShape, Ornament, Ottava, Pedal, Slur, StemDirection, Tuplet } from './types.js';
3
+ import { Accidental, AccidentalDisplay, Arpeggio, Articulation, BeamLevels, Bowing, Duration, Dynamic, FretboardDiagram, Glissando, GraceNote, Hairpin, Lyric, NoteheadShape, Ornament, Ottava, Pedal, RestDisplay, Slur, StemDirection, TieSpan, Tuplet } from './types.js';
4
4
  export declare class NoteSet {
5
5
  readonly notes: Note[];
6
6
  constructor(notes: Note[]);
@@ -9,10 +9,11 @@ export declare class NoteSet {
9
9
  get dotCount(): number;
10
10
  get isRest(): boolean;
11
11
  get beamGroup(): number | undefined;
12
+ get beamLevels(): BeamLevels | undefined;
12
13
  get tuplet(): Tuplet | undefined;
13
14
  getDurationValue(): number;
14
15
  isBeamable(): boolean;
15
- withDuration(duration: Duration, dotCountOrIsDotted?: number | boolean): NoteSet;
16
+ withDuration(duration: Duration, dotCount?: number): NoteSet;
16
17
  withBeamGroup(group?: number): NoteSet;
17
18
  withNotes(notes: Note[]): NoteSet;
18
19
  withLyrics(lyrics: Lyric[]): NoteSet;
@@ -21,6 +22,8 @@ export declare class NoteSet {
21
22
  withAccidental(accidental?: Accidental): NoteSet;
22
23
  withRest(isRest: boolean): NoteSet;
23
24
  withGrace(isGrace: boolean): NoteSet;
25
+ withCue(isCue: boolean): NoteSet;
26
+ withAccidentalDisplay(accidentalDisplay?: AccidentalDisplay): NoteSet;
24
27
  toggleEnharmonic(): NoteSet;
25
28
  transpose(semitones: number): NoteSet;
26
29
  transposeOctave(octaves: number): NoteSet;
@@ -51,8 +54,14 @@ export declare class NoteSet {
51
54
  withFretboardDiagram(diagram?: FretboardDiagram): NoteSet;
52
55
  get pitch(): Pitch | undefined;
53
56
  get accidental(): Accidental | undefined;
57
+ get accidentalDisplay(): AccidentalDisplay | undefined;
54
58
  get tie(): boolean | undefined;
55
59
  get slur(): Slur | undefined;
60
+ get tieSpans(): TieSpan[];
61
+ get slurs(): Slur[];
62
+ get grace(): GraceNote | undefined;
63
+ get isCue(): boolean;
64
+ get restDisplay(): RestDisplay | undefined;
56
65
  get articulations(): Articulation[] | undefined;
57
66
  get articulation(): Articulation | undefined;
58
67
  get ornament(): Ornament | undefined;
@@ -23,6 +23,9 @@ export class NoteSet {
23
23
  get beamGroup() {
24
24
  return this.notes[0].beamGroup;
25
25
  }
26
+ get beamLevels() {
27
+ return this.notes[0].beamLevels;
28
+ }
26
29
  get tuplet() {
27
30
  return this.notes[0].tuplet;
28
31
  }
@@ -32,8 +35,8 @@ export class NoteSet {
32
35
  isBeamable() {
33
36
  return this.notes[0].isBeamable();
34
37
  }
35
- withDuration(duration, dotCountOrIsDotted = 0) {
36
- return new NoteSet(this.notes.map((n) => n.withDuration(duration, dotCountOrIsDotted)));
38
+ withDuration(duration, dotCount = 0) {
39
+ return new NoteSet(this.notes.map((n) => n.withDuration(duration, dotCount)));
37
40
  }
38
41
  withBeamGroup(group) {
39
42
  return new NoteSet(this.notes.map((n) => n.withBeamGroup(group)));
@@ -81,6 +84,16 @@ export class NoteSet {
81
84
  withGrace(isGrace) {
82
85
  return new NoteSet(this.notes.map((n) => n.withGrace(isGrace)));
83
86
  }
87
+ withCue(isCue) {
88
+ return new NoteSet(this.notes.map((n) => n.withCue(isCue)));
89
+ }
90
+ withAccidentalDisplay(accidentalDisplay) {
91
+ const newNotes = [...this.notes];
92
+ if (newNotes.length > 0) {
93
+ newNotes[0] = newNotes[0].withAccidentalDisplay(accidentalDisplay);
94
+ }
95
+ return new NoteSet(newNotes);
96
+ }
84
97
  toggleEnharmonic() {
85
98
  const newNotes = [...this.notes];
86
99
  if (newNotes.length > 0) {
@@ -175,12 +188,30 @@ export class NoteSet {
175
188
  get accidental() {
176
189
  return this.notes[0].accidental;
177
190
  }
191
+ get accidentalDisplay() {
192
+ return this.notes[0].accidentalDisplay;
193
+ }
178
194
  get tie() {
179
195
  return this.notes[0].tie;
180
196
  }
181
197
  get slur() {
182
198
  return this.notes[0].slur;
183
199
  }
200
+ get tieSpans() {
201
+ return this.notes[0].tieSpans || [];
202
+ }
203
+ get slurs() {
204
+ return this.notes[0].slurs || (this.notes[0].slur ? [this.notes[0].slur] : []);
205
+ }
206
+ get grace() {
207
+ return this.notes[0].grace;
208
+ }
209
+ get isCue() {
210
+ return !!this.notes[0].isCue;
211
+ }
212
+ get restDisplay() {
213
+ return this.notes[0].restDisplay;
214
+ }
184
215
  get articulations() {
185
216
  return this.notes[0].articulations;
186
217
  }
@@ -19,7 +19,7 @@ export declare class Part {
19
19
  replaceNote(staffIndex: number, measureIndex: number, noteIndex: number, newNote: Note, voiceIndex?: number): Part;
20
20
  replaceMeasure(staffIndex: number, measureIndex: number, newMeasure: Measure): Part;
21
21
  deleteNote(staffIndex: number, measureIndex: number, noteIndex: number, voiceIndex?: number): Part;
22
- changeNoteDuration(staffIndex: number, measureIndex: number, noteIndex: number, newDuration: Duration, isDotted?: boolean, voiceIndex?: number): Part;
22
+ changeNoteDuration(staffIndex: number, measureIndex: number, noteIndex: number, newDuration: Duration, dotCount?: number, voiceIndex?: number): Part;
23
23
  toJSON(): PartJSON;
24
24
  withInstrument(instrument: Instrument): Part;
25
25
  replaceStaff(staffIndex: number, newStaff: Staff): Part;
@@ -49,11 +49,11 @@ export class Part {
49
49
  newStaves[staffIndex] = newStaves[staffIndex].deleteNote(measureIndex, noteIndex, voiceIndex);
50
50
  return new Part(this.name, newStaves, this.abbreviation, this.instrument);
51
51
  }
52
- changeNoteDuration(staffIndex, measureIndex, noteIndex, newDuration, isDotted = false, voiceIndex = 0) {
52
+ changeNoteDuration(staffIndex, measureIndex, noteIndex, newDuration, dotCount = 0, voiceIndex = 0) {
53
53
  if (staffIndex < 0 || staffIndex >= this.staves.length)
54
54
  return this;
55
55
  const newStaves = [...this.staves];
56
- newStaves[staffIndex] = newStaves[staffIndex].changeNoteDuration(measureIndex, noteIndex, newDuration, isDotted, voiceIndex);
56
+ newStaves[staffIndex] = newStaves[staffIndex].changeNoteDuration(measureIndex, noteIndex, newDuration, dotCount, voiceIndex);
57
57
  return new Part(this.name, newStaves, this.abbreviation, this.instrument);
58
58
  }
59
59
  toJSON() {
@@ -14,7 +14,6 @@ export declare class Score {
14
14
  readonly parts: Part[];
15
15
  readonly bpm: number;
16
16
  readonly tempoDuration: Duration;
17
- readonly tempoIsDotted: boolean;
18
17
  readonly copyright: string;
19
18
  readonly lyricist: string;
20
19
  readonly swing: boolean;
@@ -22,7 +21,7 @@ export declare class Score {
22
21
  readonly genre: Genre;
23
22
  readonly tempoText: string;
24
23
  readonly tempoDotCount: number;
25
- constructor(title: string, composer: string, timeSignature: TimeSignature, keySignature: KeySignature, parts: Part[], bpm?: number, tempoDuration?: Duration, tempoIsDotted?: boolean, copyright?: string, lyricist?: string, swing?: boolean, subtitle?: string, genre?: Genre, tempoText?: string, tempoDotCount?: number);
24
+ constructor(title: string, composer: string, timeSignature: TimeSignature, keySignature: KeySignature, parts: Part[], bpm?: number, tempoDuration?: Duration, copyright?: string, lyricist?: string, swing?: boolean, subtitle?: string, genre?: Genre, tempoText?: string, tempoDotCount?: number);
26
25
  withTitle(title: string): Score;
27
26
  withComposer(composer: string): Score;
28
27
  withSubtitle(subtitle: string): Score;
@@ -57,10 +56,10 @@ export declare class Score {
57
56
  private reflowStaff;
58
57
  replaceMeasure(partIndex: number, staffIndex: number, measureIndex: number, newMeasure: Measure, autoBeam?: boolean): Score;
59
58
  deleteNote(partIndex: number, staffIndex: number, measureIndex: number, noteIndex: number, voiceIndex?: number): Score;
60
- changeNoteDuration(partIndex: number, staffIndex: number, measureIndex: number, noteIndex: number, newDuration: Duration, isDotted?: boolean, voiceIndex?: number): Score;
59
+ changeNoteDuration(partIndex: number, staffIndex: number, measureIndex: number, noteIndex: number, newDuration: Duration, dotCount?: number, voiceIndex?: number): Score;
61
60
  moveNoteToVoice(partIndex: number, staffIndex: number, measureIndex: number, noteIndex: number, fromVoiceIndex: number, toVoiceIndex: number): Score;
62
61
  pasteNotes(partIndex: number, staffIndex: number, measureIndex: number, noteIndex: number, notesToPaste: NoteSet[]): Score;
63
- withTempo(bpm: number, duration: Duration, isDotted: boolean): Score;
62
+ withTempo(bpm: number, duration: Duration, dotCount?: number): Score;
64
63
  withTempoText(text: string): Score;
65
64
  withSwing(swing: boolean): Score;
66
65
  withLyricist(lyricist: string): Score;
@@ -73,6 +72,7 @@ export declare class Score {
73
72
  replaceStaff(partIndex: number, staffIndex: number, newStaff: Staff): Score;
74
73
  addMeasure(index: number, measure: Measure): Score;
75
74
  deleteMeasure(index: number): Score;
75
+ deleteMeasures(startIndex: number, endIndex: number): Score;
76
76
  getPlaybackSequence(): number[];
77
77
  }
78
78
  export interface ScoreJSON {
@@ -83,8 +83,8 @@ export interface ScoreJSON {
83
83
  parts: PartJSON[];
84
84
  bpm?: number;
85
85
  tempoDuration?: Duration;
86
- tempoIsDotted?: boolean;
87
86
  tempoDotCount?: number;
87
+ tempoIsDotted?: boolean;
88
88
  copyright?: string;
89
89
  lyricist?: string;
90
90
  swing?: boolean;