@dsebastien/music-notation 0.13.0 → 0.15.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.
@@ -63,4 +63,6 @@ export declare function intervalFrom(root: string, name: string): string | null;
63
63
  * note gets its interval from it (degrees are the interval numbers, 1 3 5) and the root its color;
64
64
  * the root doesn't have to be in the list. Null when a note or the root isn't a note name.
65
65
  */
66
+ /** A note set with no notes: a fretboard or keyboard drawn without dots (a drill's empty neck). */
67
+ export declare function emptyNoteSet(title?: string): NoteSet;
66
68
  export declare function listNoteSet(text: string, root?: string): NoteSet | null;
@@ -53,6 +53,7 @@ function html(doc, tag, cls, text) {
53
53
  }
54
54
  var NAME_PREFIX = `mn-name-${Math.random().toString(36).slice(2, 8)}-`;
55
55
  var names = 0;
56
+ var uniqueId = () => `${NAME_PREFIX}${++names}`;
56
57
  function svgRoot(doc, width, height, cls, label) {
57
58
  const id = `${NAME_PREFIX}${++names}`;
58
59
  const title = svg(doc, "title", { class: "mn-name", id });
@@ -796,6 +797,9 @@ function intervalFrom(root, name) {
796
797
  const m = /^(\d+)([PMmdA]+)$/.exec(spelled);
797
798
  return m && m[1] !== "1" && m[1] !== "8" ? spelled : PLAIN_INTERVALS[semitones];
798
799
  }
800
+ function emptyNoteSet(title = "no notes") {
801
+ return { title, members: [], root: null, pitches: null, preferFlats: false, list: true };
802
+ }
799
803
  function listNoteSet(text, root) {
800
804
  const tokens = text.split(/[\s,]+/).filter(Boolean);
801
805
  if (!tokens.length)
@@ -1708,5 +1712,5 @@ export {
1708
1712
  voicingCount
1709
1713
  };
1710
1714
 
1711
- //# debugId=746B9A1294ADFAB664756E2164756E21
1715
+ //# debugId=E3AF920B7055E4E864756E2164756E21
1712
1716
  //# sourceMappingURL=index.js.map