@tspro/web-music-score 2.0.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.
- package/CHANGELOG.md +15 -0
- package/README.md +144 -63
- package/dist/audio/index.d.mts +1 -1
- package/dist/audio/index.js +1 -1
- package/dist/audio/index.mjs +2 -2
- package/dist/audio-cg/index.js +1 -1
- package/dist/audio-cg/index.mjs +2 -2
- package/dist/{chunk-2EPWQZKJ.mjs → chunk-ZWFAOHYM.mjs} +2 -2
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +3 -3
- package/dist/{guitar-kbJYu3Am.d.mts → guitar-zASF7B1g.d.mts} +1 -1
- package/dist/iife/index.global.js +11 -12
- package/dist/interface-CLb7xa7_.d.mts +1768 -0
- package/dist/interface-DXyXwLBB.d.ts +1768 -0
- package/dist/{note-CraqEy8x.d.mts → note-B5ZtlHc8.d.mts} +1 -1
- package/dist/pieces/index.d.mts +3 -3
- package/dist/pieces/index.d.ts +2 -2
- package/dist/pieces/index.js +4 -52
- package/dist/pieces/index.mjs +8 -56
- package/dist/react-ui/index.d.mts +5 -4
- package/dist/react-ui/index.d.ts +3 -2
- package/dist/react-ui/index.js +1 -1
- package/dist/react-ui/index.mjs +2 -2
- package/dist/scale-B_2MZaT9.d.ts +87 -0
- package/dist/scale-C-YS5iVG.d.mts +87 -0
- package/dist/score/index.d.mts +42 -1557
- package/dist/score/index.d.ts +42 -1557
- package/dist/score/index.js +2845 -2029
- package/dist/score/index.mjs +2813 -2007
- package/dist/tempo-DoJd-UYT.d.ts +120 -0
- package/dist/tempo-TjQKn46X.d.mts +120 -0
- package/dist/theory/index.d.mts +6 -5
- package/dist/theory/index.d.ts +3 -2
- package/dist/theory/index.js +1 -1
- package/dist/theory/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/tempo--588tdcv.d.ts +0 -203
- package/dist/tempo-BEJBHZ5I.d.mts +0 -203
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { N as Note, A as Accidental, S as SymbolSet } from './note-CraqEy8x.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
|
-
type IntervalDirection = "Unison" | "Ascending" | "Descending";
|
|
51
|
-
/** @public */
|
|
52
|
-
type IntervalQuality = "Perfect" | "Major" | "minor" | "Augmented" | "Doubly Augmented" | "diminished" | "doubly diminished";
|
|
53
|
-
/** @public */
|
|
54
|
-
declare function validateIntervalQuality(q: string): IntervalQuality;
|
|
55
|
-
/** @public */
|
|
56
|
-
declare class Interval {
|
|
57
|
-
readonly note1: Note;
|
|
58
|
-
readonly note2: Note;
|
|
59
|
-
readonly direction: IntervalDirection;
|
|
60
|
-
readonly semitones: number;
|
|
61
|
-
readonly quantity: number;
|
|
62
|
-
readonly quality: IntervalQuality;
|
|
63
|
-
private constructor();
|
|
64
|
-
static get(note1: Note, note2: Note): Interval | undefined;
|
|
65
|
-
toString(): string;
|
|
66
|
-
toAbbrString(): string;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/** @public */
|
|
70
|
-
type Degree = 1 | 2 | "b3" | 3 | 4 | "b5" | 5 | "#5" | 6 | "bb7" | "b7" | 7 | "#7" | "b9" | 9 | "#9" | 11 | 13;
|
|
71
|
-
/** @public */
|
|
72
|
-
declare enum ScaleType {
|
|
73
|
-
Major = "Major",
|
|
74
|
-
NaturalMinor = "Natural Minor",
|
|
75
|
-
HarmonicMinor = "Harmonic Minor",
|
|
76
|
-
Ionian = "Ionian",
|
|
77
|
-
Dorian = "Dorian",
|
|
78
|
-
Phrygian = "Phrygian",
|
|
79
|
-
Lydian = "Lydian",
|
|
80
|
-
Mixolydian = "Mixolydian",
|
|
81
|
-
Aeolian = "Aeolian",
|
|
82
|
-
Locrian = "Locrian",
|
|
83
|
-
MajorPentatonic = "Major Pentatonic",
|
|
84
|
-
MinorPentatonic = "Minor Pentatonic",
|
|
85
|
-
MajorHexatonicBlues = "Major Hexatonic Blues",
|
|
86
|
-
MinorHexatonicBlues = "Minor Hexatonic Blues",
|
|
87
|
-
HeptatonicBlues = "Heptatonic Blues"
|
|
88
|
-
}
|
|
89
|
-
/** @public */
|
|
90
|
-
declare class Scale extends KeySignature {
|
|
91
|
-
readonly tonic: string;
|
|
92
|
-
readonly scaleType: ScaleType;
|
|
93
|
-
private readonly scaleDegrees;
|
|
94
|
-
private readonly scaleNotes;
|
|
95
|
-
private readonly chromaticClassDegree;
|
|
96
|
-
constructor(tonic: string, scaleType: ScaleType);
|
|
97
|
-
static equals(a: Scale | null | undefined, b: Scale | null | undefined): boolean;
|
|
98
|
-
getScaleName(symbolSet?: SymbolSet): string;
|
|
99
|
-
getScaleNotes(bottomNote: string, numOctaves: number): Note[];
|
|
100
|
-
getScaleOverview(): string;
|
|
101
|
-
getScaleSteps(): number[];
|
|
102
|
-
getScaleStringSteps(): string[];
|
|
103
|
-
isScaleNote(note: Note): boolean;
|
|
104
|
-
isScaleRootNote(note: Note): boolean;
|
|
105
|
-
getIntervalFromRootNote(note: Note): Interval;
|
|
106
|
-
private preferredChromaticNoteCache;
|
|
107
|
-
getPreferredChromaticNote(chromaticId: number): Note;
|
|
108
|
-
}
|
|
109
|
-
/** @public */
|
|
110
|
-
declare class ScaleFactory {
|
|
111
|
-
readonly type: ScaleType;
|
|
112
|
-
private tonicList;
|
|
113
|
-
private scaleMap;
|
|
114
|
-
constructor(type: ScaleType);
|
|
115
|
-
getTonicList(): ReadonlyArray<string>;
|
|
116
|
-
getDefaultTonic(): string;
|
|
117
|
-
getType(): ScaleType;
|
|
118
|
-
getScale(tonic: string): Scale;
|
|
119
|
-
hasScale(tonic: string): boolean;
|
|
120
|
-
}
|
|
121
|
-
/** @public */
|
|
122
|
-
declare function getScaleFactoryList(): ReadonlyArray<ScaleFactory | string>;
|
|
123
|
-
/** @public */
|
|
124
|
-
declare function getScaleFactory(scaleType: ScaleType): ScaleFactory;
|
|
125
|
-
/** @public */
|
|
126
|
-
declare function validateScaleType(scaleType: unknown): ScaleType;
|
|
127
|
-
/** @public */
|
|
128
|
-
declare function getScale(tonic: string, scaleType: ScaleType): Scale;
|
|
129
|
-
/** @public */
|
|
130
|
-
declare function getDefaultScale(): Scale;
|
|
131
|
-
|
|
132
|
-
/** @public */
|
|
133
|
-
declare enum NoteLength {
|
|
134
|
-
Whole = 192,// * 3 because triplets are multiplied by 2 / 3, integer result
|
|
135
|
-
Half = 96,
|
|
136
|
-
Quarter = 48,
|
|
137
|
-
Eighth = 24,
|
|
138
|
-
Sixteenth = 12,
|
|
139
|
-
ThirtySecond = 6,
|
|
140
|
-
SixtyFourth = 3
|
|
141
|
-
}
|
|
142
|
-
/** @public */
|
|
143
|
-
declare const MaxNoteLength = NoteLength.Whole;
|
|
144
|
-
/** @public */
|
|
145
|
-
declare const MinNoteLength = NoteLength.SixtyFourth;
|
|
146
|
-
/** @public */
|
|
147
|
-
declare function validateNoteLength(noteLength: unknown): NoteLength;
|
|
148
|
-
/** @public */
|
|
149
|
-
declare class RhythmProps {
|
|
150
|
-
readonly noteLength: NoteLength;
|
|
151
|
-
readonly dotted: boolean;
|
|
152
|
-
readonly triplet: boolean;
|
|
153
|
-
readonly ticks: number;
|
|
154
|
-
readonly flagCount: number;
|
|
155
|
-
constructor(noteLength: NoteLength, dotted?: boolean, triplet?: boolean);
|
|
156
|
-
static createFromNoteSize(noteSize: number): RhythmProps;
|
|
157
|
-
canDot(): boolean;
|
|
158
|
-
hasStem(): boolean;
|
|
159
|
-
toString(): string;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/** @public */
|
|
163
|
-
type TimeSignatureString = "2/4" | "3/4" | "4/4" | "6/8" | "9/8";
|
|
164
|
-
/** @public */
|
|
165
|
-
declare class TimeSignature {
|
|
166
|
-
readonly beatCount: number;
|
|
167
|
-
readonly beatSize: number;
|
|
168
|
-
/** Lengths in ticks */
|
|
169
|
-
readonly beatLength: NoteLength;
|
|
170
|
-
readonly measureTicks: number;
|
|
171
|
-
readonly beamGroupCount: number;
|
|
172
|
-
readonly beamGroupLength: number;
|
|
173
|
-
/**
|
|
174
|
-
* @param str - For example "4/4".
|
|
175
|
-
*/
|
|
176
|
-
constructor(str: TimeSignatureString);
|
|
177
|
-
/**
|
|
178
|
-
* @param beatCount - Measure beat count.
|
|
179
|
-
* @param beatSize - Size value: whole-note=1, half-note=2, quarter-note=4, etc.
|
|
180
|
-
*/
|
|
181
|
-
constructor(beatCount: number, beatSize: number);
|
|
182
|
-
is(beatCount: number, beatSize: number): boolean;
|
|
183
|
-
toString(): string;
|
|
184
|
-
}
|
|
185
|
-
/** @public */
|
|
186
|
-
declare function getDefaultTimeSignature(): TimeSignature;
|
|
187
|
-
|
|
188
|
-
/** @public */
|
|
189
|
-
type Tempo = {
|
|
190
|
-
beatsPerMinute: number;
|
|
191
|
-
options: {
|
|
192
|
-
beatLength: NoteLength;
|
|
193
|
-
dotted: boolean;
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
/** @public */
|
|
197
|
-
declare function getDefaultTempo(): Readonly<Tempo>;
|
|
198
|
-
/** @public */
|
|
199
|
-
declare function getTempoString(tempo: Tempo): string;
|
|
200
|
-
/** @public */
|
|
201
|
-
declare function alterTempoSpeed(tempo: Tempo, speed: number): Tempo;
|
|
202
|
-
|
|
203
|
-
export { AccidentalType as A, type Degree as D, type IntervalDirection as I, KeySignature as K, Mode as M, NoteLength as N, RhythmProps as R, ScaleType as S, type TimeSignatureString as T, type IntervalQuality as a, Interval as b, Scale as c, ScaleFactory as d, getScaleFactory as e, validateScaleType as f, getScaleFactoryList as g, getScale as h, getDefaultScale as i, getDefaultKeySignature as j, TimeSignature as k, getDefaultTimeSignature as l, type Tempo as m, getDefaultTempo as n, getTempoString as o, alterTempoSpeed as p, MaxNoteLength as q, MinNoteLength as r, validateNoteLength as s, validateIntervalQuality as v };
|