@tspro/web-music-score 1.1.0 → 3.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 (47) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +337 -204
  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-ZWFAOHYM.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-zASF7B1g.d.mts +24 -0
  18. package/dist/iife/index.global.js +221 -0
  19. package/dist/interface-CLb7xa7_.d.mts +1768 -0
  20. package/dist/interface-DXyXwLBB.d.ts +1768 -0
  21. package/dist/note-B5ZtlHc8.d.mts +99 -0
  22. package/dist/note-B5ZtlHc8.d.ts +99 -0
  23. package/dist/pieces/index.d.mts +15 -0
  24. package/dist/pieces/index.d.ts +15 -0
  25. package/dist/pieces/index.js +56 -0
  26. package/dist/pieces/index.mjs +29 -0
  27. package/dist/react-ui/index.d.mts +170 -0
  28. package/dist/react-ui/index.d.ts +170 -0
  29. package/dist/react-ui/index.js +624 -0
  30. package/dist/react-ui/index.mjs +582 -0
  31. package/dist/scale-B_2MZaT9.d.ts +87 -0
  32. package/dist/scale-C-YS5iVG.d.mts +87 -0
  33. package/dist/score/index.d.mts +43 -0
  34. package/dist/score/index.d.ts +43 -0
  35. package/dist/score/index.js +7753 -0
  36. package/dist/score/index.mjs +7669 -0
  37. package/dist/tempo-DoJd-UYT.d.ts +120 -0
  38. package/dist/tempo-TjQKn46X.d.mts +120 -0
  39. package/dist/theory/index.d.mts +48 -0
  40. package/dist/theory/index.d.ts +48 -0
  41. package/dist/theory/index.js +1783 -0
  42. package/dist/theory/index.mjs +1716 -0
  43. package/package.json +98 -55
  44. package/dist/index.cjs.js +0 -41053
  45. package/dist/index.d.ts +0 -1281
  46. package/dist/index.esm.mjs +0 -41044
  47. package/dist/index.umd.min.js +0 -9
@@ -0,0 +1,120 @@
1
+ import { N as Note, A as Accidental } from './note-B5ZtlHc8.js';
2
+
3
+ /** @public */
4
+ declare enum Mode {
5
+ Ionian = 1,
6
+ Dorian = 2,
7
+ Phrygian = 3,
8
+ Lydian = 4,
9
+ Mixolydian = 5,
10
+ Aeolian = 6,
11
+ Locrian = 7
12
+ }
13
+ /** @public */
14
+ declare enum AccidentalType {
15
+ Natural = 0,
16
+ Flats = 1,
17
+ Sharps = 2
18
+ }
19
+ /** @public */
20
+ declare function getDefaultKeySignature(): KeySignature;
21
+ /** @public */
22
+ declare class KeySignature {
23
+ readonly tonic: string;
24
+ readonly mode: Mode;
25
+ private static readonly OrderOfSharps;
26
+ private static readonly OrderOfFlats;
27
+ private readonly naturalScaleNotes;
28
+ private readonly accidentalByDiatonicClass;
29
+ private readonly orderedAccidentedNotes;
30
+ /**
31
+ * @param tonic - Tonic/root note.
32
+ * @param mode - Mode: Ionian/Major = 1, Dorian = 2, ..., Locrian = 7
33
+ */
34
+ protected constructor(tonic: string, mode: Mode);
35
+ getAccidentalType(): AccidentalType;
36
+ getNaturalScaleNotes(): ReadonlyArray<Note>;
37
+ getAccidental(diatonicId: number): Accidental;
38
+ getNumAccidentals(): number;
39
+ getOrderedAccidentalNotes(): ReadonlyArray<Note>;
40
+ /**
41
+ *
42
+ * @param degree - number 1..7 or string e.g "b5" or "#4"
43
+ * @returns
44
+ */
45
+ getNoteByDegree(degree: number | string): Note;
46
+ static equals(a: KeySignature | null | undefined, b: KeySignature | null | undefined): boolean;
47
+ }
48
+
49
+ /** @public */
50
+ declare enum NoteLength {
51
+ Whole = 192,// * 3 because triplets are multiplied by 2 / 3, integer result
52
+ Half = 96,
53
+ Quarter = 48,
54
+ Eighth = 24,
55
+ Sixteenth = 12,
56
+ ThirtySecond = 6,
57
+ SixtyFourth = 3
58
+ }
59
+ /** @public */
60
+ declare const MaxNoteLength = NoteLength.Whole;
61
+ /** @public */
62
+ declare const MinNoteLength = NoteLength.SixtyFourth;
63
+ /** @public */
64
+ declare function validateNoteLength(noteLength: unknown): NoteLength;
65
+ /** @public */
66
+ declare class RhythmProps {
67
+ readonly noteLength: NoteLength;
68
+ readonly dotted: boolean;
69
+ readonly triplet: boolean;
70
+ readonly ticks: number;
71
+ readonly flagCount: number;
72
+ constructor(noteLength: NoteLength, dotted?: boolean, triplet?: boolean);
73
+ static createFromNoteSize(noteSize: number): RhythmProps;
74
+ canDot(): boolean;
75
+ hasStem(): boolean;
76
+ toString(): string;
77
+ }
78
+
79
+ /** @public */
80
+ type TimeSignatureString = "2/4" | "3/4" | "4/4" | "6/8" | "9/8";
81
+ /** @public */
82
+ declare class TimeSignature {
83
+ readonly beatCount: number;
84
+ readonly beatSize: number;
85
+ /** Lengths in ticks */
86
+ readonly beatLength: NoteLength;
87
+ readonly measureTicks: number;
88
+ readonly beamGroupCount: number;
89
+ readonly beamGroupLength: number;
90
+ /**
91
+ * @param str - For example "4/4".
92
+ */
93
+ constructor(str: TimeSignatureString);
94
+ /**
95
+ * @param beatCount - Measure beat count.
96
+ * @param beatSize - Size value: whole-note=1, half-note=2, quarter-note=4, etc.
97
+ */
98
+ constructor(beatCount: number, beatSize: number);
99
+ is(beatCount: number, beatSize: number): boolean;
100
+ toString(): string;
101
+ }
102
+ /** @public */
103
+ declare function getDefaultTimeSignature(): TimeSignature;
104
+
105
+ /** @public */
106
+ type Tempo = {
107
+ beatsPerMinute: number;
108
+ options: {
109
+ beatLength: NoteLength;
110
+ dotted: boolean;
111
+ };
112
+ };
113
+ /** @public */
114
+ declare function getDefaultTempo(): Readonly<Tempo>;
115
+ /** @public */
116
+ declare function getTempoString(tempo: Tempo): string;
117
+ /** @public */
118
+ declare function alterTempoSpeed(tempo: Tempo, speed: number): Tempo;
119
+
120
+ 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, MaxNoteLength as h, MinNoteLength as i, validateNoteLength as v };
@@ -0,0 +1,120 @@
1
+ import { N as Note, A as Accidental } from './note-B5ZtlHc8.mjs';
2
+
3
+ /** @public */
4
+ declare enum Mode {
5
+ Ionian = 1,
6
+ Dorian = 2,
7
+ Phrygian = 3,
8
+ Lydian = 4,
9
+ Mixolydian = 5,
10
+ Aeolian = 6,
11
+ Locrian = 7
12
+ }
13
+ /** @public */
14
+ declare enum AccidentalType {
15
+ Natural = 0,
16
+ Flats = 1,
17
+ Sharps = 2
18
+ }
19
+ /** @public */
20
+ declare function getDefaultKeySignature(): KeySignature;
21
+ /** @public */
22
+ declare class KeySignature {
23
+ readonly tonic: string;
24
+ readonly mode: Mode;
25
+ private static readonly OrderOfSharps;
26
+ private static readonly OrderOfFlats;
27
+ private readonly naturalScaleNotes;
28
+ private readonly accidentalByDiatonicClass;
29
+ private readonly orderedAccidentedNotes;
30
+ /**
31
+ * @param tonic - Tonic/root note.
32
+ * @param mode - Mode: Ionian/Major = 1, Dorian = 2, ..., Locrian = 7
33
+ */
34
+ protected constructor(tonic: string, mode: Mode);
35
+ getAccidentalType(): AccidentalType;
36
+ getNaturalScaleNotes(): ReadonlyArray<Note>;
37
+ getAccidental(diatonicId: number): Accidental;
38
+ getNumAccidentals(): number;
39
+ getOrderedAccidentalNotes(): ReadonlyArray<Note>;
40
+ /**
41
+ *
42
+ * @param degree - number 1..7 or string e.g "b5" or "#4"
43
+ * @returns
44
+ */
45
+ getNoteByDegree(degree: number | string): Note;
46
+ static equals(a: KeySignature | null | undefined, b: KeySignature | null | undefined): boolean;
47
+ }
48
+
49
+ /** @public */
50
+ declare enum NoteLength {
51
+ Whole = 192,// * 3 because triplets are multiplied by 2 / 3, integer result
52
+ Half = 96,
53
+ Quarter = 48,
54
+ Eighth = 24,
55
+ Sixteenth = 12,
56
+ ThirtySecond = 6,
57
+ SixtyFourth = 3
58
+ }
59
+ /** @public */
60
+ declare const MaxNoteLength = NoteLength.Whole;
61
+ /** @public */
62
+ declare const MinNoteLength = NoteLength.SixtyFourth;
63
+ /** @public */
64
+ declare function validateNoteLength(noteLength: unknown): NoteLength;
65
+ /** @public */
66
+ declare class RhythmProps {
67
+ readonly noteLength: NoteLength;
68
+ readonly dotted: boolean;
69
+ readonly triplet: boolean;
70
+ readonly ticks: number;
71
+ readonly flagCount: number;
72
+ constructor(noteLength: NoteLength, dotted?: boolean, triplet?: boolean);
73
+ static createFromNoteSize(noteSize: number): RhythmProps;
74
+ canDot(): boolean;
75
+ hasStem(): boolean;
76
+ toString(): string;
77
+ }
78
+
79
+ /** @public */
80
+ type TimeSignatureString = "2/4" | "3/4" | "4/4" | "6/8" | "9/8";
81
+ /** @public */
82
+ declare class TimeSignature {
83
+ readonly beatCount: number;
84
+ readonly beatSize: number;
85
+ /** Lengths in ticks */
86
+ readonly beatLength: NoteLength;
87
+ readonly measureTicks: number;
88
+ readonly beamGroupCount: number;
89
+ readonly beamGroupLength: number;
90
+ /**
91
+ * @param str - For example "4/4".
92
+ */
93
+ constructor(str: TimeSignatureString);
94
+ /**
95
+ * @param beatCount - Measure beat count.
96
+ * @param beatSize - Size value: whole-note=1, half-note=2, quarter-note=4, etc.
97
+ */
98
+ constructor(beatCount: number, beatSize: number);
99
+ is(beatCount: number, beatSize: number): boolean;
100
+ toString(): string;
101
+ }
102
+ /** @public */
103
+ declare function getDefaultTimeSignature(): TimeSignature;
104
+
105
+ /** @public */
106
+ type Tempo = {
107
+ beatsPerMinute: number;
108
+ options: {
109
+ beatLength: NoteLength;
110
+ dotted: boolean;
111
+ };
112
+ };
113
+ /** @public */
114
+ declare function getDefaultTempo(): Readonly<Tempo>;
115
+ /** @public */
116
+ declare function getTempoString(tempo: Tempo): string;
117
+ /** @public */
118
+ declare function alterTempoSpeed(tempo: Tempo, speed: number): Tempo;
119
+
120
+ 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, MaxNoteLength as h, MinNoteLength as i, validateNoteLength as v };
@@ -0,0 +1,48 @@
1
+ import { N as Note } from '../note-B5ZtlHc8.mjs';
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-B5ZtlHc8.mjs';
3
+ import { D as Degree } from '../scale-C-YS5iVG.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-C-YS5iVG.mjs';
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-zASF7B1g.mjs';
6
+ export { A as AccidentalType, K as KeySignature, h as MaxNoteLength, i as MinNoteLength, M as Mode, N as NoteLength, R as RhythmProps, c as Tempo, a as TimeSignature, T as TimeSignatureString, f as alterTempoSpeed, g as getDefaultKeySignature, d as getDefaultTempo, b as getDefaultTimeSignature, e as getTempoString, v as validateNoteLength } from '../tempo-TjQKn46X.mjs';
7
+
8
+ /** @public */
9
+ type ChordInfo = {
10
+ name: string;
11
+ degrees: Degree[];
12
+ };
13
+ /** @public */
14
+ declare class Chord {
15
+ readonly chordInfo: ChordInfo;
16
+ readonly rootNote: Note;
17
+ readonly name: string;
18
+ readonly notes: Note[];
19
+ readonly omitNotes: boolean[];
20
+ readonly slashBassNote?: Note;
21
+ private constructor();
22
+ static getChords(notes: ReadonlyArray<Note>): ReadonlyArray<Chord>;
23
+ private replaceWith;
24
+ /**
25
+ * @returns Chord name e.g. "C/B"
26
+ */
27
+ toString(): string;
28
+ /**
29
+ * @returns Degree notation string, e.g. "E - 1(C) - 3(E) - 5(G)"
30
+ */
31
+ getDegreeNotationString(): string;
32
+ /**
33
+ * @returns Omitted degrees string e.g. "Omits 5(G), 9(D)"
34
+ */
35
+ getOmittedDegreesString(): string;
36
+ /**
37
+ * @param i - Degree index
38
+ * @returns Degree string for given degree index, e.g. "3"
39
+ */
40
+ private getDegreeStr;
41
+ /**
42
+ * @param i - Degree index
43
+ * @returns Note string for given degree index, e.g. "E"
44
+ */
45
+ private getNoteStr;
46
+ }
47
+
48
+ export { Chord, type ChordInfo, Degree, Note };
@@ -0,0 +1,48 @@
1
+ import { N as Note } from '../note-B5ZtlHc8.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-B5ZtlHc8.js';
3
+ import { D as Degree } from '../scale-B_2MZaT9.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-B_2MZaT9.js';
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-BIFwFT31.js';
6
+ export { A as AccidentalType, K as KeySignature, h as MaxNoteLength, i as MinNoteLength, M as Mode, N as NoteLength, R as RhythmProps, c as Tempo, a as TimeSignature, T as TimeSignatureString, f as alterTempoSpeed, g as getDefaultKeySignature, d as getDefaultTempo, b as getDefaultTimeSignature, e as getTempoString, v as validateNoteLength } from '../tempo-DoJd-UYT.js';
7
+
8
+ /** @public */
9
+ type ChordInfo = {
10
+ name: string;
11
+ degrees: Degree[];
12
+ };
13
+ /** @public */
14
+ declare class Chord {
15
+ readonly chordInfo: ChordInfo;
16
+ readonly rootNote: Note;
17
+ readonly name: string;
18
+ readonly notes: Note[];
19
+ readonly omitNotes: boolean[];
20
+ readonly slashBassNote?: Note;
21
+ private constructor();
22
+ static getChords(notes: ReadonlyArray<Note>): ReadonlyArray<Chord>;
23
+ private replaceWith;
24
+ /**
25
+ * @returns Chord name e.g. "C/B"
26
+ */
27
+ toString(): string;
28
+ /**
29
+ * @returns Degree notation string, e.g. "E - 1(C) - 3(E) - 5(G)"
30
+ */
31
+ getDegreeNotationString(): string;
32
+ /**
33
+ * @returns Omitted degrees string e.g. "Omits 5(G), 9(D)"
34
+ */
35
+ getOmittedDegreesString(): string;
36
+ /**
37
+ * @param i - Degree index
38
+ * @returns Degree string for given degree index, e.g. "3"
39
+ */
40
+ private getDegreeStr;
41
+ /**
42
+ * @param i - Degree index
43
+ * @returns Note string for given degree index, e.g. "E"
44
+ */
45
+ private getNoteStr;
46
+ }
47
+
48
+ export { Chord, type ChordInfo, Degree, Note };