web-music-score 6.0.0 → 6.0.1

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 (35) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/audio/index.d.ts +1 -1
  3. package/dist/audio/index.js +1 -1
  4. package/dist/audio/index.mjs +4 -4
  5. package/dist/audio-cg/index.js +1 -1
  6. package/dist/audio-cg/index.mjs +4 -4
  7. package/dist/audio-synth/index.js +1 -1
  8. package/dist/audio-synth/index.mjs +4 -4
  9. package/dist/{chunk-7N2CWRTL.mjs → chunk-EDHJ4ZRB.mjs} +3 -3
  10. package/dist/{chunk-422QLXBR.mjs → chunk-IUXO5M6R.mjs} +3 -3
  11. package/dist/{chunk-YSFFUB4F.mjs → chunk-IW4YD7XE.mjs} +2 -2
  12. package/dist/{chunk-EYZOBMDN.mjs → chunk-OHH32J6I.mjs} +3 -3
  13. package/dist/{chunk-ZAPOJP2K.mjs → chunk-OM25LPIN.mjs} +2 -2
  14. package/dist/{chunk-JOXUFYNU.mjs → chunk-VTNNVMRE.mjs} +4 -4
  15. package/dist/core/index.js +2 -2
  16. package/dist/core/index.mjs +5 -5
  17. package/dist/iife/audio-cg.js +1 -1
  18. package/dist/iife/index.js +8 -8
  19. package/dist/{music-objects-CHp-dh_J.d.ts → music-objects-Bef-fs1f.d.ts} +5 -3
  20. package/dist/{note-CJuq5aBy.d.ts → note-RVXvpfyV.d.ts} +1 -1
  21. package/dist/pieces/index.d.ts +3 -3
  22. package/dist/pieces/index.js +1 -1
  23. package/dist/pieces/index.mjs +2 -2
  24. package/dist/react-ui/index.d.ts +3 -3
  25. package/dist/react-ui/index.js +1 -1
  26. package/dist/react-ui/index.mjs +2 -2
  27. package/dist/{scale-DxGqFxlv.d.ts → scale-B1M10_fu.d.ts} +2 -2
  28. package/dist/score/index.d.ts +5 -5
  29. package/dist/score/index.js +52 -19
  30. package/dist/score/index.mjs +56 -23
  31. package/dist/{tempo-pCAa6qgo.d.ts → tempo-D-JF-8b_.d.ts} +1 -1
  32. package/dist/theory/index.d.ts +5 -5
  33. package/dist/theory/index.js +1 -1
  34. package/dist/theory/index.mjs +4 -4
  35. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { N as Note, A as Accidental } from './note-CJuq5aBy.js';
2
- import { R as RhythmProps, N as NoteLength, h as NoteLengthStr, k as TupletRatio, c as Tempo, K as KeySignature, a as TimeSignature } from './tempo-pCAa6qgo.js';
1
+ import { N as Note, A as Accidental } from './note-RVXvpfyV.js';
2
+ import { R as RhythmProps, N as NoteLength, h as NoteLengthStr, k as TupletRatio, c as Tempo, K as KeySignature, a as TimeSignature } from './tempo-D-JF-8b_.js';
3
3
  import { AnchoredRect, UniMap, Rect, Vec } from '@tspro/ts-utils-lib';
4
4
 
5
5
  /** Staff preset values for score configuration. */
@@ -657,7 +657,7 @@ declare class ObjBeamGroup extends MusicObject {
657
657
  private get color();
658
658
  layout(ctx: RenderContext): void;
659
659
  updateRect(): void;
660
- updateStemTips(): void;
660
+ updateNoteStemTips(): void;
661
661
  offset(dx: number, dy: number): void;
662
662
  draw(ctx: RenderContext): void;
663
663
  private setBeamCounts;
@@ -697,6 +697,8 @@ declare class ObjRest extends MusicObject {
697
697
  get measure(): ObjMeasure;
698
698
  get row(): ObjScoreRow;
699
699
  get noteLength(): NoteLength;
700
+ private getDiatonicIdFromStaffPos;
701
+ getDiatonicIdOnLine(diatonicId: number): number;
700
702
  getDiatonicId(staff?: ObjStaff): number;
701
703
  get stemDir(): Stem.Up | Stem.Down;
702
704
  updateRunningArguments(diatonicId: number, stemDir: Stem.Up | Stem.Down, stringNumbers: StringNumber[]): void;
@@ -300,7 +300,7 @@ declare class Note {
300
300
  * @param b - Note b.
301
301
  * @returns - -1, 0 or 1.
302
302
  */
303
- static compareFunc(a: Note, b: Note): 1 | -1 | 0;
303
+ static compareFunc(a: Note, b: Note): 1 | 0 | -1;
304
304
  }
305
305
 
306
306
  export { type Accidental as A, DefaultPitchNotation as D, GuitarNoteLabel as G, Note as N, type ParsedNote as P, SymbolSet as S, type NoteLetter as a, PitchNotation as b, PitchNotationList as c, DefaultGuitarNoteLabel as d, GuitarNoteLabelList as e, validateGuitarNoteLabel as f, getPitchNotationName as g, validatePitchNotation as v };
@@ -1,6 +1,6 @@
1
- import { M as MDocument } from '../music-objects-CHp-dh_J.js';
2
- import '../note-CJuq5aBy.js';
3
- import '../tempo-pCAa6qgo.js';
1
+ import { M as MDocument } from '../music-objects-Bef-fs1f.js';
2
+ import '../note-RVXvpfyV.js';
3
+ import '../tempo-D-JF-8b_.js';
4
4
  import '@tspro/ts-utils-lib';
5
5
 
6
6
  /**
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v6.0.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
1
+ /* WebMusicScore v6.0.1 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,5 +1,5 @@
1
- /* WebMusicScore v6.0.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
- import "../chunk-ZAPOJP2K.mjs";
1
+ /* WebMusicScore v6.0.1 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
+ import "../chunk-OM25LPIN.mjs";
3
3
 
4
4
  // src/pieces/andante-diabelli.ts
5
5
  import { DocumentBuilder } from "web-music-score/score";
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import { M as MDocument, a8 as Paint, o as ScoreEventListener, r as MPlaybackButtons } from '../music-objects-CHp-dh_J.js';
4
- import '../note-CJuq5aBy.js';
5
- import '../tempo-pCAa6qgo.js';
3
+ import { M as MDocument, a8 as Paint, o as ScoreEventListener, r as MPlaybackButtons } from '../music-objects-Bef-fs1f.js';
4
+ import '../note-RVXvpfyV.js';
5
+ import '../tempo-D-JF-8b_.js';
6
6
  import '@tspro/ts-utils-lib';
7
7
 
8
8
  interface MusicScoreViewProps {
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v6.0.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
1
+ /* WebMusicScore v6.0.1 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
2
  "use strict";
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
@@ -1,7 +1,7 @@
1
- /* WebMusicScore v6.0.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
1
+ /* WebMusicScore v6.0.1 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
2
  import {
3
3
  __publicField
4
- } from "../chunk-ZAPOJP2K.mjs";
4
+ } from "../chunk-OM25LPIN.mjs";
5
5
 
6
6
  // src/react-ui/music-score-view.tsx
7
7
  import * as React from "react";
@@ -1,5 +1,5 @@
1
- import { N as Note, S as SymbolSet } from './note-CJuq5aBy.js';
2
- import { K as KeySignature } from './tempo-pCAa6qgo.js';
1
+ import { N as Note, S as SymbolSet } from './note-RVXvpfyV.js';
2
+ import { K as KeySignature } from './tempo-D-JF-8b_.js';
3
3
 
4
4
  /** Interval direction type. */
5
5
  type IntervalDirection = "Unison" | "Ascending" | "Descending";
@@ -1,8 +1,8 @@
1
- import { N as NoteOptions, R as RestOptions, S as StaffPreset, a as ScoreConfiguration, M as MDocument, b as MeasureOptions, V as VoiceId, T as TupletOptions, c as VerseNumber, L as LyricsOptions, d as StaffTabOrGroups, F as Fermata, e as Navigation, A as AnnotationText, f as Annotation, g as Label, C as Connective, h as TieType, i as NoteAnchor, j as VerticalPosition } from '../music-objects-CHp-dh_J.js';
2
- export { ao as Arpeggio, aa as BaseConfig, a9 as Clef, a5 as ColorKey, a7 as ColorKeyPart, as as DynamicsAnnotation, aq as LyricsAlign, ar as LyricsHyphen, t as MAccidental, v as MArpeggio, H as MBarLineLeft, G as MBarLineRight, w as MBeamGroup, u as MConnective, y as MEnding, a4 as MExtensionLine, z as MFermata, B as MHeader, D as MImage, a3 as MLyrics, E as MMeasure, J as MNoteGroup, r as MPlaybackButtons, p as MPlayer, q as MRenderContext, P as MRest, U as MRhythmColumn, W as MScoreRow, X as MScoreRowGroup, a1 as MSpecialText, Y as MStaff, I as MStaffBarLine, x as MStaffBeamGroup, K as MStaffNoteGroup, Q as MStaffRest, _ as MStaffSignature, Z as MTab, O as MTabNoteGroup, a0 as MTabRhythm, $ as MTabSignature, a2 as MText, s as MusicInterface, a8 as Paint, au as PlayState, av as PlayStateChangeListener, l as ScoreEvent, o as ScoreEventListener, k as ScoreEventType, n as ScoreObjectEvent, m as ScoreStaffPosEvent, ab as StaffConfig, ap as StaffTabOrGroup, an as Stem, ag as StringNumber, ac as TabConfig, at as TempoAnnotation, a6 as colorKey, ah as getStringNumbers, ak as getVerseNumbers, ad as getVoiceIds, ai as isStringNumber, al as isVerseNumber, ae as isVoiceId, aj as validateStringNumber, am as validateVerseNumber, af as validateVoiceId } from '../music-objects-CHp-dh_J.js';
3
- import { N as Note } from '../note-CJuq5aBy.js';
4
- import { S as ScaleType, c as Scale } from '../scale-DxGqFxlv.js';
5
- import { N as NoteLength, h as NoteLengthStr, K as KeySignature, a as TimeSignature, T as TimeSignatures, B as BeamGrouping, k as TupletRatio } from '../tempo-pCAa6qgo.js';
1
+ import { N as NoteOptions, R as RestOptions, S as StaffPreset, a as ScoreConfiguration, M as MDocument, b as MeasureOptions, V as VoiceId, T as TupletOptions, c as VerseNumber, L as LyricsOptions, d as StaffTabOrGroups, F as Fermata, e as Navigation, A as AnnotationText, f as Annotation, g as Label, C as Connective, h as TieType, i as NoteAnchor, j as VerticalPosition } from '../music-objects-Bef-fs1f.js';
2
+ export { ao as Arpeggio, aa as BaseConfig, a9 as Clef, a5 as ColorKey, a7 as ColorKeyPart, as as DynamicsAnnotation, aq as LyricsAlign, ar as LyricsHyphen, t as MAccidental, v as MArpeggio, H as MBarLineLeft, G as MBarLineRight, w as MBeamGroup, u as MConnective, y as MEnding, a4 as MExtensionLine, z as MFermata, B as MHeader, D as MImage, a3 as MLyrics, E as MMeasure, J as MNoteGroup, r as MPlaybackButtons, p as MPlayer, q as MRenderContext, P as MRest, U as MRhythmColumn, W as MScoreRow, X as MScoreRowGroup, a1 as MSpecialText, Y as MStaff, I as MStaffBarLine, x as MStaffBeamGroup, K as MStaffNoteGroup, Q as MStaffRest, _ as MStaffSignature, Z as MTab, O as MTabNoteGroup, a0 as MTabRhythm, $ as MTabSignature, a2 as MText, s as MusicInterface, a8 as Paint, au as PlayState, av as PlayStateChangeListener, l as ScoreEvent, o as ScoreEventListener, k as ScoreEventType, n as ScoreObjectEvent, m as ScoreStaffPosEvent, ab as StaffConfig, ap as StaffTabOrGroup, an as Stem, ag as StringNumber, ac as TabConfig, at as TempoAnnotation, a6 as colorKey, ah as getStringNumbers, ak as getVerseNumbers, ad as getVoiceIds, ai as isStringNumber, al as isVerseNumber, ae as isVoiceId, aj as validateStringNumber, am as validateVerseNumber, af as validateVoiceId } from '../music-objects-Bef-fs1f.js';
3
+ import { N as Note } from '../note-RVXvpfyV.js';
4
+ import { S as ScaleType, c as Scale } from '../scale-B1M10_fu.js';
5
+ import { N as NoteLength, h as NoteLengthStr, K as KeySignature, a as TimeSignature, T as TimeSignatures, B as BeamGrouping, k as TupletRatio } from '../tempo-D-JF-8b_.js';
6
6
  import '@tspro/ts-utils-lib';
7
7
 
8
8
  /** Tuplet builder type. */
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v6.0.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
1
+ /* WebMusicScore v6.0.1 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
2
  "use strict";
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
@@ -5619,17 +5619,6 @@ var ObjArpeggio = class extends MusicObject {
5619
5619
  // src/score/engine/obj-rest.ts
5620
5620
  var import_theory3 = require("web-music-score/theory");
5621
5621
  var import_core4 = require("web-music-score/core");
5622
- function getDiatonicIdFromStaffPos(staffPos) {
5623
- if (typeof staffPos === "number") {
5624
- return import_theory3.Note.getChromaticNote(staffPos).diatonicId;
5625
- } else if (typeof staffPos === "string") {
5626
- return import_theory3.Note.getNote(staffPos).diatonicId;
5627
- } else if (staffPos instanceof import_theory3.Note) {
5628
- return staffPos.diatonicId;
5629
- } else {
5630
- return void 0;
5631
- }
5632
- }
5633
5622
  var ObjStaffRest = class extends MusicObject {
5634
5623
  constructor(staff, rest) {
5635
5624
  super(staff);
@@ -5676,11 +5665,8 @@ var _ObjRest = class _ObjRest extends MusicObject {
5676
5665
  __publicField(this, "beamGroup");
5677
5666
  __publicField(this, "staffObjects", []);
5678
5667
  __publicField(this, "mi");
5679
- this.setDiatonicId = (_b = getDiatonicIdFromStaffPos((_a = this.options) == null ? void 0 : _a.staffPos)) != null ? _b : _ObjRest.UndefinedDiatonicId;
5680
- let staves = this.row.getStaves().filter((staff) => staff.containsVoiceId(this.voiceId));
5681
- if (this.setDiatonicId !== _ObjRest.UndefinedDiatonicId && staves.length > 0 && staves[0].isSpace(this.setDiatonicId)) {
5682
- this.setDiatonicId += this.setDiatonicId >= staves[0].middleLineDiatonicId ? 1 : -1;
5683
- }
5668
+ this.setDiatonicId = (_b = this.getDiatonicIdFromStaffPos((_a = this.options) == null ? void 0 : _a.staffPos)) != null ? _b : _ObjRest.UndefinedDiatonicId;
5669
+ this.setDiatonicId = this.getDiatonicIdOnLine(this.setDiatonicId);
5684
5670
  this.runningDiatonicId = this.setDiatonicId;
5685
5671
  this.runningStemDir = "up" /* Up */;
5686
5672
  this.color = (_c = options == null ? void 0 : options.color) != null ? _c : colorKey("staff.rest");
@@ -5704,6 +5690,25 @@ var _ObjRest = class _ObjRest extends MusicObject {
5704
5690
  get noteLength() {
5705
5691
  return this.rhythmProps.noteLength;
5706
5692
  }
5693
+ getDiatonicIdFromStaffPos(staffPos) {
5694
+ if (typeof staffPos === "number") {
5695
+ return import_theory3.Note.getChromaticNote(staffPos).diatonicId;
5696
+ } else if (typeof staffPos === "string") {
5697
+ return import_theory3.Note.getNote(staffPos).diatonicId;
5698
+ } else if (staffPos instanceof import_theory3.Note) {
5699
+ return staffPos.diatonicId;
5700
+ } else {
5701
+ return void 0;
5702
+ }
5703
+ }
5704
+ getDiatonicIdOnLine(diatonicId) {
5705
+ let staves = this.row.getStaves().filter((staff) => staff.containsVoiceId(this.voiceId));
5706
+ if (diatonicId !== _ObjRest.UndefinedDiatonicId && staves.length > 0 && staves[0].isSpace(diatonicId)) {
5707
+ return diatonicId += diatonicId >= staves[0].middleLineDiatonicId ? 1 : -1;
5708
+ } else {
5709
+ return diatonicId;
5710
+ }
5711
+ }
5707
5712
  getDiatonicId(staff) {
5708
5713
  if (this.runningDiatonicId === _ObjRest.UndefinedDiatonicId) {
5709
5714
  if (staff) {
@@ -8164,7 +8169,7 @@ var ObjBeamGroup = class _ObjBeamGroup extends MusicObject {
8164
8169
  }
8165
8170
  }
8166
8171
  }
8167
- updateStemTips() {
8172
+ updateNoteStemTips() {
8168
8173
  this.staffObjects.forEach((obj) => {
8169
8174
  let left = obj.points[0];
8170
8175
  let right = obj.points[obj.points.length - 1];
@@ -10076,6 +10081,34 @@ var ObjMeasure = class extends MusicObject {
10076
10081
  this.signatures.push(signature);
10077
10082
  }
10078
10083
  });
10084
+ getVoiceIds().forEach((voiceId) => {
10085
+ const staff = this.row.getStaves()[0];
10086
+ if (!staff || !staff.containsVoiceId(voiceId))
10087
+ return;
10088
+ this.beamGroups.forEach((b) => {
10089
+ const symbols = b.getSymbols();
10090
+ symbols.forEach((sym, restId) => {
10091
+ if (!(sym instanceof ObjRest && sym.setDiatonicId === ObjRest.UndefinedDiatonicId))
10092
+ return;
10093
+ let leftNoteId = restId;
10094
+ let rightNoteId = restId;
10095
+ while (symbols[leftNoteId] instanceof ObjRest) leftNoteId--;
10096
+ while (symbols[rightNoteId] instanceof ObjRest) rightNoteId++;
10097
+ let newRestDiatonicId;
10098
+ if (leftNoteId < 0 && rightNoteId <= symbols.length - 1) {
10099
+ newRestDiatonicId = symbols[rightNoteId].getDiatonicId(staff);
10100
+ } else if (leftNoteId >= 0 && rightNoteId > symbols.length - 1) {
10101
+ newRestDiatonicId = symbols[leftNoteId].getDiatonicId(staff);
10102
+ } else if (leftNoteId >= 0 && rightNoteId <= symbols.length - 1) {
10103
+ newRestDiatonicId = Math.round(
10104
+ (symbols[leftNoteId].getDiatonicId(staff) + symbols[rightNoteId].getDiatonicId(staff)) / 2
10105
+ );
10106
+ }
10107
+ if (newRestDiatonicId !== void 0)
10108
+ sym.updateRunningArguments(newRestDiatonicId, b.stemDir, []);
10109
+ });
10110
+ });
10111
+ });
10079
10112
  this.tabStringNotes.length = 0;
10080
10113
  if (this.isFirstMeasureInRow()) {
10081
10114
  this.row.getTabs().forEach((tab) => {
@@ -10172,7 +10205,7 @@ var ObjMeasure = class extends MusicObject {
10172
10205
  });
10173
10206
  }
10174
10207
  alignStemsToBeams() {
10175
- this.beamGroups.forEach((b) => b.updateStemTips());
10208
+ this.beamGroups.forEach((b) => b.updateNoteStemTips());
10176
10209
  }
10177
10210
  layoutDone() {
10178
10211
  this.columns.forEach((col) => col.layoutDone());
@@ -1,12 +1,12 @@
1
- /* WebMusicScore v6.0.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
1
+ /* WebMusicScore v6.0.1 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
2
  import {
3
3
  MusicError
4
- } from "../chunk-422QLXBR.mjs";
4
+ } from "../chunk-IUXO5M6R.mjs";
5
5
  import {
6
6
  NoteLengthProps,
7
7
  RhythmProps,
8
8
  validateNoteLength
9
- } from "../chunk-JOXUFYNU.mjs";
9
+ } from "../chunk-VTNNVMRE.mjs";
10
10
  import {
11
11
  AnchoredRect,
12
12
  BiMap,
@@ -20,12 +20,12 @@ import {
20
20
  device_exports,
21
21
  guard_exports,
22
22
  utils_exports
23
- } from "../chunk-7N2CWRTL.mjs";
23
+ } from "../chunk-EDHJ4ZRB.mjs";
24
24
  import {
25
25
  __publicField,
26
26
  __spreadProps,
27
27
  __spreadValues
28
- } from "../chunk-ZAPOJP2K.mjs";
28
+ } from "../chunk-OM25LPIN.mjs";
29
29
 
30
30
  // src/score/pub/types.ts
31
31
  var StaffPreset = /* @__PURE__ */ ((StaffPreset2) => {
@@ -1746,17 +1746,6 @@ var ObjArpeggio = class extends MusicObject {
1746
1746
  // src/score/engine/obj-rest.ts
1747
1747
  import { Note as Note3, NoteLengthProps as NoteLengthProps2, RhythmProps as RhythmProps2, Tuplet } from "web-music-score/theory";
1748
1748
  import { MusicError as MusicError4, MusicErrorType as MusicErrorType4 } from "web-music-score/core";
1749
- function getDiatonicIdFromStaffPos(staffPos) {
1750
- if (typeof staffPos === "number") {
1751
- return Note3.getChromaticNote(staffPos).diatonicId;
1752
- } else if (typeof staffPos === "string") {
1753
- return Note3.getNote(staffPos).diatonicId;
1754
- } else if (staffPos instanceof Note3) {
1755
- return staffPos.diatonicId;
1756
- } else {
1757
- return void 0;
1758
- }
1759
- }
1760
1749
  var ObjStaffRest = class extends MusicObject {
1761
1750
  constructor(staff, rest) {
1762
1751
  super(staff);
@@ -1803,11 +1792,8 @@ var _ObjRest = class _ObjRest extends MusicObject {
1803
1792
  __publicField(this, "beamGroup");
1804
1793
  __publicField(this, "staffObjects", []);
1805
1794
  __publicField(this, "mi");
1806
- this.setDiatonicId = (_b = getDiatonicIdFromStaffPos((_a = this.options) == null ? void 0 : _a.staffPos)) != null ? _b : _ObjRest.UndefinedDiatonicId;
1807
- let staves = this.row.getStaves().filter((staff) => staff.containsVoiceId(this.voiceId));
1808
- if (this.setDiatonicId !== _ObjRest.UndefinedDiatonicId && staves.length > 0 && staves[0].isSpace(this.setDiatonicId)) {
1809
- this.setDiatonicId += this.setDiatonicId >= staves[0].middleLineDiatonicId ? 1 : -1;
1810
- }
1795
+ this.setDiatonicId = (_b = this.getDiatonicIdFromStaffPos((_a = this.options) == null ? void 0 : _a.staffPos)) != null ? _b : _ObjRest.UndefinedDiatonicId;
1796
+ this.setDiatonicId = this.getDiatonicIdOnLine(this.setDiatonicId);
1811
1797
  this.runningDiatonicId = this.setDiatonicId;
1812
1798
  this.runningStemDir = "up" /* Up */;
1813
1799
  this.color = (_c = options == null ? void 0 : options.color) != null ? _c : colorKey("staff.rest");
@@ -1831,6 +1817,25 @@ var _ObjRest = class _ObjRest extends MusicObject {
1831
1817
  get noteLength() {
1832
1818
  return this.rhythmProps.noteLength;
1833
1819
  }
1820
+ getDiatonicIdFromStaffPos(staffPos) {
1821
+ if (typeof staffPos === "number") {
1822
+ return Note3.getChromaticNote(staffPos).diatonicId;
1823
+ } else if (typeof staffPos === "string") {
1824
+ return Note3.getNote(staffPos).diatonicId;
1825
+ } else if (staffPos instanceof Note3) {
1826
+ return staffPos.diatonicId;
1827
+ } else {
1828
+ return void 0;
1829
+ }
1830
+ }
1831
+ getDiatonicIdOnLine(diatonicId) {
1832
+ let staves = this.row.getStaves().filter((staff) => staff.containsVoiceId(this.voiceId));
1833
+ if (diatonicId !== _ObjRest.UndefinedDiatonicId && staves.length > 0 && staves[0].isSpace(diatonicId)) {
1834
+ return diatonicId += diatonicId >= staves[0].middleLineDiatonicId ? 1 : -1;
1835
+ } else {
1836
+ return diatonicId;
1837
+ }
1838
+ }
1834
1839
  getDiatonicId(staff) {
1835
1840
  if (this.runningDiatonicId === _ObjRest.UndefinedDiatonicId) {
1836
1841
  if (staff) {
@@ -4291,7 +4296,7 @@ var ObjBeamGroup = class _ObjBeamGroup extends MusicObject {
4291
4296
  }
4292
4297
  }
4293
4298
  }
4294
- updateStemTips() {
4299
+ updateNoteStemTips() {
4295
4300
  this.staffObjects.forEach((obj) => {
4296
4301
  let left = obj.points[0];
4297
4302
  let right = obj.points[obj.points.length - 1];
@@ -6203,6 +6208,34 @@ var ObjMeasure = class extends MusicObject {
6203
6208
  this.signatures.push(signature);
6204
6209
  }
6205
6210
  });
6211
+ getVoiceIds().forEach((voiceId) => {
6212
+ const staff = this.row.getStaves()[0];
6213
+ if (!staff || !staff.containsVoiceId(voiceId))
6214
+ return;
6215
+ this.beamGroups.forEach((b) => {
6216
+ const symbols = b.getSymbols();
6217
+ symbols.forEach((sym, restId) => {
6218
+ if (!(sym instanceof ObjRest && sym.setDiatonicId === ObjRest.UndefinedDiatonicId))
6219
+ return;
6220
+ let leftNoteId = restId;
6221
+ let rightNoteId = restId;
6222
+ while (symbols[leftNoteId] instanceof ObjRest) leftNoteId--;
6223
+ while (symbols[rightNoteId] instanceof ObjRest) rightNoteId++;
6224
+ let newRestDiatonicId;
6225
+ if (leftNoteId < 0 && rightNoteId <= symbols.length - 1) {
6226
+ newRestDiatonicId = symbols[rightNoteId].getDiatonicId(staff);
6227
+ } else if (leftNoteId >= 0 && rightNoteId > symbols.length - 1) {
6228
+ newRestDiatonicId = symbols[leftNoteId].getDiatonicId(staff);
6229
+ } else if (leftNoteId >= 0 && rightNoteId <= symbols.length - 1) {
6230
+ newRestDiatonicId = Math.round(
6231
+ (symbols[leftNoteId].getDiatonicId(staff) + symbols[rightNoteId].getDiatonicId(staff)) / 2
6232
+ );
6233
+ }
6234
+ if (newRestDiatonicId !== void 0)
6235
+ sym.updateRunningArguments(newRestDiatonicId, b.stemDir, []);
6236
+ });
6237
+ });
6238
+ });
6206
6239
  this.tabStringNotes.length = 0;
6207
6240
  if (this.isFirstMeasureInRow()) {
6208
6241
  this.row.getTabs().forEach((tab) => {
@@ -6299,7 +6332,7 @@ var ObjMeasure = class extends MusicObject {
6299
6332
  });
6300
6333
  }
6301
6334
  alignStemsToBeams() {
6302
- this.beamGroups.forEach((b) => b.updateStemTips());
6335
+ this.beamGroups.forEach((b) => b.updateNoteStemTips());
6303
6336
  }
6304
6337
  layoutDone() {
6305
6338
  this.columns.forEach((col) => col.layoutDone());
@@ -1,4 +1,4 @@
1
- import { N as Note, A as Accidental } from './note-CJuq5aBy.js';
1
+ import { N as Note, A as Accidental } from './note-RVXvpfyV.js';
2
2
 
3
3
  /** Mode enum. */
4
4
  declare enum Mode {
@@ -1,8 +1,8 @@
1
- import { N as Note } from '../note-CJuq5aBy.js';
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-CJuq5aBy.js';
3
- import { D as Degree } from '../scale-DxGqFxlv.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-DxGqFxlv.js';
5
- export { A as AccidentalType, B as BeamGrouping, K as KeySignature, M as Mode, N as NoteLength, j as NoteLengthProps, h as NoteLengthStr, R as RhythmProps, c as Tempo, a as TimeSignature, T as TimeSignatures, n as Tuplet, k as TupletRatio, f as alterTempoSpeed, g as getDefaultKeySignature, d as getDefaultTempo, b as getDefaultTimeSignature, e as getTempoString, i as isNoteLength, l as isTupletRatio, v as validateNoteLength, m as validateTupletRatio } from '../tempo-pCAa6qgo.js';
1
+ import { N as Note } from '../note-RVXvpfyV.js';
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-RVXvpfyV.js';
3
+ import { D as Degree } from '../scale-B1M10_fu.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-B1M10_fu.js';
5
+ export { A as AccidentalType, B as BeamGrouping, K as KeySignature, M as Mode, N as NoteLength, j as NoteLengthProps, h as NoteLengthStr, R as RhythmProps, c as Tempo, a as TimeSignature, T as TimeSignatures, n as Tuplet, k as TupletRatio, f as alterTempoSpeed, g as getDefaultKeySignature, d as getDefaultTempo, b as getDefaultTimeSignature, e as getTempoString, i as isNoteLength, l as isTupletRatio, v as validateNoteLength, m as validateTupletRatio } from '../tempo-D-JF-8b_.js';
6
6
 
7
7
  /** Chord info type. */
8
8
  type ChordInfo = {
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v6.0.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
1
+ /* WebMusicScore v6.0.1 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v6.0.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
1
+ /* WebMusicScore v6.0.1 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
2
  import {
3
3
  NoteLength,
4
4
  NoteLengthProps,
@@ -8,7 +8,7 @@ import {
8
8
  isTupletRatio,
9
9
  validateNoteLength,
10
10
  validateTupletRatio
11
- } from "../chunk-JOXUFYNU.mjs";
11
+ } from "../chunk-VTNNVMRE.mjs";
12
12
  import {
13
13
  IndexArray,
14
14
  LRUCache,
@@ -16,10 +16,10 @@ import {
16
16
  UniMap,
17
17
  guard_exports,
18
18
  utils_exports
19
- } from "../chunk-7N2CWRTL.mjs";
19
+ } from "../chunk-EDHJ4ZRB.mjs";
20
20
  import {
21
21
  __publicField
22
- } from "../chunk-ZAPOJP2K.mjs";
22
+ } from "../chunk-OM25LPIN.mjs";
23
23
 
24
24
  // src/theory/types.ts
25
25
  import { MusicError, MusicErrorType } from "web-music-score/core";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-music-score",
3
- "version": "6.0.0",
3
+ "version": "6.0.1",
4
4
  "author": "Stefan Brockmann",
5
5
  "license": "MIT",
6
6
  "private": false,