@tspro/web-music-score 4.0.1 → 4.2.0

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 (34) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +70 -28
  3. package/dist/audio/index.js +1 -1
  4. package/dist/audio/index.mjs +2 -2
  5. package/dist/audio-cg/index.js +1 -1
  6. package/dist/audio-cg/index.mjs +2 -2
  7. package/dist/{chunk-YFPLOHP2.mjs → chunk-5NWLGWHS.mjs} +2 -2
  8. package/dist/chunk-7MNV5JN6.mjs +264 -0
  9. package/dist/core/index.js +2 -2
  10. package/dist/core/index.mjs +3 -3
  11. package/dist/iife/index.global.js +11 -11
  12. package/dist/{music-objects-DJQ4d2OA.d.mts → music-objects-3Hxlkxy6.d.mts} +172 -80
  13. package/dist/{music-objects-Dc3kR-XF.d.ts → music-objects-CI7IjsjE.d.ts} +172 -80
  14. package/dist/pieces/index.d.mts +2 -2
  15. package/dist/pieces/index.d.ts +2 -2
  16. package/dist/pieces/index.js +3 -3
  17. package/dist/pieces/index.mjs +4 -4
  18. package/dist/react-ui/index.d.mts +3 -3
  19. package/dist/react-ui/index.d.ts +3 -3
  20. package/dist/react-ui/index.js +1 -1
  21. package/dist/react-ui/index.mjs +2 -2
  22. package/dist/{scale-B2Icbetz.d.ts → scale-DGx3tJH4.d.ts} +1 -1
  23. package/dist/{scale-BbDJTbrG.d.mts → scale-DQP3b9Zx.d.mts} +1 -1
  24. package/dist/score/index.d.mts +60 -23
  25. package/dist/score/index.d.ts +60 -23
  26. package/dist/score/index.js +910 -349
  27. package/dist/score/index.mjs +630 -320
  28. package/dist/{tempo-Dt8aHpol.d.ts → tempo-GrstpD9G.d.ts} +42 -10
  29. package/dist/{tempo-CtUhvJbr.d.mts → tempo-dkctPkCS.d.mts} +42 -10
  30. package/dist/theory/index.d.mts +3 -3
  31. package/dist/theory/index.d.ts +3 -3
  32. package/dist/theory/index.js +70 -20
  33. package/dist/theory/index.mjs +84 -280
  34. package/package.json +8 -3
@@ -289,8 +289,40 @@ declare class RhythmProps {
289
289
  static equals(a: RhythmProps, b: RhythmProps): boolean;
290
290
  }
291
291
 
292
- /** Time signature string type. */
293
- type TimeSignatureString = "2/4" | "3/4" | "4/4" | "6/8" | "9/8";
292
+ /** Time signature enum. */
293
+ declare enum TimeSignatures {
294
+ /** 2/4 time signature. */
295
+ _2_4 = "2/4",
296
+ /** 3/4 time signature. */
297
+ _3_4 = "3/4",
298
+ /** 4/4 time signature. */
299
+ _4_4 = "4/4",
300
+ /** 3/8 time signature. */
301
+ _3_8 = "3/8",
302
+ /** 5/8 time signature. */
303
+ _5_8 = "5/8",
304
+ /** 6/8 time signature. */
305
+ _6_8 = "6/8",
306
+ /** 7/8 time signature. */
307
+ _7_8 = "7/8",
308
+ /** 9/8 time signature. */
309
+ _9_8 = "9/8",
310
+ /** 12/8 time signature. */
311
+ _12_8 = "12/8"
312
+ }
313
+ /** @deprecated - Use TimeSignatures enum values or just it's string values. */
314
+ type TimeSignatureString = `${TimeSignatures}`;
315
+ /** Beam grouping enum. */
316
+ declare enum BeamGrouping {
317
+ /** 2-3 beam grouping for 5/8 time signature. */
318
+ _2_3 = "2-3",
319
+ /** 3-2 beam grouping for 5/8 time signature. */
320
+ _3_2 = "3-2",
321
+ /** 2-2-3 beam grouping for 7/8 time signature. */
322
+ _2_2_3 = "2-2-3",
323
+ /** 3-2-2 beam grouping for 7/8 time signature. */
324
+ _3_2_2 = "3-2-2"
325
+ }
294
326
  /** Time signature class. */
295
327
  declare class TimeSignature {
296
328
  /** Number of beats in measure, upper value (e.g. "3" in "3/4"). */
@@ -301,21 +333,21 @@ declare class TimeSignature {
301
333
  readonly beatLength: NoteLength;
302
334
  /** Number of ticks in measure. */
303
335
  readonly measureTicks: number;
304
- /** Number of beam groups in measure. */
305
- readonly beamGroupCount: number;
306
- /** Length of one beam group. */
307
- readonly beamGroupLength: number;
336
+ /** Beam groups (e.g. [[2], [2]] or [[2, 2], [2, 2]] (first try as [[4], [4]])). */
337
+ readonly beamGroupSizes: number[][];
308
338
  /**
309
339
  * Create new time signature instance.
310
- * @param str - For example "4/4".
340
+ * @param timeSignature - For example "4/4".
341
+ * @param beamGrouping - Beam grouping (e.g. "3-2" for time signature "5/8").
311
342
  */
312
- constructor(str: TimeSignatureString);
343
+ constructor(timeSignature: TimeSignatures | `${TimeSignatures}`, beamGrouping?: BeamGrouping | `${BeamGrouping}`);
313
344
  /**
314
345
  * Create new time signature instance.
315
346
  * @param beatCount - Measure beat count.
316
347
  * @param beatSize - Size value: whole-note=1, half-note=2, quarter-note=4, etc.
348
+ * @param beamGrouping - Beam grouping (e.g. "3-2" for time signature "5/8").
317
349
  */
318
- constructor(beatCount: number, beatSize: number);
350
+ constructor(beatCount: number, beatSize: number, beamGrouping?: BeamGrouping | `${BeamGrouping}`);
319
351
  /**
320
352
  * Test whether this time signature has given beat count and size.
321
353
  * @param beatCount - Beat count.
@@ -366,4 +398,4 @@ declare function getTempoString(tempo: Tempo): string;
366
398
  */
367
399
  declare function alterTempoSpeed(tempo: Tempo, speed: number): Tempo;
368
400
 
369
- export { AccidentalType as A, KeySignature as K, Mode as M, NoteLength as N, RhythmProps as R, type TimeSignatureString as T, TimeSignature as a, getDefaultTimeSignature as b, type Tempo as c, getDefaultTempo as d, getTempoString as e, alterTempoSpeed as f, getDefaultKeySignature as g, type NoteLengthStr as h, NoteLengthProps as i, type TupletRatio as j, validateTupletRatio as k, Tuplet as l, validateNoteLength as v };
401
+ export { AccidentalType as A, BeamGrouping as B, KeySignature as K, Mode as M, NoteLength as N, RhythmProps as R, TimeSignatures as T, type TimeSignatureString as a, TimeSignature as b, getDefaultTimeSignature as c, type Tempo as d, getDefaultTempo as e, getTempoString as f, getDefaultKeySignature as g, alterTempoSpeed as h, type NoteLengthStr as i, NoteLengthProps as j, type TupletRatio as k, validateTupletRatio as l, Tuplet as m, validateNoteLength as v };
@@ -289,8 +289,40 @@ declare class RhythmProps {
289
289
  static equals(a: RhythmProps, b: RhythmProps): boolean;
290
290
  }
291
291
 
292
- /** Time signature string type. */
293
- type TimeSignatureString = "2/4" | "3/4" | "4/4" | "6/8" | "9/8";
292
+ /** Time signature enum. */
293
+ declare enum TimeSignatures {
294
+ /** 2/4 time signature. */
295
+ _2_4 = "2/4",
296
+ /** 3/4 time signature. */
297
+ _3_4 = "3/4",
298
+ /** 4/4 time signature. */
299
+ _4_4 = "4/4",
300
+ /** 3/8 time signature. */
301
+ _3_8 = "3/8",
302
+ /** 5/8 time signature. */
303
+ _5_8 = "5/8",
304
+ /** 6/8 time signature. */
305
+ _6_8 = "6/8",
306
+ /** 7/8 time signature. */
307
+ _7_8 = "7/8",
308
+ /** 9/8 time signature. */
309
+ _9_8 = "9/8",
310
+ /** 12/8 time signature. */
311
+ _12_8 = "12/8"
312
+ }
313
+ /** @deprecated - Use TimeSignatures enum values or just it's string values. */
314
+ type TimeSignatureString = `${TimeSignatures}`;
315
+ /** Beam grouping enum. */
316
+ declare enum BeamGrouping {
317
+ /** 2-3 beam grouping for 5/8 time signature. */
318
+ _2_3 = "2-3",
319
+ /** 3-2 beam grouping for 5/8 time signature. */
320
+ _3_2 = "3-2",
321
+ /** 2-2-3 beam grouping for 7/8 time signature. */
322
+ _2_2_3 = "2-2-3",
323
+ /** 3-2-2 beam grouping for 7/8 time signature. */
324
+ _3_2_2 = "3-2-2"
325
+ }
294
326
  /** Time signature class. */
295
327
  declare class TimeSignature {
296
328
  /** Number of beats in measure, upper value (e.g. "3" in "3/4"). */
@@ -301,21 +333,21 @@ declare class TimeSignature {
301
333
  readonly beatLength: NoteLength;
302
334
  /** Number of ticks in measure. */
303
335
  readonly measureTicks: number;
304
- /** Number of beam groups in measure. */
305
- readonly beamGroupCount: number;
306
- /** Length of one beam group. */
307
- readonly beamGroupLength: number;
336
+ /** Beam groups (e.g. [[2], [2]] or [[2, 2], [2, 2]] (first try as [[4], [4]])). */
337
+ readonly beamGroupSizes: number[][];
308
338
  /**
309
339
  * Create new time signature instance.
310
- * @param str - For example "4/4".
340
+ * @param timeSignature - For example "4/4".
341
+ * @param beamGrouping - Beam grouping (e.g. "3-2" for time signature "5/8").
311
342
  */
312
- constructor(str: TimeSignatureString);
343
+ constructor(timeSignature: TimeSignatures | `${TimeSignatures}`, beamGrouping?: BeamGrouping | `${BeamGrouping}`);
313
344
  /**
314
345
  * Create new time signature instance.
315
346
  * @param beatCount - Measure beat count.
316
347
  * @param beatSize - Size value: whole-note=1, half-note=2, quarter-note=4, etc.
348
+ * @param beamGrouping - Beam grouping (e.g. "3-2" for time signature "5/8").
317
349
  */
318
- constructor(beatCount: number, beatSize: number);
350
+ constructor(beatCount: number, beatSize: number, beamGrouping?: BeamGrouping | `${BeamGrouping}`);
319
351
  /**
320
352
  * Test whether this time signature has given beat count and size.
321
353
  * @param beatCount - Beat count.
@@ -366,4 +398,4 @@ declare function getTempoString(tempo: Tempo): string;
366
398
  */
367
399
  declare function alterTempoSpeed(tempo: Tempo, speed: number): Tempo;
368
400
 
369
- export { AccidentalType as A, KeySignature as K, Mode as M, NoteLength as N, RhythmProps as R, type TimeSignatureString as T, TimeSignature as a, getDefaultTimeSignature as b, type Tempo as c, getDefaultTempo as d, getTempoString as e, alterTempoSpeed as f, getDefaultKeySignature as g, type NoteLengthStr as h, NoteLengthProps as i, type TupletRatio as j, validateTupletRatio as k, Tuplet as l, validateNoteLength as v };
401
+ export { AccidentalType as A, BeamGrouping as B, KeySignature as K, Mode as M, NoteLength as N, RhythmProps as R, TimeSignatures as T, type TimeSignatureString as a, TimeSignature as b, getDefaultTimeSignature as c, type Tempo as d, getDefaultTempo as e, getTempoString as f, getDefaultKeySignature as g, alterTempoSpeed as h, type NoteLengthStr as i, NoteLengthProps as j, type TupletRatio as k, validateTupletRatio as l, Tuplet as m, validateNoteLength as v };
@@ -1,9 +1,9 @@
1
1
  import { N as Note } from '../note-eA2xPPiG.mjs';
2
2
  export { A as Accidental, d as DefaultGuitarNoteLabel, D as DefaultPitchNotation, G as GuitarNoteLabel, e as GuitarNoteLabelList, a as NoteLetter, P as ParsedNote, b as PitchNotation, c as PitchNotationList, S as SymbolSet, g as getPitchNotationName, f as validateGuitarNoteLabel, v as validatePitchNotation } from '../note-eA2xPPiG.mjs';
3
- import { D as Degree } from '../scale-BbDJTbrG.mjs';
4
- export { b as Interval, I as IntervalDirection, a as IntervalQuality, c as Scale, d as ScaleFactory, S as ScaleType, i as getDefaultScale, h as getScale, e as getScaleFactory, g as getScaleFactoryList, v as validateIntervalQuality, f as validateScaleType } from '../scale-BbDJTbrG.mjs';
3
+ import { D as Degree } from '../scale-DQP3b9Zx.mjs';
4
+ export { b as Interval, I as IntervalDirection, a as IntervalQuality, c as Scale, d as ScaleFactory, S as ScaleType, i as getDefaultScale, h as getScale, e as getScaleFactory, g as getScaleFactoryList, v as validateIntervalQuality, f as validateScaleType } from '../scale-DQP3b9Zx.mjs';
5
5
  export { D as DefaultHandedness, a as DefaultTuningName, H as Handedness, T as TuningNameList, g as getTuningStrings, v as validateHandedness, b as validateTuningName } from '../guitar-DdexKdN6.mjs';
6
- export { A as AccidentalType, K as KeySignature, M as Mode, N as NoteLength, i as NoteLengthProps, h as NoteLengthStr, R as RhythmProps, c as Tempo, a as TimeSignature, T as TimeSignatureString, l as Tuplet, j as TupletRatio, f as alterTempoSpeed, g as getDefaultKeySignature, d as getDefaultTempo, b as getDefaultTimeSignature, e as getTempoString, v as validateNoteLength, k as validateTupletRatio } from '../tempo-CtUhvJbr.mjs';
6
+ export { A as AccidentalType, B as BeamGrouping, K as KeySignature, M as Mode, N as NoteLength, j as NoteLengthProps, i as NoteLengthStr, R as RhythmProps, d as Tempo, b as TimeSignature, a as TimeSignatureString, T as TimeSignatures, m as Tuplet, k as TupletRatio, h as alterTempoSpeed, g as getDefaultKeySignature, e as getDefaultTempo, c as getDefaultTimeSignature, f as getTempoString, v as validateNoteLength, l as validateTupletRatio } from '../tempo-dkctPkCS.mjs';
7
7
 
8
8
  /** Chord info type. */
9
9
  type ChordInfo = {
@@ -1,9 +1,9 @@
1
1
  import { N as Note } from '../note-eA2xPPiG.js';
2
2
  export { A as Accidental, d as DefaultGuitarNoteLabel, D as DefaultPitchNotation, G as GuitarNoteLabel, e as GuitarNoteLabelList, a as NoteLetter, P as ParsedNote, b as PitchNotation, c as PitchNotationList, S as SymbolSet, g as getPitchNotationName, f as validateGuitarNoteLabel, v as validatePitchNotation } from '../note-eA2xPPiG.js';
3
- import { D as Degree } from '../scale-B2Icbetz.js';
4
- export { b as Interval, I as IntervalDirection, a as IntervalQuality, c as Scale, d as ScaleFactory, S as ScaleType, i as getDefaultScale, h as getScale, e as getScaleFactory, g as getScaleFactoryList, v as validateIntervalQuality, f as validateScaleType } from '../scale-B2Icbetz.js';
3
+ import { D as Degree } from '../scale-DGx3tJH4.js';
4
+ export { b as Interval, I as IntervalDirection, a as IntervalQuality, c as Scale, d as ScaleFactory, S as ScaleType, i as getDefaultScale, h as getScale, e as getScaleFactory, g as getScaleFactoryList, v as validateIntervalQuality, f as validateScaleType } from '../scale-DGx3tJH4.js';
5
5
  export { D as DefaultHandedness, a as DefaultTuningName, H as Handedness, T as TuningNameList, g as getTuningStrings, v as validateHandedness, b as validateTuningName } from '../guitar-CaZJDA05.js';
6
- export { A as AccidentalType, K as KeySignature, M as Mode, N as NoteLength, i as NoteLengthProps, h as NoteLengthStr, R as RhythmProps, c as Tempo, a as TimeSignature, T as TimeSignatureString, l as Tuplet, j as TupletRatio, f as alterTempoSpeed, g as getDefaultKeySignature, d as getDefaultTempo, b as getDefaultTimeSignature, e as getTempoString, v as validateNoteLength, k as validateTupletRatio } from '../tempo-Dt8aHpol.js';
6
+ export { A as AccidentalType, B as BeamGrouping, K as KeySignature, M as Mode, N as NoteLength, j as NoteLengthProps, i as NoteLengthStr, R as RhythmProps, d as Tempo, b as TimeSignature, a as TimeSignatureString, T as TimeSignatures, m as Tuplet, k as TupletRatio, h as alterTempoSpeed, g as getDefaultKeySignature, e as getDefaultTempo, c as getDefaultTimeSignature, f as getTempoString, v as validateNoteLength, l as validateTupletRatio } from '../tempo-GrstpD9G.js';
7
7
 
8
8
  /** Chord info type. */
9
9
  type ChordInfo = {
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v4.0.1 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
1
+ /* WebMusicScore v4.2.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -24,6 +24,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
24
24
  var theory_exports = {};
25
25
  __export(theory_exports, {
26
26
  AccidentalType: () => AccidentalType,
27
+ BeamGrouping: () => BeamGrouping,
27
28
  Chord: () => Chord,
28
29
  DefaultGuitarNoteLabel: () => DefaultGuitarNoteLabel,
29
30
  DefaultHandedness: () => DefaultHandedness,
@@ -46,6 +47,7 @@ __export(theory_exports, {
46
47
  ScaleType: () => ScaleType,
47
48
  SymbolSet: () => SymbolSet,
48
49
  TimeSignature: () => TimeSignature,
50
+ TimeSignatures: () => TimeSignatures,
49
51
  TuningNameList: () => TuningNameList,
50
52
  Tuplet: () => Tuplet,
51
53
  alterTempoSpeed: () => alterTempoSpeed,
@@ -2129,6 +2131,25 @@ var RhythmProps = _RhythmProps;
2129
2131
 
2130
2132
  // src/theory/time-signature.ts
2131
2133
  var import_core9 = require("@tspro/web-music-score/core");
2134
+ var TimeSignatures = /* @__PURE__ */ ((TimeSignatures2) => {
2135
+ TimeSignatures2["_2_4"] = "2/4";
2136
+ TimeSignatures2["_3_4"] = "3/4";
2137
+ TimeSignatures2["_4_4"] = "4/4";
2138
+ TimeSignatures2["_3_8"] = "3/8";
2139
+ TimeSignatures2["_5_8"] = "5/8";
2140
+ TimeSignatures2["_6_8"] = "6/8";
2141
+ TimeSignatures2["_7_8"] = "7/8";
2142
+ TimeSignatures2["_9_8"] = "9/8";
2143
+ TimeSignatures2["_12_8"] = "12/8";
2144
+ return TimeSignatures2;
2145
+ })(TimeSignatures || {});
2146
+ var BeamGrouping = /* @__PURE__ */ ((BeamGrouping2) => {
2147
+ BeamGrouping2["_2_3"] = "2-3";
2148
+ BeamGrouping2["_3_2"] = "3-2";
2149
+ BeamGrouping2["_2_2_3"] = "2-2-3";
2150
+ BeamGrouping2["_3_2_2"] = "3-2-2";
2151
+ return BeamGrouping2;
2152
+ })(BeamGrouping || {});
2132
2153
  var TimeSignature = class {
2133
2154
  constructor(...args) {
2134
2155
  /** Number of beats in measure, upper value (e.g. "3" in "3/4"). */
@@ -2139,17 +2160,22 @@ var TimeSignature = class {
2139
2160
  __publicField(this, "beatLength");
2140
2161
  /** Number of ticks in measure. */
2141
2162
  __publicField(this, "measureTicks");
2142
- /** Number of beam groups in measure. */
2143
- __publicField(this, "beamGroupCount");
2144
- /** Length of one beam group. */
2145
- __publicField(this, "beamGroupLength");
2146
- if (args.length === 1 && typeof args[0] === "string") {
2163
+ /** Beam groups (e.g. [[2], [2]] or [[2, 2], [2, 2]] (first try as [[4], [4]])). */
2164
+ __publicField(this, "beamGroupSizes", []);
2165
+ let beamGrouping;
2166
+ if (import_ts_utils_lib9.Utils.Is.isEnumValue(args[0], TimeSignatures)) {
2147
2167
  let parts = args[0].split("/");
2148
2168
  this.beatCount = +parts[0];
2149
2169
  this.beatSize = +parts[1];
2150
- } else if (args.length === 2 && typeof args[0] === "number" && typeof args[1] === "number") {
2170
+ if (import_ts_utils_lib9.Utils.Is.isEnumValue(args[1], BeamGrouping)) {
2171
+ beamGrouping = args[1];
2172
+ }
2173
+ } else if (import_ts_utils_lib9.Utils.Is.isIntegerGte(args[0], 2) && import_ts_utils_lib9.Utils.Is.isIntegerGte(args[1], 2)) {
2151
2174
  this.beatCount = args[0];
2152
2175
  this.beatSize = args[1];
2176
+ if (import_ts_utils_lib9.Utils.Is.isEnumValue(args[2], BeamGrouping)) {
2177
+ beamGrouping = args[2];
2178
+ }
2153
2179
  } else {
2154
2180
  throw new import_core9.MusicError(import_core9.MusicErrorType.Timesignature, `Invalid args: ${args}`);
2155
2181
  }
@@ -2158,20 +2184,42 @@ var TimeSignature = class {
2158
2184
  } else if (!import_ts_utils_lib9.Utils.Is.isIntegerGte(this.beatSize, 1)) {
2159
2185
  throw new import_core9.MusicError(import_core9.MusicErrorType.Timesignature, `Invalid beatSize: ${this.beatSize}`);
2160
2186
  }
2161
- let props = NoteLengthProps.create(this.beatSize);
2162
- this.beatLength = props.noteLength;
2163
- this.measureTicks = this.beatCount * props.ticks;
2164
- if (this.is(2, 4) || this.is(3, 4) || this.is(4, 4)) {
2165
- this.beamGroupCount = this.beatCount;
2166
- } else if (this.is(6, 8) || this.is(9, 8)) {
2167
- this.beamGroupCount = this.beatCount / 3;
2168
- } else {
2169
- console.warn("Not necessarily an error, but unsupported time signature: " + this.toString());
2170
- this.beamGroupCount = 1;
2187
+ let { noteLength, ticks } = NoteLengthProps.create(this.beatSize);
2188
+ this.beatLength = noteLength;
2189
+ this.measureTicks = this.beatCount * ticks;
2190
+ if (this.is(2, 4)) {
2191
+ this.beamGroupSizes = [[2], [2]];
2192
+ } else if (this.is(3, 4)) {
2193
+ this.beamGroupSizes = [[2], [2], [2]];
2194
+ } else if (this.is(4, 4)) {
2195
+ this.beamGroupSizes = [[2, 2], [2, 2]];
2196
+ } else if (this.is(3, 8)) {
2197
+ this.beamGroupSizes = [[3]];
2198
+ } else if (this.is(5, 8)) {
2199
+ if (!import_ts_utils_lib9.Utils.Is.isUndefined(beamGrouping) && beamGrouping !== "2-3" /* _2_3 */ && beamGrouping !== "3-2" /* _3_2 */) {
2200
+ throw new import_core9.MusicError(import_core9.MusicErrorType.Timesignature, `Invalid beam grouping "${beamGrouping}" for time signature "${this.toString()}".`);
2201
+ } else {
2202
+ this.beamGroupSizes = beamGrouping === "3-2" /* _3_2 */ ? [[3], [2]] : [[2], [3]];
2203
+ beamGrouping = void 0;
2204
+ }
2205
+ } else if (this.is(6, 8)) {
2206
+ this.beamGroupSizes = [[3], [3]];
2207
+ } else if (this.is(7, 8)) {
2208
+ if (!import_ts_utils_lib9.Utils.Is.isUndefined(beamGrouping) && beamGrouping !== "2-2-3" /* _2_2_3 */ && beamGrouping !== "3-2-2" /* _3_2_2 */) {
2209
+ throw new import_core9.MusicError(import_core9.MusicErrorType.Timesignature, `Invalid beam grouping "${beamGrouping}" for time signature "${this.toString()}".`);
2210
+ } else {
2211
+ this.beamGroupSizes = beamGrouping === "3-2-2" /* _3_2_2 */ ? [[3], [2], [2]] : [[2], [2], [3]];
2212
+ beamGrouping = void 0;
2213
+ }
2214
+ } else if (this.is(9, 8)) {
2215
+ this.beamGroupSizes = [[3], [3], [3]];
2216
+ } else if (this.is(12, 8)) {
2217
+ this.beamGroupSizes = [[3], [3], [3], [3]];
2171
2218
  }
2172
- this.beamGroupLength = this.measureTicks / this.beamGroupCount;
2173
- if (!import_ts_utils_lib9.Utils.Is.isIntegerGte(this.beamGroupLength, 1)) {
2174
- throw new import_core9.MusicError(import_core9.MusicErrorType.Timesignature, `Invalid beamGroupLength: ${this.beamGroupLength}`);
2219
+ if (this.beamGroupSizes.length === 0) {
2220
+ throw new import_core9.MusicError(import_core9.MusicErrorType.Timesignature, `Unimplemented time signature "${this.toString()}".`);
2221
+ } else if (beamGrouping !== void 0) {
2222
+ throw new import_core9.MusicError(import_core9.MusicErrorType.Timesignature, `Invalid beam grouping "${beamGrouping}" for time signature "${this.toString()}".`);
2175
2223
  }
2176
2224
  }
2177
2225
  /**
@@ -2223,6 +2271,7 @@ var import_core10 = require("@tspro/web-music-score/core");
2223
2271
  // Annotate the CommonJS export names for ESM import in node:
2224
2272
  0 && (module.exports = {
2225
2273
  AccidentalType,
2274
+ BeamGrouping,
2226
2275
  Chord,
2227
2276
  DefaultGuitarNoteLabel,
2228
2277
  DefaultHandedness,
@@ -2245,6 +2294,7 @@ var import_core10 = require("@tspro/web-music-score/core");
2245
2294
  ScaleType,
2246
2295
  SymbolSet,
2247
2296
  TimeSignature,
2297
+ TimeSignatures,
2248
2298
  TuningNameList,
2249
2299
  Tuplet,
2250
2300
  alterTempoSpeed,