@tspro/web-music-score 1.1.0 → 2.0.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 (43) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +247 -195
  3. package/dist/audio/index.d.mts +22 -0
  4. package/dist/audio/index.d.ts +22 -0
  5. package/dist/audio/index.js +147 -0
  6. package/dist/audio/index.mjs +109 -0
  7. package/dist/audio-cg/index.d.mts +4 -0
  8. package/dist/audio-cg/index.d.ts +4 -0
  9. package/dist/audio-cg/index.js +124 -0
  10. package/dist/audio-cg/index.mjs +91 -0
  11. package/dist/chunk-2EPWQZKJ.mjs +9 -0
  12. package/dist/core/index.d.mts +21 -0
  13. package/dist/core/index.d.ts +21 -0
  14. package/dist/core/index.js +72 -0
  15. package/dist/core/index.mjs +45 -0
  16. package/dist/guitar-BIFwFT31.d.ts +24 -0
  17. package/dist/guitar-kbJYu3Am.d.mts +24 -0
  18. package/dist/iife/index.global.js +222 -0
  19. package/dist/note-B5ZtlHc8.d.ts +99 -0
  20. package/dist/note-CraqEy8x.d.mts +99 -0
  21. package/dist/pieces/index.d.mts +15 -0
  22. package/dist/pieces/index.d.ts +15 -0
  23. package/dist/pieces/index.js +104 -0
  24. package/dist/pieces/index.mjs +77 -0
  25. package/dist/react-ui/index.d.mts +169 -0
  26. package/dist/react-ui/index.d.ts +169 -0
  27. package/dist/react-ui/index.js +624 -0
  28. package/dist/react-ui/index.mjs +582 -0
  29. package/dist/score/index.d.mts +1558 -0
  30. package/dist/score/index.d.ts +1558 -0
  31. package/dist/score/index.js +6937 -0
  32. package/dist/score/index.mjs +6863 -0
  33. package/dist/tempo--588tdcv.d.ts +203 -0
  34. package/dist/tempo-BEJBHZ5I.d.mts +203 -0
  35. package/dist/theory/index.d.mts +47 -0
  36. package/dist/theory/index.d.ts +47 -0
  37. package/dist/theory/index.js +1783 -0
  38. package/dist/theory/index.mjs +1716 -0
  39. package/package.json +98 -55
  40. package/dist/index.cjs.js +0 -41053
  41. package/dist/index.d.ts +0 -1281
  42. package/dist/index.esm.mjs +0 -41044
  43. package/dist/index.umd.min.js +0 -9
@@ -0,0 +1,99 @@
1
+ /** @public */
2
+ declare enum SymbolSet {
3
+ Ascii = 0,
4
+ Unicode = 1
5
+ }
6
+ /** @public */
7
+ declare enum PitchNotation {
8
+ Scientific = 0,
9
+ Helmholtz = 1
10
+ }
11
+ /** @public */
12
+ declare const PitchNotationList: PitchNotation[];
13
+ /** @public */
14
+ declare const DefaultPitchNotation = PitchNotation.Scientific;
15
+ /** @public */
16
+ declare function validatePitchNotation(pn: unknown): PitchNotation;
17
+ /** @public */
18
+ declare function getPitchNotationName(pn: PitchNotation): string;
19
+ /** @public */
20
+ declare enum GuitarNoteLabel {
21
+ Default = "Default",
22
+ OmitOctave = "Omit Octave",
23
+ Interval = "Interval"
24
+ }
25
+ /** @public */
26
+ declare const DefaultGuitarNoteLabel = GuitarNoteLabel.Default;
27
+ /** @public */
28
+ declare const GuitarNoteLabelList: GuitarNoteLabel[];
29
+ /** @public */
30
+ declare function validateGuitarNoteLabel(label: string): GuitarNoteLabel;
31
+
32
+ /** @public */
33
+ type Accidental = -2 | -1 | 0 | 1 | 2;
34
+ /** @public */
35
+ type NoteLetter = "C" | "D" | "E" | "F" | "G" | "A" | "B";
36
+ /** @public */
37
+ type ParsedNote = {
38
+ noteLetter: NoteLetter;
39
+ accidental: Accidental;
40
+ octave?: number;
41
+ };
42
+ /** @public */
43
+ declare class Note {
44
+ private static noteByNameCache;
45
+ private static chromaticNoteCache;
46
+ readonly diatonicClass: number;
47
+ readonly accidental: Accidental;
48
+ readonly octave: number;
49
+ constructor(diatonicId: number, accidental: number);
50
+ constructor(diatonicClass: number, accidental: number, octave: number);
51
+ constructor(noteLetter: string, accidental: number, octave: number);
52
+ get diatonicId(): number;
53
+ get chromaticId(): number;
54
+ get midiNumber(): number;
55
+ get chromaticClass(): number;
56
+ get noteLetter(): NoteLetter;
57
+ format(pitchNotation: PitchNotation, symbolSet: SymbolSet): string;
58
+ formatOmitOctave(symbolSet: SymbolSet): string;
59
+ static getNote(noteName: string): Note;
60
+ static getChromaticNote(chromaticId: number): Note;
61
+ static getDiatonicClass(diatonicId: number): number;
62
+ static getDiatonicClass(noteName: string): number;
63
+ static getOctaveFromDiatonicId(diatonicId: number): number;
64
+ static getDiatonicIdInOctave(diatonicId: number, octave: number): number;
65
+ static getChromaticClass(chromaticId: number): number;
66
+ static getOctaveFromChromaticId(chromaticId: number): number;
67
+ static getChromaticIdInOctave(chromaticId: number, octave: number): number;
68
+ static equals(a: Note | null | undefined, b: Note | null | undefined): boolean;
69
+ static replaceAccidentalSymbols(str: string, symbolSet: SymbolSet): string;
70
+ static isValidNoteName(noteName: string): boolean;
71
+ static parseNote(noteName: string): Readonly<ParsedNote> | undefined;
72
+ static getScientificNoteName(noteName: string, symbolSet: SymbolSet): string;
73
+ static getAccidentalSymbol(accidental: Accidental, symbolsSet: SymbolSet): string | undefined;
74
+ static getAccidental(accidentalSymbol: string): Accidental;
75
+ static getNoteLetter(diatonicId: number): NoteLetter;
76
+ static findNextDiatonicIdAbove(diatonicId: number, bottomDiatonicId: number, addOctaveIfEqual: boolean): number;
77
+ static validateDiatonicId(diatonicId: number): number;
78
+ static validateDiatonicClass(diatonicClass: number): number;
79
+ static validateChromaticId(chromaticId: number): number;
80
+ static validatechromaticClass(chromaticClass: number): number;
81
+ static validateNoteLetter(note: string): NoteLetter;
82
+ static validateOctave(octave: number): number;
83
+ static validateAccidental(acc: number): Accidental;
84
+ /**
85
+ * Sort notes by diatonicId in ascending order.
86
+ * @param notes - Array of notes.
87
+ * @returns Sorted array of notes.
88
+ */
89
+ static sort(notes: ReadonlyArray<Note>): Note[];
90
+ /**
91
+ * Remove duplicate notes.
92
+ * @param notes - Array of notes.
93
+ * @returns Sorted set of notes.
94
+ */
95
+ static removeDuplicates(notes: ReadonlyArray<Note>): Note[];
96
+ static compareFunc(a: Note, b: Note): 1 | -1 | 0;
97
+ }
98
+
99
+ 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 };
@@ -0,0 +1,99 @@
1
+ /** @public */
2
+ declare enum SymbolSet {
3
+ Ascii = 0,
4
+ Unicode = 1
5
+ }
6
+ /** @public */
7
+ declare enum PitchNotation {
8
+ Scientific = 0,
9
+ Helmholtz = 1
10
+ }
11
+ /** @public */
12
+ declare const PitchNotationList: PitchNotation[];
13
+ /** @public */
14
+ declare const DefaultPitchNotation = PitchNotation.Scientific;
15
+ /** @public */
16
+ declare function validatePitchNotation(pn: unknown): PitchNotation;
17
+ /** @public */
18
+ declare function getPitchNotationName(pn: PitchNotation): string;
19
+ /** @public */
20
+ declare enum GuitarNoteLabel {
21
+ Default = "Default",
22
+ OmitOctave = "Omit Octave",
23
+ Interval = "Interval"
24
+ }
25
+ /** @public */
26
+ declare const DefaultGuitarNoteLabel = GuitarNoteLabel.Default;
27
+ /** @public */
28
+ declare const GuitarNoteLabelList: GuitarNoteLabel[];
29
+ /** @public */
30
+ declare function validateGuitarNoteLabel(label: string): GuitarNoteLabel;
31
+
32
+ /** @public */
33
+ type Accidental = -2 | -1 | 0 | 1 | 2;
34
+ /** @public */
35
+ type NoteLetter = "C" | "D" | "E" | "F" | "G" | "A" | "B";
36
+ /** @public */
37
+ type ParsedNote = {
38
+ noteLetter: NoteLetter;
39
+ accidental: Accidental;
40
+ octave?: number;
41
+ };
42
+ /** @public */
43
+ declare class Note {
44
+ private static noteByNameCache;
45
+ private static chromaticNoteCache;
46
+ readonly diatonicClass: number;
47
+ readonly accidental: Accidental;
48
+ readonly octave: number;
49
+ constructor(diatonicId: number, accidental: number);
50
+ constructor(diatonicClass: number, accidental: number, octave: number);
51
+ constructor(noteLetter: string, accidental: number, octave: number);
52
+ get diatonicId(): number;
53
+ get chromaticId(): number;
54
+ get midiNumber(): number;
55
+ get chromaticClass(): number;
56
+ get noteLetter(): NoteLetter;
57
+ format(pitchNotation: PitchNotation, symbolSet: SymbolSet): string;
58
+ formatOmitOctave(symbolSet: SymbolSet): string;
59
+ static getNote(noteName: string): Note;
60
+ static getChromaticNote(chromaticId: number): Note;
61
+ static getDiatonicClass(diatonicId: number): number;
62
+ static getDiatonicClass(noteName: string): number;
63
+ static getOctaveFromDiatonicId(diatonicId: number): number;
64
+ static getDiatonicIdInOctave(diatonicId: number, octave: number): number;
65
+ static getChromaticClass(chromaticId: number): number;
66
+ static getOctaveFromChromaticId(chromaticId: number): number;
67
+ static getChromaticIdInOctave(chromaticId: number, octave: number): number;
68
+ static equals(a: Note | null | undefined, b: Note | null | undefined): boolean;
69
+ static replaceAccidentalSymbols(str: string, symbolSet: SymbolSet): string;
70
+ static isValidNoteName(noteName: string): boolean;
71
+ static parseNote(noteName: string): Readonly<ParsedNote> | undefined;
72
+ static getScientificNoteName(noteName: string, symbolSet: SymbolSet): string;
73
+ static getAccidentalSymbol(accidental: Accidental, symbolsSet: SymbolSet): string | undefined;
74
+ static getAccidental(accidentalSymbol: string): Accidental;
75
+ static getNoteLetter(diatonicId: number): NoteLetter;
76
+ static findNextDiatonicIdAbove(diatonicId: number, bottomDiatonicId: number, addOctaveIfEqual: boolean): number;
77
+ static validateDiatonicId(diatonicId: number): number;
78
+ static validateDiatonicClass(diatonicClass: number): number;
79
+ static validateChromaticId(chromaticId: number): number;
80
+ static validatechromaticClass(chromaticClass: number): number;
81
+ static validateNoteLetter(note: string): NoteLetter;
82
+ static validateOctave(octave: number): number;
83
+ static validateAccidental(acc: number): Accidental;
84
+ /**
85
+ * Sort notes by diatonicId in ascending order.
86
+ * @param notes - Array of notes.
87
+ * @returns Sorted array of notes.
88
+ */
89
+ static sort(notes: ReadonlyArray<Note>): Note[];
90
+ /**
91
+ * Remove duplicate notes.
92
+ * @param notes - Array of notes.
93
+ * @returns Sorted set of notes.
94
+ */
95
+ static removeDuplicates(notes: ReadonlyArray<Note>): Note[];
96
+ static compareFunc(a: Note, b: Note): 1 | 0 | -1;
97
+ }
98
+
99
+ 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 };
@@ -0,0 +1,15 @@
1
+ import { MDocument } from '../score/index.mjs';
2
+ import '../note-CraqEy8x.mjs';
3
+ import '../tempo-BEJBHZ5I.mjs';
4
+ import '@tspro/ts-utils-lib';
5
+
6
+ /** @public */
7
+ declare function createFrereJacques(): MDocument;
8
+
9
+ /** @public */
10
+ declare function createGreensleeves(): MDocument;
11
+
12
+ /** @public */
13
+ declare function createAndanteByDiabelli(): MDocument;
14
+
15
+ export { createAndanteByDiabelli, createFrereJacques, createGreensleeves };
@@ -0,0 +1,15 @@
1
+ import { MDocument } from '../score/index.js';
2
+ import '../note-B5ZtlHc8.js';
3
+ import '../tempo--588tdcv.js';
4
+ import '@tspro/ts-utils-lib';
5
+
6
+ /** @public */
7
+ declare function createFrereJacques(): MDocument;
8
+
9
+ /** @public */
10
+ declare function createGreensleeves(): MDocument;
11
+
12
+ /** @public */
13
+ declare function createAndanteByDiabelli(): MDocument;
14
+
15
+ export { createAndanteByDiabelli, createFrereJacques, createGreensleeves };
@@ -0,0 +1,104 @@
1
+ /* WebMusicScore v2.0.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/pieces/index.ts
22
+ var pieces_exports = {};
23
+ __export(pieces_exports, {
24
+ createAndanteByDiabelli: () => createAndanteByDiabelli,
25
+ createFrereJacques: () => createFrereJacques,
26
+ createGreensleeves: () => createGreensleeves
27
+ });
28
+ module.exports = __toCommonJS(pieces_exports);
29
+
30
+ // src/pieces/frere-jacques.ts
31
+ var import_theory = require("@tspro/web-music-score/theory");
32
+ var import_score = require("@tspro/web-music-score/score");
33
+ function createFrereJacques() {
34
+ let doc = new import_score.MDocument(import_score.StaffPreset.GuitarTreble);
35
+ doc.setHeader("Frere Jacques");
36
+ doc.addMeasure().setKeySignature("G", import_theory.ScaleType.Major).setTimeSignature("4/4").addNote(0, "G3", import_theory.NoteLength.Quarter).addNote(0, "A3", import_theory.NoteLength.Quarter).addNote(0, "B3", import_theory.NoteLength.Quarter).addNote(0, "G3", import_theory.NoteLength.Quarter);
37
+ doc.addMeasure().addNote(0, "G3", import_theory.NoteLength.Quarter).addNote(0, "A3", import_theory.NoteLength.Quarter).addNote(0, "B3", import_theory.NoteLength.Quarter).addNote(0, "G3", import_theory.NoteLength.Quarter);
38
+ doc.addMeasure().addNote(0, "B3", import_theory.NoteLength.Quarter).addNote(0, "C4", import_theory.NoteLength.Quarter).addNote(0, "D4", import_theory.NoteLength.Half).endRow();
39
+ doc.addMeasure().addNote(0, "B3", import_theory.NoteLength.Quarter).addNote(0, "C4", import_theory.NoteLength.Quarter).addNote(0, "D4", import_theory.NoteLength.Half);
40
+ doc.addMeasure().addNote(0, "D4", import_theory.NoteLength.Eighth).addNote(0, "E4", import_theory.NoteLength.Eighth).addNote(0, "D4", import_theory.NoteLength.Eighth).addNote(0, "C4", import_theory.NoteLength.Eighth).addNote(0, "B3", import_theory.NoteLength.Quarter).addNote(0, "G3", import_theory.NoteLength.Quarter).endRow();
41
+ doc.addMeasure().addNote(0, "D4", import_theory.NoteLength.Eighth).addNote(0, "E4", import_theory.NoteLength.Eighth).addNote(0, "D4", import_theory.NoteLength.Eighth).addNote(0, "C4", import_theory.NoteLength.Eighth).addNote(0, "B3", import_theory.NoteLength.Quarter).addNote(0, "G3", import_theory.NoteLength.Quarter);
42
+ doc.addMeasure().addNote(0, "G3", import_theory.NoteLength.Quarter).addNote(0, "D3", import_theory.NoteLength.Quarter).addNote(0, "G3", import_theory.NoteLength.Half);
43
+ doc.addMeasure().addNote(0, "G3", import_theory.NoteLength.Quarter).addNote(0, "D3", import_theory.NoteLength.Quarter).addNote(0, "G3", import_theory.NoteLength.Half);
44
+ return doc;
45
+ }
46
+
47
+ // src/pieces/greensleeves.ts
48
+ var import_theory2 = require("@tspro/web-music-score/theory");
49
+ var import_score2 = require("@tspro/web-music-score/score");
50
+ function createGreensleeves() {
51
+ let doc = new import_score2.MDocument(import_score2.StaffPreset.GuitarTreble);
52
+ doc.setHeader("Greensleeves");
53
+ doc.addMeasure().setKeySignature("C", import_theory2.ScaleType.Major).setTimeSignature("6/8").setTempo(140).addNote(0, "A3", import_theory2.NoteLength.Eighth);
54
+ doc.addMeasure().addNavigation(import_score2.Navigation.StartRepeat).addNote(0, "C4", import_theory2.NoteLength.Quarter, { stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "Am").addNote(0, "D4", import_theory2.NoteLength.Eighth).addNote(0, "E4", import_theory2.NoteLength.Eighth, { dotted: true }).addNote(0, "F4", import_theory2.NoteLength.Sixteenth).addNote(0, "E4", import_theory2.NoteLength.Eighth).addNote(1, "A2", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "E3", import_theory2.NoteLength.Quarter).addNote(1, "A2", import_theory2.NoteLength.Eighth).addNote(1, "E3", import_theory2.NoteLength.Quarter);
55
+ doc.addMeasure().addNote(0, "D4", import_theory2.NoteLength.Quarter, { stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "G").addNote(0, "B3", import_theory2.NoteLength.Eighth).addNote(0, "G3", import_theory2.NoteLength.Eighth, { dotted: true }).addLabel(import_score2.Label.Chord, "Em").addNote(0, "A3", import_theory2.NoteLength.Sixteenth).addNote(0, "B3", import_theory2.NoteLength.Eighth).addNote(1, "G2", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "D3", import_theory2.NoteLength.Quarter).addNote(1, "E2", import_theory2.NoteLength.Eighth).addNote(1, "B2", import_theory2.NoteLength.Quarter);
56
+ doc.addMeasure().addNote(0, "C4", import_theory2.NoteLength.Quarter, { stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "Am").addNote(0, "A3", import_theory2.NoteLength.Eighth).addNote(0, "A3", import_theory2.NoteLength.Eighth, { dotted: true }).addLabel(import_score2.Label.Chord, "F").addNote(0, "G#3", import_theory2.NoteLength.Sixteenth).addNote(0, "A3", import_theory2.NoteLength.Eighth).addNote(1, "A2", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "E3", import_theory2.NoteLength.Quarter).addNote(1, "F2", import_theory2.NoteLength.Eighth).addNote(1, "A2", import_theory2.NoteLength.Quarter);
57
+ doc.addMeasure().addNote(0, "B3", import_theory2.NoteLength.Quarter, { stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "E").addNote(0, "G#3", import_theory2.NoteLength.Eighth).addNote(0, "E3", import_theory2.NoteLength.Quarter).addNote(0, "A3", import_theory2.NoteLength.Eighth).addNote(1, "E2", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "B2", import_theory2.NoteLength.Quarter).addNote(1, "E2", import_theory2.NoteLength.Eighth).addNote(1, "B2", import_theory2.NoteLength.Quarter).endRow();
58
+ doc.addMeasure().addNote(0, "C4", import_theory2.NoteLength.Quarter, { stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "Am").addNote(0, "D4", import_theory2.NoteLength.Eighth).addNote(0, "E4", import_theory2.NoteLength.Eighth, { dotted: true }).addNote(0, "F4", import_theory2.NoteLength.Sixteenth).addNote(0, "E4", import_theory2.NoteLength.Eighth).addNote(1, "A2", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "E3", import_theory2.NoteLength.Quarter).addNote(1, "A2", import_theory2.NoteLength.Eighth).addNote(1, "E3", import_theory2.NoteLength.Quarter);
59
+ doc.addMeasure().addNote(0, "D4", import_theory2.NoteLength.Quarter, { stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "G").addNote(0, "B3", import_theory2.NoteLength.Eighth).addNote(0, "G3", import_theory2.NoteLength.Eighth, { dotted: true }).addLabel(import_score2.Label.Chord, "Em").addNote(0, "A3", import_theory2.NoteLength.Sixteenth).addNote(0, "B3", import_theory2.NoteLength.Eighth).addNote(1, "G2", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "D3", import_theory2.NoteLength.Quarter).addNote(1, "E2", import_theory2.NoteLength.Eighth).addNote(1, "B2", import_theory2.NoteLength.Quarter);
60
+ doc.addMeasure().addNote(0, "C4", import_theory2.NoteLength.Eighth, { dotted: true, stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "Am").addNote(0, "B3", import_theory2.NoteLength.Sixteenth).addNote(0, "A3", import_theory2.NoteLength.Eighth).addNote(0, "G#3", import_theory2.NoteLength.Eighth, { dotted: true }).addLabel(import_score2.Label.Chord, "E").addNote(0, "F#3", import_theory2.NoteLength.Sixteenth).addNote(0, "G#3", import_theory2.NoteLength.Eighth).addNote(1, "A2", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "E3", import_theory2.NoteLength.Quarter).addNote(1, "E2", import_theory2.NoteLength.Eighth).addNote(1, "B2", import_theory2.NoteLength.Quarter);
61
+ doc.addMeasure().addNote(0, "A3", import_theory2.NoteLength.Quarter, { dotted: true, stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "Am").addNote(0, "A3", import_theory2.NoteLength.Quarter, { dotted: true }).addNote(1, "A2", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "E3", import_theory2.NoteLength.Eighth).addNote(1, "C4", import_theory2.NoteLength.Eighth).addNote(1, "A2", import_theory2.NoteLength.Quarter, { dotted: true }).endRow();
62
+ doc.addMeasure().addChord(0, ["C3", "E3", "G3", "C4", "G4"], import_theory2.NoteLength.Quarter, { dotted: true, arpeggio: import_score2.Arpeggio.Up, stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "C").addNote(0, "G4", import_theory2.NoteLength.Eighth, { dotted: true }).addNote(0, "F#4", import_theory2.NoteLength.Sixteenth).addNote(0, "E4", import_theory2.NoteLength.Eighth).addRest(1, import_theory2.NoteLength.Quarter, { dotted: true, hide: true }).addNote(1, "C3", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "G3", import_theory2.NoteLength.Quarter);
63
+ doc.addMeasure().addNote(0, "D4", import_theory2.NoteLength.Quarter, { stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "G").addNote(0, "B3", import_theory2.NoteLength.Eighth).addNote(0, "G3", import_theory2.NoteLength.Eighth, { dotted: true }).addLabel(import_score2.Label.Chord, "Em").addNote(0, "A3", import_theory2.NoteLength.Sixteenth).addNote(0, "B3", import_theory2.NoteLength.Eighth).addNote(1, "G2", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "D3", import_theory2.NoteLength.Quarter).addNote(1, "E2", import_theory2.NoteLength.Eighth).addNote(1, "B2", import_theory2.NoteLength.Quarter);
64
+ doc.addMeasure().addNote(0, "C4", import_theory2.NoteLength.Quarter, { stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "Am").addNote(0, "A3", import_theory2.NoteLength.Eighth).addNote(0, "A3", import_theory2.NoteLength.Eighth, { dotted: true }).addLabel(import_score2.Label.Chord, "F").addNote(0, "G#3", import_theory2.NoteLength.Sixteenth).addNote(0, "A3", import_theory2.NoteLength.Eighth).addNote(1, "A2", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "E3", import_theory2.NoteLength.Quarter).addNote(1, "F2", import_theory2.NoteLength.Eighth).addNote(1, "A2", import_theory2.NoteLength.Quarter);
65
+ doc.addMeasure().addNote(0, "B3", import_theory2.NoteLength.Quarter, { stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "E").addNote(0, "G#3", import_theory2.NoteLength.Eighth).addNote(0, "E3", import_theory2.NoteLength.Quarter, { dotted: true }).addNote(1, "E2", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "B2", import_theory2.NoteLength.Quarter).addNote(1, "E2", import_theory2.NoteLength.Eighth).addNote(1, "B2", import_theory2.NoteLength.Eighth).addNote(1, "E3", import_theory2.NoteLength.Eighth).endRow();
66
+ doc.addMeasure().addNote(0, "G4", import_theory2.NoteLength.Quarter, { dotted: true, stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "C").addNote(0, "G4", import_theory2.NoteLength.Eighth, { dotted: true }).addNote(0, "F#4", import_theory2.NoteLength.Sixteenth).addNote(0, "E4", import_theory2.NoteLength.Eighth).addNote(1, "C3", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "G3", import_theory2.NoteLength.Eighth).addNote(1, "C4", import_theory2.NoteLength.Eighth).addNote(1, "C3", import_theory2.NoteLength.Eighth).addNote(1, "G3", import_theory2.NoteLength.Quarter);
67
+ doc.addMeasure().addNote(0, "D4", import_theory2.NoteLength.Quarter, { stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "G").addNote(0, "B3", import_theory2.NoteLength.Eighth).addNote(0, "G3", import_theory2.NoteLength.Eighth, { dotted: true }).addLabel(import_score2.Label.Chord, "Em").addNote(0, "A3", import_theory2.NoteLength.Sixteenth).addNote(0, "B3", import_theory2.NoteLength.Eighth).addNote(1, "G2", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "D3", import_theory2.NoteLength.Quarter).addNote(1, "E2", import_theory2.NoteLength.Eighth).addNote(1, "B2", import_theory2.NoteLength.Quarter);
68
+ doc.addMeasure().addNote(0, "C4", import_theory2.NoteLength.Eighth, { dotted: true, stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "Am").addNote(0, "B3", import_theory2.NoteLength.Sixteenth).addNote(0, "A3", import_theory2.NoteLength.Eighth).addNote(0, "G#3", import_theory2.NoteLength.Eighth, { dotted: true }).addLabel(import_score2.Label.Chord, "E").addNote(0, "F#3", import_theory2.NoteLength.Sixteenth).addNote(0, "G#3", import_theory2.NoteLength.Eighth).addNote(1, "A2", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "E3", import_theory2.NoteLength.Quarter).addNote(1, "E2", import_theory2.NoteLength.Eighth).addNote(1, "B2", import_theory2.NoteLength.Quarter);
69
+ doc.addMeasure().addNavigation(import_score2.Navigation.Ending, 1).addNavigation(import_score2.Navigation.EndRepeat).addNote(0, "A3", import_theory2.NoteLength.Quarter, { dotted: true, stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "Am").addNote(0, "A3", import_theory2.NoteLength.Quarter).addNote(0, "A3", import_theory2.NoteLength.Eighth).addNote(1, "A2", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "E3", import_theory2.NoteLength.Eighth).addNote(1, "C4", import_theory2.NoteLength.Eighth).addNote(1, "A2", import_theory2.NoteLength.Quarter, { dotted: true });
70
+ doc.addMeasure().addNavigation(import_score2.Navigation.Ending, 2).addNote(0, "A3", import_theory2.NoteLength.Quarter, { dotted: true, stem: import_score2.Stem.Up }).addLabel(import_score2.Label.Chord, "Am").addNote(0, "A3", import_theory2.NoteLength.Quarter, { dotted: true }).addFermata().addNote(1, "A2", import_theory2.NoteLength.Eighth, { stem: import_score2.Stem.Down }).addNote(1, "E3", import_theory2.NoteLength.Eighth).addNote(1, "C4", import_theory2.NoteLength.Eighth).addNote(1, "A2", import_theory2.NoteLength.Quarter, { dotted: true });
71
+ return doc;
72
+ }
73
+
74
+ // src/pieces/andante-diabelli.ts
75
+ var import_theory3 = require("@tspro/web-music-score/theory");
76
+ var import_score3 = require("@tspro/web-music-score/score");
77
+ function createAndanteByDiabelli() {
78
+ let doc = new import_score3.MDocument(import_score3.StaffPreset.GuitarTreble);
79
+ doc.setHeader("Andante", "A. Diabelli");
80
+ doc.addMeasure().setKeySignature("D", import_theory3.ScaleType.Major).setTimeSignature("3/4").setTempo(80).addRest(0, import_theory3.NoteLength.Eighth, { staffPos: "G4" }).addAnnotation(import_score3.Annotation.Dynamics, "p").addNote(0, "F#4", import_theory3.NoteLength.Eighth, { stem: import_score3.Stem.Up }).addNote(0, "G4", import_theory3.NoteLength.Eighth, { slurSpan: 2, slurAnchor: import_score3.NoteAnchor.Below }).addNote(0, "F#4", import_theory3.NoteLength.Eighth).addNote(0, "E4", import_theory3.NoteLength.Eighth).addNote(0, "D4", import_theory3.NoteLength.Eighth).addNote(1, "D3", import_theory3.NoteLength.Half, { dotted: true, stem: import_score3.Stem.Down });
81
+ doc.addMeasure().addNote(0, "C#4", import_theory3.NoteLength.Eighth, { slurSpan: 2, slurAnchor: import_score3.NoteAnchor.Below }).addNote(0, "D4", import_theory3.NoteLength.Eighth).addNote(0, "E4", import_theory3.NoteLength.Eighth).addNote(0, "F#4", import_theory3.NoteLength.Eighth).addNote(0, "G4", import_theory3.NoteLength.Quarter).addNote(1, "A2", import_theory3.NoteLength.Half, { dotted: true });
82
+ doc.addMeasure().addRest(0, import_theory3.NoteLength.Eighth, { staffPos: "B3" }).addAnnotation(import_score3.Annotation.Dynamics, "f").addNote(0, "A3", import_theory3.NoteLength.Eighth).addNote(0, "G#3", import_theory3.NoteLength.Eighth, { slurSpan: 2, slurAnchor: import_score3.NoteAnchor.Below }).addNote(0, "A3", import_theory3.NoteLength.Eighth).addNote(0, "B3", import_theory3.NoteLength.Eighth).addNote(0, "C#4", import_theory3.NoteLength.Eighth).addNote(1, "A2", import_theory3.NoteLength.Half, { dotted: true }).endRow();
83
+ doc.addMeasure().addNote(0, "D4", import_theory3.NoteLength.Eighth).addNote(0, "E4", import_theory3.NoteLength.Eighth).addNote(0, "F#4", import_theory3.NoteLength.Eighth).addNote(0, "G4", import_theory3.NoteLength.Eighth).addNote(0, "A4", import_theory3.NoteLength.Quarter).addNote(1, "D3", import_theory3.NoteLength.Half, { dotted: true });
84
+ doc.addMeasure().addRest(0, import_theory3.NoteLength.Eighth, { staffPos: "G4" }).addAnnotation(import_score3.Annotation.Dynamics, "p").addNote(0, "F#4", import_theory3.NoteLength.Eighth).addNote(0, "G4", import_theory3.NoteLength.Eighth, { slurSpan: 2, slurAnchor: import_score3.NoteAnchor.Below }).addNote(0, "F#4", import_theory3.NoteLength.Eighth).addNote(0, "E4", import_theory3.NoteLength.Eighth).addNote(0, "D4", import_theory3.NoteLength.Eighth).addNote(1, "D3", import_theory3.NoteLength.Half, { dotted: true });
85
+ doc.addMeasure().addNote(0, "C#4", import_theory3.NoteLength.Eighth, { slurSpan: 2, slurAnchor: import_score3.NoteAnchor.Below }).addNote(0, "D4", import_theory3.NoteLength.Eighth).addNote(0, "E4", import_theory3.NoteLength.Eighth).addNote(0, "F#4", import_theory3.NoteLength.Eighth).addNote(0, "G4", import_theory3.NoteLength.Quarter).addNote(1, "A2", import_theory3.NoteLength.Half, { dotted: true }).endRow();
86
+ doc.addMeasure().addRest(0, import_theory3.NoteLength.Eighth, { staffPos: "B3" }).addAnnotation(import_score3.Annotation.Dynamics, "f").addNote(0, "A3", import_theory3.NoteLength.Eighth).addNote(0, "G#3", import_theory3.NoteLength.Eighth, { slurSpan: 2, slurAnchor: import_score3.NoteAnchor.Below }).addNote(0, "A3", import_theory3.NoteLength.Eighth).addNote(0, "B3", import_theory3.NoteLength.Eighth).addNote(0, "C#4", import_theory3.NoteLength.Eighth).addNote(1, "A2", import_theory3.NoteLength.Half, { dotted: true });
87
+ doc.addMeasure().addNote(0, "D4", import_theory3.NoteLength.Quarter).addRest(1, import_theory3.NoteLength.Quarter, { staffPos: "D3" }).addNote(0, "D3", import_theory3.NoteLength.Quarter).addNote(1, "D3", import_theory3.NoteLength.Quarter).addRest(1, import_theory3.NoteLength.Quarter, { staffPos: "B3" }).addNavigation(import_score3.Navigation.EndRepeat);
88
+ doc.addMeasure().addRest(0, import_theory3.NoteLength.Eighth, { staffPos: "D4" }).addAnnotation(import_score3.Annotation.Dynamics, "f").addNote(0, "D4", import_theory3.NoteLength.Eighth).addNote(0, "E4", import_theory3.NoteLength.Eighth, { slurSpan: 2, slurAnchor: import_score3.NoteAnchor.Below }).addNote(0, "D4", import_theory3.NoteLength.Eighth).addNote(0, "C#4", import_theory3.NoteLength.Eighth).addNote(0, "B3", import_theory3.NoteLength.Eighth).addNote(1, "E2", import_theory3.NoteLength.Half, { dotted: true }).endRow();
89
+ doc.addMeasure().addNote(0, "C#4", import_theory3.NoteLength.Eighth, { slurSpan: 2, slurAnchor: import_score3.NoteAnchor.Below }).addNote(0, "D4", import_theory3.NoteLength.Eighth).addNote(0, "E4", import_theory3.NoteLength.Eighth).addNote(0, "F#4", import_theory3.NoteLength.Eighth).addNote(0, "E4", import_theory3.NoteLength.Quarter).addNote(1, "A2", import_theory3.NoteLength.Half, { dotted: true });
90
+ doc.addMeasure().addRest(0, import_theory3.NoteLength.Eighth, { staffPos: "B3" }).addAnnotation(import_score3.Annotation.Dynamics, "p").addNote(0, "E3", import_theory3.NoteLength.Eighth).addNote(0, "D#3", import_theory3.NoteLength.Eighth, { slurSpan: 2, slurAnchor: import_score3.NoteAnchor.Below }).addNote(0, "E3", import_theory3.NoteLength.Eighth).addNote(0, "F#3", import_theory3.NoteLength.Eighth).addNote(0, "G#3", import_theory3.NoteLength.Eighth).addNote(1, "E2", import_theory3.NoteLength.Half, { dotted: true });
91
+ doc.addMeasure().addNote(0, "A3", import_theory3.NoteLength.Eighth, { slurSpan: 2, slurAnchor: import_score3.NoteAnchor.Below }).addNote(0, "G#3", import_theory3.NoteLength.Eighth).addNote(0, "A3", import_theory3.NoteLength.Eighth).addNote(0, "B3", import_theory3.NoteLength.Eighth).addNote(0, "C#4", import_theory3.NoteLength.Quarter).addNote(1, "A2", import_theory3.NoteLength.Half, { dotted: true }).endRow();
92
+ doc.addMeasure().addRest(0, import_theory3.NoteLength.Eighth, { staffPos: "G4" }).addAnnotation(import_score3.Annotation.Dynamics, "f").addNote(0, "G4", import_theory3.NoteLength.Eighth).addNote(0, "A4", import_theory3.NoteLength.Eighth, { slurSpan: 2, slurAnchor: import_score3.NoteAnchor.Below }).addNote(0, "G4", import_theory3.NoteLength.Eighth).addNote(0, "F#4", import_theory3.NoteLength.Eighth).addNote(0, "E4", import_theory3.NoteLength.Eighth).addNote(1, "A2", import_theory3.NoteLength.Half, { dotted: true });
93
+ doc.addMeasure().addNote(0, "D4", import_theory3.NoteLength.Eighth).addNote(0, "C#4", import_theory3.NoteLength.Eighth).addNote(0, "D4", import_theory3.NoteLength.Eighth).addNote(0, "E4", import_theory3.NoteLength.Eighth).addNote(0, "F#4", import_theory3.NoteLength.Quarter).addNote(1, "D3", import_theory3.NoteLength.Half, { dotted: true });
94
+ doc.addMeasure().addRest(0, import_theory3.NoteLength.Eighth, { staffPos: "B3" }).addAnnotation(import_score3.Annotation.Dynamics, "ff").addNote(0, "A3", import_theory3.NoteLength.Eighth).addNote(0, "G#3", import_theory3.NoteLength.Eighth, { slurSpan: 2, slurAnchor: import_score3.NoteAnchor.Below }).addNote(0, "A3", import_theory3.NoteLength.Eighth).addNote(0, "B3", import_theory3.NoteLength.Eighth).addNote(0, "C#4", import_theory3.NoteLength.Eighth).addNote(1, "A2", import_theory3.NoteLength.Half, { dotted: true });
95
+ doc.addMeasure().addNote(0, "D4", import_theory3.NoteLength.Quarter).addRest(1, import_theory3.NoteLength.Quarter, { staffPos: "D3" }).addNote(0, "D3", import_theory3.NoteLength.Quarter).addNote(1, "D3", import_theory3.NoteLength.Quarter).addRest(1, import_theory3.NoteLength.Quarter, { staffPos: "B3" }).endSong();
96
+ return doc;
97
+ }
98
+ // Annotate the CommonJS export names for ESM import in node:
99
+ 0 && (module.exports = {
100
+ createAndanteByDiabelli,
101
+ createFrereJacques,
102
+ createGreensleeves
103
+ });
104
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,77 @@
1
+ /* WebMusicScore v2.0.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
2
+ import "../chunk-2EPWQZKJ.mjs";
3
+
4
+ // src/pieces/frere-jacques.ts
5
+ import { NoteLength, ScaleType } from "@tspro/web-music-score/theory";
6
+ import { MDocument, StaffPreset } from "@tspro/web-music-score/score";
7
+ function createFrereJacques() {
8
+ let doc = new MDocument(StaffPreset.GuitarTreble);
9
+ doc.setHeader("Frere Jacques");
10
+ doc.addMeasure().setKeySignature("G", ScaleType.Major).setTimeSignature("4/4").addNote(0, "G3", NoteLength.Quarter).addNote(0, "A3", NoteLength.Quarter).addNote(0, "B3", NoteLength.Quarter).addNote(0, "G3", NoteLength.Quarter);
11
+ doc.addMeasure().addNote(0, "G3", NoteLength.Quarter).addNote(0, "A3", NoteLength.Quarter).addNote(0, "B3", NoteLength.Quarter).addNote(0, "G3", NoteLength.Quarter);
12
+ doc.addMeasure().addNote(0, "B3", NoteLength.Quarter).addNote(0, "C4", NoteLength.Quarter).addNote(0, "D4", NoteLength.Half).endRow();
13
+ doc.addMeasure().addNote(0, "B3", NoteLength.Quarter).addNote(0, "C4", NoteLength.Quarter).addNote(0, "D4", NoteLength.Half);
14
+ doc.addMeasure().addNote(0, "D4", NoteLength.Eighth).addNote(0, "E4", NoteLength.Eighth).addNote(0, "D4", NoteLength.Eighth).addNote(0, "C4", NoteLength.Eighth).addNote(0, "B3", NoteLength.Quarter).addNote(0, "G3", NoteLength.Quarter).endRow();
15
+ doc.addMeasure().addNote(0, "D4", NoteLength.Eighth).addNote(0, "E4", NoteLength.Eighth).addNote(0, "D4", NoteLength.Eighth).addNote(0, "C4", NoteLength.Eighth).addNote(0, "B3", NoteLength.Quarter).addNote(0, "G3", NoteLength.Quarter);
16
+ doc.addMeasure().addNote(0, "G3", NoteLength.Quarter).addNote(0, "D3", NoteLength.Quarter).addNote(0, "G3", NoteLength.Half);
17
+ doc.addMeasure().addNote(0, "G3", NoteLength.Quarter).addNote(0, "D3", NoteLength.Quarter).addNote(0, "G3", NoteLength.Half);
18
+ return doc;
19
+ }
20
+
21
+ // src/pieces/greensleeves.ts
22
+ import { NoteLength as NoteLength2, ScaleType as ScaleType2 } from "@tspro/web-music-score/theory";
23
+ import { MDocument as MDocument2, Arpeggio, Navigation, StaffPreset as StaffPreset2, Stem, Label } from "@tspro/web-music-score/score";
24
+ function createGreensleeves() {
25
+ let doc = new MDocument2(StaffPreset2.GuitarTreble);
26
+ doc.setHeader("Greensleeves");
27
+ doc.addMeasure().setKeySignature("C", ScaleType2.Major).setTimeSignature("6/8").setTempo(140).addNote(0, "A3", NoteLength2.Eighth);
28
+ doc.addMeasure().addNavigation(Navigation.StartRepeat).addNote(0, "C4", NoteLength2.Quarter, { stem: Stem.Up }).addLabel(Label.Chord, "Am").addNote(0, "D4", NoteLength2.Eighth).addNote(0, "E4", NoteLength2.Eighth, { dotted: true }).addNote(0, "F4", NoteLength2.Sixteenth).addNote(0, "E4", NoteLength2.Eighth).addNote(1, "A2", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "E3", NoteLength2.Quarter).addNote(1, "A2", NoteLength2.Eighth).addNote(1, "E3", NoteLength2.Quarter);
29
+ doc.addMeasure().addNote(0, "D4", NoteLength2.Quarter, { stem: Stem.Up }).addLabel(Label.Chord, "G").addNote(0, "B3", NoteLength2.Eighth).addNote(0, "G3", NoteLength2.Eighth, { dotted: true }).addLabel(Label.Chord, "Em").addNote(0, "A3", NoteLength2.Sixteenth).addNote(0, "B3", NoteLength2.Eighth).addNote(1, "G2", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "D3", NoteLength2.Quarter).addNote(1, "E2", NoteLength2.Eighth).addNote(1, "B2", NoteLength2.Quarter);
30
+ doc.addMeasure().addNote(0, "C4", NoteLength2.Quarter, { stem: Stem.Up }).addLabel(Label.Chord, "Am").addNote(0, "A3", NoteLength2.Eighth).addNote(0, "A3", NoteLength2.Eighth, { dotted: true }).addLabel(Label.Chord, "F").addNote(0, "G#3", NoteLength2.Sixteenth).addNote(0, "A3", NoteLength2.Eighth).addNote(1, "A2", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "E3", NoteLength2.Quarter).addNote(1, "F2", NoteLength2.Eighth).addNote(1, "A2", NoteLength2.Quarter);
31
+ doc.addMeasure().addNote(0, "B3", NoteLength2.Quarter, { stem: Stem.Up }).addLabel(Label.Chord, "E").addNote(0, "G#3", NoteLength2.Eighth).addNote(0, "E3", NoteLength2.Quarter).addNote(0, "A3", NoteLength2.Eighth).addNote(1, "E2", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "B2", NoteLength2.Quarter).addNote(1, "E2", NoteLength2.Eighth).addNote(1, "B2", NoteLength2.Quarter).endRow();
32
+ doc.addMeasure().addNote(0, "C4", NoteLength2.Quarter, { stem: Stem.Up }).addLabel(Label.Chord, "Am").addNote(0, "D4", NoteLength2.Eighth).addNote(0, "E4", NoteLength2.Eighth, { dotted: true }).addNote(0, "F4", NoteLength2.Sixteenth).addNote(0, "E4", NoteLength2.Eighth).addNote(1, "A2", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "E3", NoteLength2.Quarter).addNote(1, "A2", NoteLength2.Eighth).addNote(1, "E3", NoteLength2.Quarter);
33
+ doc.addMeasure().addNote(0, "D4", NoteLength2.Quarter, { stem: Stem.Up }).addLabel(Label.Chord, "G").addNote(0, "B3", NoteLength2.Eighth).addNote(0, "G3", NoteLength2.Eighth, { dotted: true }).addLabel(Label.Chord, "Em").addNote(0, "A3", NoteLength2.Sixteenth).addNote(0, "B3", NoteLength2.Eighth).addNote(1, "G2", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "D3", NoteLength2.Quarter).addNote(1, "E2", NoteLength2.Eighth).addNote(1, "B2", NoteLength2.Quarter);
34
+ doc.addMeasure().addNote(0, "C4", NoteLength2.Eighth, { dotted: true, stem: Stem.Up }).addLabel(Label.Chord, "Am").addNote(0, "B3", NoteLength2.Sixteenth).addNote(0, "A3", NoteLength2.Eighth).addNote(0, "G#3", NoteLength2.Eighth, { dotted: true }).addLabel(Label.Chord, "E").addNote(0, "F#3", NoteLength2.Sixteenth).addNote(0, "G#3", NoteLength2.Eighth).addNote(1, "A2", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "E3", NoteLength2.Quarter).addNote(1, "E2", NoteLength2.Eighth).addNote(1, "B2", NoteLength2.Quarter);
35
+ doc.addMeasure().addNote(0, "A3", NoteLength2.Quarter, { dotted: true, stem: Stem.Up }).addLabel(Label.Chord, "Am").addNote(0, "A3", NoteLength2.Quarter, { dotted: true }).addNote(1, "A2", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "E3", NoteLength2.Eighth).addNote(1, "C4", NoteLength2.Eighth).addNote(1, "A2", NoteLength2.Quarter, { dotted: true }).endRow();
36
+ doc.addMeasure().addChord(0, ["C3", "E3", "G3", "C4", "G4"], NoteLength2.Quarter, { dotted: true, arpeggio: Arpeggio.Up, stem: Stem.Up }).addLabel(Label.Chord, "C").addNote(0, "G4", NoteLength2.Eighth, { dotted: true }).addNote(0, "F#4", NoteLength2.Sixteenth).addNote(0, "E4", NoteLength2.Eighth).addRest(1, NoteLength2.Quarter, { dotted: true, hide: true }).addNote(1, "C3", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "G3", NoteLength2.Quarter);
37
+ doc.addMeasure().addNote(0, "D4", NoteLength2.Quarter, { stem: Stem.Up }).addLabel(Label.Chord, "G").addNote(0, "B3", NoteLength2.Eighth).addNote(0, "G3", NoteLength2.Eighth, { dotted: true }).addLabel(Label.Chord, "Em").addNote(0, "A3", NoteLength2.Sixteenth).addNote(0, "B3", NoteLength2.Eighth).addNote(1, "G2", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "D3", NoteLength2.Quarter).addNote(1, "E2", NoteLength2.Eighth).addNote(1, "B2", NoteLength2.Quarter);
38
+ doc.addMeasure().addNote(0, "C4", NoteLength2.Quarter, { stem: Stem.Up }).addLabel(Label.Chord, "Am").addNote(0, "A3", NoteLength2.Eighth).addNote(0, "A3", NoteLength2.Eighth, { dotted: true }).addLabel(Label.Chord, "F").addNote(0, "G#3", NoteLength2.Sixteenth).addNote(0, "A3", NoteLength2.Eighth).addNote(1, "A2", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "E3", NoteLength2.Quarter).addNote(1, "F2", NoteLength2.Eighth).addNote(1, "A2", NoteLength2.Quarter);
39
+ doc.addMeasure().addNote(0, "B3", NoteLength2.Quarter, { stem: Stem.Up }).addLabel(Label.Chord, "E").addNote(0, "G#3", NoteLength2.Eighth).addNote(0, "E3", NoteLength2.Quarter, { dotted: true }).addNote(1, "E2", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "B2", NoteLength2.Quarter).addNote(1, "E2", NoteLength2.Eighth).addNote(1, "B2", NoteLength2.Eighth).addNote(1, "E3", NoteLength2.Eighth).endRow();
40
+ doc.addMeasure().addNote(0, "G4", NoteLength2.Quarter, { dotted: true, stem: Stem.Up }).addLabel(Label.Chord, "C").addNote(0, "G4", NoteLength2.Eighth, { dotted: true }).addNote(0, "F#4", NoteLength2.Sixteenth).addNote(0, "E4", NoteLength2.Eighth).addNote(1, "C3", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "G3", NoteLength2.Eighth).addNote(1, "C4", NoteLength2.Eighth).addNote(1, "C3", NoteLength2.Eighth).addNote(1, "G3", NoteLength2.Quarter);
41
+ doc.addMeasure().addNote(0, "D4", NoteLength2.Quarter, { stem: Stem.Up }).addLabel(Label.Chord, "G").addNote(0, "B3", NoteLength2.Eighth).addNote(0, "G3", NoteLength2.Eighth, { dotted: true }).addLabel(Label.Chord, "Em").addNote(0, "A3", NoteLength2.Sixteenth).addNote(0, "B3", NoteLength2.Eighth).addNote(1, "G2", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "D3", NoteLength2.Quarter).addNote(1, "E2", NoteLength2.Eighth).addNote(1, "B2", NoteLength2.Quarter);
42
+ doc.addMeasure().addNote(0, "C4", NoteLength2.Eighth, { dotted: true, stem: Stem.Up }).addLabel(Label.Chord, "Am").addNote(0, "B3", NoteLength2.Sixteenth).addNote(0, "A3", NoteLength2.Eighth).addNote(0, "G#3", NoteLength2.Eighth, { dotted: true }).addLabel(Label.Chord, "E").addNote(0, "F#3", NoteLength2.Sixteenth).addNote(0, "G#3", NoteLength2.Eighth).addNote(1, "A2", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "E3", NoteLength2.Quarter).addNote(1, "E2", NoteLength2.Eighth).addNote(1, "B2", NoteLength2.Quarter);
43
+ doc.addMeasure().addNavigation(Navigation.Ending, 1).addNavigation(Navigation.EndRepeat).addNote(0, "A3", NoteLength2.Quarter, { dotted: true, stem: Stem.Up }).addLabel(Label.Chord, "Am").addNote(0, "A3", NoteLength2.Quarter).addNote(0, "A3", NoteLength2.Eighth).addNote(1, "A2", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "E3", NoteLength2.Eighth).addNote(1, "C4", NoteLength2.Eighth).addNote(1, "A2", NoteLength2.Quarter, { dotted: true });
44
+ doc.addMeasure().addNavigation(Navigation.Ending, 2).addNote(0, "A3", NoteLength2.Quarter, { dotted: true, stem: Stem.Up }).addLabel(Label.Chord, "Am").addNote(0, "A3", NoteLength2.Quarter, { dotted: true }).addFermata().addNote(1, "A2", NoteLength2.Eighth, { stem: Stem.Down }).addNote(1, "E3", NoteLength2.Eighth).addNote(1, "C4", NoteLength2.Eighth).addNote(1, "A2", NoteLength2.Quarter, { dotted: true });
45
+ return doc;
46
+ }
47
+
48
+ // src/pieces/andante-diabelli.ts
49
+ import { NoteLength as NoteLength3, ScaleType as ScaleType3 } from "@tspro/web-music-score/theory";
50
+ import { MDocument as MDocument3, NoteAnchor, Navigation as Navigation2, Annotation, StaffPreset as StaffPreset3, Stem as Stem2 } from "@tspro/web-music-score/score";
51
+ function createAndanteByDiabelli() {
52
+ let doc = new MDocument3(StaffPreset3.GuitarTreble);
53
+ doc.setHeader("Andante", "A. Diabelli");
54
+ doc.addMeasure().setKeySignature("D", ScaleType3.Major).setTimeSignature("3/4").setTempo(80).addRest(0, NoteLength3.Eighth, { staffPos: "G4" }).addAnnotation(Annotation.Dynamics, "p").addNote(0, "F#4", NoteLength3.Eighth, { stem: Stem2.Up }).addNote(0, "G4", NoteLength3.Eighth, { slurSpan: 2, slurAnchor: NoteAnchor.Below }).addNote(0, "F#4", NoteLength3.Eighth).addNote(0, "E4", NoteLength3.Eighth).addNote(0, "D4", NoteLength3.Eighth).addNote(1, "D3", NoteLength3.Half, { dotted: true, stem: Stem2.Down });
55
+ doc.addMeasure().addNote(0, "C#4", NoteLength3.Eighth, { slurSpan: 2, slurAnchor: NoteAnchor.Below }).addNote(0, "D4", NoteLength3.Eighth).addNote(0, "E4", NoteLength3.Eighth).addNote(0, "F#4", NoteLength3.Eighth).addNote(0, "G4", NoteLength3.Quarter).addNote(1, "A2", NoteLength3.Half, { dotted: true });
56
+ doc.addMeasure().addRest(0, NoteLength3.Eighth, { staffPos: "B3" }).addAnnotation(Annotation.Dynamics, "f").addNote(0, "A3", NoteLength3.Eighth).addNote(0, "G#3", NoteLength3.Eighth, { slurSpan: 2, slurAnchor: NoteAnchor.Below }).addNote(0, "A3", NoteLength3.Eighth).addNote(0, "B3", NoteLength3.Eighth).addNote(0, "C#4", NoteLength3.Eighth).addNote(1, "A2", NoteLength3.Half, { dotted: true }).endRow();
57
+ doc.addMeasure().addNote(0, "D4", NoteLength3.Eighth).addNote(0, "E4", NoteLength3.Eighth).addNote(0, "F#4", NoteLength3.Eighth).addNote(0, "G4", NoteLength3.Eighth).addNote(0, "A4", NoteLength3.Quarter).addNote(1, "D3", NoteLength3.Half, { dotted: true });
58
+ doc.addMeasure().addRest(0, NoteLength3.Eighth, { staffPos: "G4" }).addAnnotation(Annotation.Dynamics, "p").addNote(0, "F#4", NoteLength3.Eighth).addNote(0, "G4", NoteLength3.Eighth, { slurSpan: 2, slurAnchor: NoteAnchor.Below }).addNote(0, "F#4", NoteLength3.Eighth).addNote(0, "E4", NoteLength3.Eighth).addNote(0, "D4", NoteLength3.Eighth).addNote(1, "D3", NoteLength3.Half, { dotted: true });
59
+ doc.addMeasure().addNote(0, "C#4", NoteLength3.Eighth, { slurSpan: 2, slurAnchor: NoteAnchor.Below }).addNote(0, "D4", NoteLength3.Eighth).addNote(0, "E4", NoteLength3.Eighth).addNote(0, "F#4", NoteLength3.Eighth).addNote(0, "G4", NoteLength3.Quarter).addNote(1, "A2", NoteLength3.Half, { dotted: true }).endRow();
60
+ doc.addMeasure().addRest(0, NoteLength3.Eighth, { staffPos: "B3" }).addAnnotation(Annotation.Dynamics, "f").addNote(0, "A3", NoteLength3.Eighth).addNote(0, "G#3", NoteLength3.Eighth, { slurSpan: 2, slurAnchor: NoteAnchor.Below }).addNote(0, "A3", NoteLength3.Eighth).addNote(0, "B3", NoteLength3.Eighth).addNote(0, "C#4", NoteLength3.Eighth).addNote(1, "A2", NoteLength3.Half, { dotted: true });
61
+ doc.addMeasure().addNote(0, "D4", NoteLength3.Quarter).addRest(1, NoteLength3.Quarter, { staffPos: "D3" }).addNote(0, "D3", NoteLength3.Quarter).addNote(1, "D3", NoteLength3.Quarter).addRest(1, NoteLength3.Quarter, { staffPos: "B3" }).addNavigation(Navigation2.EndRepeat);
62
+ doc.addMeasure().addRest(0, NoteLength3.Eighth, { staffPos: "D4" }).addAnnotation(Annotation.Dynamics, "f").addNote(0, "D4", NoteLength3.Eighth).addNote(0, "E4", NoteLength3.Eighth, { slurSpan: 2, slurAnchor: NoteAnchor.Below }).addNote(0, "D4", NoteLength3.Eighth).addNote(0, "C#4", NoteLength3.Eighth).addNote(0, "B3", NoteLength3.Eighth).addNote(1, "E2", NoteLength3.Half, { dotted: true }).endRow();
63
+ doc.addMeasure().addNote(0, "C#4", NoteLength3.Eighth, { slurSpan: 2, slurAnchor: NoteAnchor.Below }).addNote(0, "D4", NoteLength3.Eighth).addNote(0, "E4", NoteLength3.Eighth).addNote(0, "F#4", NoteLength3.Eighth).addNote(0, "E4", NoteLength3.Quarter).addNote(1, "A2", NoteLength3.Half, { dotted: true });
64
+ doc.addMeasure().addRest(0, NoteLength3.Eighth, { staffPos: "B3" }).addAnnotation(Annotation.Dynamics, "p").addNote(0, "E3", NoteLength3.Eighth).addNote(0, "D#3", NoteLength3.Eighth, { slurSpan: 2, slurAnchor: NoteAnchor.Below }).addNote(0, "E3", NoteLength3.Eighth).addNote(0, "F#3", NoteLength3.Eighth).addNote(0, "G#3", NoteLength3.Eighth).addNote(1, "E2", NoteLength3.Half, { dotted: true });
65
+ doc.addMeasure().addNote(0, "A3", NoteLength3.Eighth, { slurSpan: 2, slurAnchor: NoteAnchor.Below }).addNote(0, "G#3", NoteLength3.Eighth).addNote(0, "A3", NoteLength3.Eighth).addNote(0, "B3", NoteLength3.Eighth).addNote(0, "C#4", NoteLength3.Quarter).addNote(1, "A2", NoteLength3.Half, { dotted: true }).endRow();
66
+ doc.addMeasure().addRest(0, NoteLength3.Eighth, { staffPos: "G4" }).addAnnotation(Annotation.Dynamics, "f").addNote(0, "G4", NoteLength3.Eighth).addNote(0, "A4", NoteLength3.Eighth, { slurSpan: 2, slurAnchor: NoteAnchor.Below }).addNote(0, "G4", NoteLength3.Eighth).addNote(0, "F#4", NoteLength3.Eighth).addNote(0, "E4", NoteLength3.Eighth).addNote(1, "A2", NoteLength3.Half, { dotted: true });
67
+ doc.addMeasure().addNote(0, "D4", NoteLength3.Eighth).addNote(0, "C#4", NoteLength3.Eighth).addNote(0, "D4", NoteLength3.Eighth).addNote(0, "E4", NoteLength3.Eighth).addNote(0, "F#4", NoteLength3.Quarter).addNote(1, "D3", NoteLength3.Half, { dotted: true });
68
+ doc.addMeasure().addRest(0, NoteLength3.Eighth, { staffPos: "B3" }).addAnnotation(Annotation.Dynamics, "ff").addNote(0, "A3", NoteLength3.Eighth).addNote(0, "G#3", NoteLength3.Eighth, { slurSpan: 2, slurAnchor: NoteAnchor.Below }).addNote(0, "A3", NoteLength3.Eighth).addNote(0, "B3", NoteLength3.Eighth).addNote(0, "C#4", NoteLength3.Eighth).addNote(1, "A2", NoteLength3.Half, { dotted: true });
69
+ doc.addMeasure().addNote(0, "D4", NoteLength3.Quarter).addRest(1, NoteLength3.Quarter, { staffPos: "D3" }).addNote(0, "D3", NoteLength3.Quarter).addNote(1, "D3", NoteLength3.Quarter).addRest(1, NoteLength3.Quarter, { staffPos: "B3" }).endSong();
70
+ return doc;
71
+ }
72
+ export {
73
+ createAndanteByDiabelli,
74
+ createFrereJacques,
75
+ createGreensleeves
76
+ };
77
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,169 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { c as Scale, S as ScaleType } from '../tempo-BEJBHZ5I.mjs';
4
+ import { b as PitchNotation, G as GuitarNoteLabel, N as Note } from '../note-CraqEy8x.mjs';
5
+ import { H as Handedness } from '../guitar-kbJYu3Am.mjs';
6
+ import { DivRect, MDocument, ScoreEventListener, MRenderer, MPlaybackButtons } from '../score/index.mjs';
7
+ import '@tspro/ts-utils-lib';
8
+
9
+ /** @public */
10
+ interface CircleOfFifthsProps {
11
+ style?: React.CSSProperties;
12
+ scale: Scale;
13
+ onScaleChange: (scale: Scale) => void;
14
+ }
15
+ /** @public */
16
+ declare class CircleOfFifths extends React.Component<CircleOfFifthsProps, {}> {
17
+ constructor(props: CircleOfFifthsProps);
18
+ onScaleChange(tonic: string, scaleType: ScaleType): void;
19
+ render(): react_jsx_runtime.JSX.Element;
20
+ }
21
+
22
+ /** @public */
23
+ declare class FretPosition {
24
+ readonly guitarCtx: GuitarContext;
25
+ readonly stringId: number;
26
+ readonly fretId: number;
27
+ readonly chromaticId: number;
28
+ readonly note: Note;
29
+ readonly isScaleNote: boolean;
30
+ readonly isScaleRootNote: boolean;
31
+ isVisible: boolean;
32
+ text: string;
33
+ textColor: string;
34
+ fillColor: string | undefined;
35
+ borderColor: string | undefined;
36
+ isBarre: boolean;
37
+ constructor(guitarCtx: GuitarContext, stringId: number, fretId: number, chromaticId: number);
38
+ get chromaticClass(): number;
39
+ show(): void;
40
+ hide(): void;
41
+ setDefaultText(): void;
42
+ setDefaultFillColor(): void;
43
+ setDefaultBorderColor(showBorder?: boolean): void;
44
+ }
45
+ /** @public */
46
+ declare class GuitarContext {
47
+ readonly tuningName: string;
48
+ readonly scale: Scale;
49
+ readonly handedness: Handedness;
50
+ readonly pitchNotation: PitchNotation;
51
+ readonly guitarNoteLabel: GuitarNoteLabel;
52
+ readonly maxFretId: number;
53
+ private readonly fretPositionTable;
54
+ private readonly tuningStrings;
55
+ constructor(tuningName: string, scale: Scale, handedness: Handedness, pitchNotation: PitchNotation, guitarNoteLabel: GuitarNoteLabel);
56
+ getFretPosition(stringId: number, fretId: number): Readonly<FretPosition>;
57
+ getStringTuning(stringId: number): Note;
58
+ getTuningOverview(): string;
59
+ alterTuningName(tuningName: string): GuitarContext;
60
+ alterScale(scale: Scale): GuitarContext;
61
+ alterHandedness(handedness: Handedness): GuitarContext;
62
+ alterPitchNotation(pitchNotation: PitchNotation): GuitarContext;
63
+ alterGuitarNoteLabel(guitarNoteLabel: GuitarNoteLabel): GuitarContext;
64
+ }
65
+
66
+ /** @public */
67
+ declare class FretPositionData {
68
+ readonly fretPosition: Readonly<FretPosition>;
69
+ readonly cellRect: DivRect;
70
+ readonly noteRect: DivRect;
71
+ constructor(fretPosition: Readonly<FretPosition>, cellRect: DivRect, noteRect: DivRect);
72
+ }
73
+ /** @public */
74
+ type UpdateFretPositionFunc = (fretPosition: FretPosition) => void;
75
+ /** @public */
76
+ type ClickFretPositionFunc = (fretPosition: FretPosition) => void;
77
+ /** @public */
78
+ interface GuitarViewProps {
79
+ style?: React.CSSProperties;
80
+ guitarContext: GuitarContext;
81
+ onUpdateFretPosition?: UpdateFretPositionFunc;
82
+ onClickFretPosition?: ClickFretPositionFunc;
83
+ }
84
+ /** @public */
85
+ interface GuitarViewState {
86
+ width: number;
87
+ height: number;
88
+ table: FretPositionData[][];
89
+ }
90
+ /** @public */
91
+ declare class GuitarView extends React.Component<GuitarViewProps, GuitarViewState> {
92
+ state: GuitarViewState;
93
+ constructor(props: GuitarViewProps);
94
+ componentDidUpdate(prevProps: GuitarViewProps): void;
95
+ getLayoutState(): {
96
+ table: FretPositionData[][];
97
+ width: number;
98
+ height: number;
99
+ };
100
+ onHover(fretPositionData?: FretPositionData): void;
101
+ onClick(fretPositionData?: FretPositionData): void;
102
+ render(): react_jsx_runtime.JSX.Element;
103
+ }
104
+
105
+ /** @public */
106
+ interface MusicScoreViewProps {
107
+ doc: MDocument;
108
+ onScoreEvent?: ScoreEventListener;
109
+ }
110
+ /**
111
+ * @public
112
+ *
113
+ * Usage:
114
+ *
115
+ * import * as Score from "\@tspro/web-music-score";
116
+ *
117
+ * \<Score.MusicScoreView doc=\{doc\} /\>
118
+ */
119
+ declare class MusicScoreView extends React.Component<MusicScoreViewProps, {}> {
120
+ renderer: MRenderer;
121
+ constructor(props: MusicScoreViewProps);
122
+ componentDidUpdate(prevProps: Readonly<MusicScoreViewProps>, prevState: Readonly<{}>): void;
123
+ render(): react_jsx_runtime.JSX.Element;
124
+ }
125
+
126
+ /** @public */
127
+ declare enum PlaybackButtonsLayout {
128
+ PlayStopSingle = 0,
129
+ PlayStop = 1,
130
+ PlayPauseStop = 2
131
+ }
132
+ /** @public */
133
+ interface PlaybackButtonsProps {
134
+ doc: MDocument;
135
+ buttonLayout?: PlaybackButtonsLayout;
136
+ playLabel?: string;
137
+ pauseLabel?: string;
138
+ stopLabel?: string;
139
+ }
140
+ /** @public */
141
+ interface PlaybackButtonsState {
142
+ controller: MPlaybackButtons;
143
+ }
144
+ /**
145
+ * @public
146
+ *
147
+ * Usage:
148
+ *
149
+ * import * as Score from "\@tspro/web-music-score";
150
+ *
151
+ * \<Score.PlaybackButtons doc=\{doc\} /\>
152
+ *
153
+ * To set custom play, pause and stop labels:
154
+ *
155
+ * \<Score.PlaybackButtons doc=\{doc\} playLabel="⏵" pauseLabel="⏸" stopLabel="⏹" /\>
156
+ *
157
+ * To use different button layout.
158
+ *
159
+ * \<Score.PlaybackButtons doc=\{doc\} buttonLayout=\{Score.PlaybackButtonsLayout.PlayStopSingle\} /\>
160
+ *
161
+ */
162
+ declare class PlaybackButtons extends React.Component<PlaybackButtonsProps, PlaybackButtonsState> {
163
+ state: PlaybackButtonsState;
164
+ constructor(props: PlaybackButtonsProps);
165
+ componentDidUpdate(prevProps: Readonly<PlaybackButtonsProps>): void;
166
+ render(): react_jsx_runtime.JSX.Element;
167
+ }
168
+
169
+ export { CircleOfFifths, type CircleOfFifthsProps, type ClickFretPositionFunc, FretPosition, FretPositionData, GuitarContext, GuitarView, type GuitarViewProps, type GuitarViewState, MusicScoreView, type MusicScoreViewProps, PlaybackButtons, PlaybackButtonsLayout, type PlaybackButtonsProps, type PlaybackButtonsState, type UpdateFretPositionFunc };