@tspro/web-music-score 3.2.0 → 4.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.
- package/CHANGELOG.md +38 -10
- package/README.md +189 -331
- package/dist/audio/index.d.mts +40 -1
- package/dist/audio/index.d.ts +40 -1
- package/dist/audio/index.js +1 -1
- package/dist/audio/index.mjs +2 -2
- package/dist/audio-cg/index.d.mts +3 -0
- package/dist/audio-cg/index.d.ts +3 -0
- package/dist/audio-cg/index.js +1 -1
- package/dist/audio-cg/index.mjs +2 -2
- package/dist/{chunk-LCTM7BID.mjs → chunk-YFPLOHP2.mjs} +2 -2
- package/dist/core/index.d.mts +12 -0
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.js +3 -2
- package/dist/core/index.mjs +4 -3
- package/dist/guitar-CaZJDA05.d.ts +35 -0
- package/dist/guitar-DdexKdN6.d.mts +35 -0
- package/dist/iife/index.global.js +11 -11
- package/dist/{interface-Bn5HFt_U.d.mts → music-objects-DJQ4d2OA.d.mts} +640 -136
- package/dist/{interface-BlNl69uT.d.ts → music-objects-Dc3kR-XF.d.ts} +640 -136
- package/dist/note-eA2xPPiG.d.mts +294 -0
- package/dist/note-eA2xPPiG.d.ts +294 -0
- package/dist/pieces/index.d.mts +22 -3
- package/dist/pieces/index.d.ts +22 -3
- package/dist/pieces/index.js +7 -7
- package/dist/pieces/index.mjs +11 -11
- package/dist/react-ui/index.d.mts +166 -17
- package/dist/react-ui/index.d.ts +166 -17
- package/dist/react-ui/index.js +78 -1
- package/dist/react-ui/index.mjs +79 -2
- package/dist/scale-B2Icbetz.d.ts +230 -0
- package/dist/scale-BbDJTbrG.d.mts +230 -0
- package/dist/score/index.d.mts +359 -39
- package/dist/score/index.d.ts +359 -39
- package/dist/score/index.js +1252 -594
- package/dist/score/index.mjs +1255 -599
- package/dist/tempo-CtUhvJbr.d.mts +369 -0
- package/dist/tempo-Dt8aHpol.d.ts +369 -0
- package/dist/theory/index.d.mts +29 -13
- package/dist/theory/index.d.ts +29 -13
- package/dist/theory/index.js +583 -96
- package/dist/theory/index.mjs +580 -94
- package/package.json +2 -2
- package/dist/guitar-C2Cp71NZ.d.ts +0 -17
- package/dist/guitar-DggbM2UL.d.mts +0 -17
- package/dist/note-BFa43I86.d.mts +0 -85
- package/dist/note-BFa43I86.d.ts +0 -85
- package/dist/scale-DRR-t4Kr.d.mts +0 -74
- package/dist/scale-ebJm37q1.d.ts +0 -74
- package/dist/tempo-B4h5Ktob.d.mts +0 -104
- package/dist/tempo-DgqDEsn0.d.ts +0 -104
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tspro/web-music-score",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"author": "PahkaSoft",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"package.json"
|
|
93
93
|
],
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@tspro/ts-utils-lib": "^1.
|
|
95
|
+
"@tspro/ts-utils-lib": "^1.6.0",
|
|
96
96
|
"tone": "^15.1.22"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { N as Note } from './note-BFa43I86.js';
|
|
2
|
-
|
|
3
|
-
declare enum Handedness {
|
|
4
|
-
RightHanded = 0,
|
|
5
|
-
LeftHanded = 1
|
|
6
|
-
}
|
|
7
|
-
declare const DefaultHandedness = Handedness.RightHanded;
|
|
8
|
-
declare function validateHandedness(h: unknown): Handedness;
|
|
9
|
-
declare const TuningNameList: ReadonlyArray<string>;
|
|
10
|
-
declare const DefaultTuningName: string;
|
|
11
|
-
declare function validateTuningName(tuningName: string): string;
|
|
12
|
-
/**
|
|
13
|
-
* @returns Array of open string notes, note for each string.
|
|
14
|
-
*/
|
|
15
|
-
declare function getTuningStrings(tuningName: string): ReadonlyArray<Note>;
|
|
16
|
-
|
|
17
|
-
export { DefaultHandedness as D, Handedness as H, TuningNameList as T, DefaultTuningName as a, validateTuningName as b, getTuningStrings as g, validateHandedness as v };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { N as Note } from './note-BFa43I86.mjs';
|
|
2
|
-
|
|
3
|
-
declare enum Handedness {
|
|
4
|
-
RightHanded = 0,
|
|
5
|
-
LeftHanded = 1
|
|
6
|
-
}
|
|
7
|
-
declare const DefaultHandedness = Handedness.RightHanded;
|
|
8
|
-
declare function validateHandedness(h: unknown): Handedness;
|
|
9
|
-
declare const TuningNameList: ReadonlyArray<string>;
|
|
10
|
-
declare const DefaultTuningName: string;
|
|
11
|
-
declare function validateTuningName(tuningName: string): string;
|
|
12
|
-
/**
|
|
13
|
-
* @returns Array of open string notes, note for each string.
|
|
14
|
-
*/
|
|
15
|
-
declare function getTuningStrings(tuningName: string): ReadonlyArray<Note>;
|
|
16
|
-
|
|
17
|
-
export { DefaultHandedness as D, Handedness as H, TuningNameList as T, DefaultTuningName as a, validateTuningName as b, getTuningStrings as g, validateHandedness as v };
|
package/dist/note-BFa43I86.d.mts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
declare enum SymbolSet {
|
|
2
|
-
Ascii = 0,
|
|
3
|
-
Unicode = 1
|
|
4
|
-
}
|
|
5
|
-
declare enum PitchNotation {
|
|
6
|
-
Scientific = 0,
|
|
7
|
-
Helmholtz = 1
|
|
8
|
-
}
|
|
9
|
-
declare const PitchNotationList: PitchNotation[];
|
|
10
|
-
declare const DefaultPitchNotation = PitchNotation.Scientific;
|
|
11
|
-
declare function validatePitchNotation(pn: unknown): PitchNotation;
|
|
12
|
-
declare function getPitchNotationName(pn: PitchNotation): string;
|
|
13
|
-
declare enum GuitarNoteLabel {
|
|
14
|
-
Default = "Default",
|
|
15
|
-
OmitOctave = "Omit Octave",
|
|
16
|
-
Interval = "Interval"
|
|
17
|
-
}
|
|
18
|
-
declare const DefaultGuitarNoteLabel = GuitarNoteLabel.Default;
|
|
19
|
-
declare const GuitarNoteLabelList: GuitarNoteLabel[];
|
|
20
|
-
declare function validateGuitarNoteLabel(label: string): GuitarNoteLabel;
|
|
21
|
-
|
|
22
|
-
type Accidental = -2 | -1 | 0 | 1 | 2;
|
|
23
|
-
type NoteLetter = "C" | "D" | "E" | "F" | "G" | "A" | "B";
|
|
24
|
-
type ParsedNote = {
|
|
25
|
-
noteLetter: NoteLetter;
|
|
26
|
-
accidental: Accidental;
|
|
27
|
-
octave?: number;
|
|
28
|
-
};
|
|
29
|
-
declare class Note {
|
|
30
|
-
private static noteByNameCache;
|
|
31
|
-
private static chromaticNoteCache;
|
|
32
|
-
readonly diatonicClass: number;
|
|
33
|
-
readonly accidental: Accidental;
|
|
34
|
-
readonly octave: number;
|
|
35
|
-
constructor(diatonicId: number, accidental: number);
|
|
36
|
-
constructor(diatonicClass: number, accidental: number, octave: number);
|
|
37
|
-
constructor(noteLetter: string, accidental: number, octave: number);
|
|
38
|
-
get diatonicId(): number;
|
|
39
|
-
get chromaticId(): number;
|
|
40
|
-
get midiNumber(): number;
|
|
41
|
-
get chromaticClass(): number;
|
|
42
|
-
get noteLetter(): NoteLetter;
|
|
43
|
-
format(pitchNotation: PitchNotation, symbolSet: SymbolSet): string;
|
|
44
|
-
formatOmitOctave(symbolSet: SymbolSet): string;
|
|
45
|
-
static getNote(noteName: string): Note;
|
|
46
|
-
static getChromaticNote(chromaticId: number): Note;
|
|
47
|
-
static getDiatonicClass(diatonicId: number): number;
|
|
48
|
-
static getDiatonicClass(noteName: string): number;
|
|
49
|
-
static getOctaveFromDiatonicId(diatonicId: number): number;
|
|
50
|
-
static getDiatonicIdInOctave(diatonicId: number, octave: number): number;
|
|
51
|
-
static getChromaticClass(chromaticId: number): number;
|
|
52
|
-
static getOctaveFromChromaticId(chromaticId: number): number;
|
|
53
|
-
static getChromaticIdInOctave(chromaticId: number, octave: number): number;
|
|
54
|
-
static equals(a: Note | null | undefined, b: Note | null | undefined): boolean;
|
|
55
|
-
static replaceAccidentalSymbols(str: string, symbolSet: SymbolSet): string;
|
|
56
|
-
static isValidNoteName(noteName: string): boolean;
|
|
57
|
-
static parseNote(noteName: string): Readonly<ParsedNote> | undefined;
|
|
58
|
-
static getScientificNoteName(noteName: string, symbolSet: SymbolSet): string;
|
|
59
|
-
static getAccidentalSymbol(accidental: Accidental, symbolsSet: SymbolSet): string | undefined;
|
|
60
|
-
static getAccidental(accidentalSymbol: string): Accidental;
|
|
61
|
-
static getNoteLetter(diatonicId: number): NoteLetter;
|
|
62
|
-
static findNextDiatonicIdAbove(diatonicId: number, bottomDiatonicId: number, addOctaveIfEqual: boolean): number;
|
|
63
|
-
static validateDiatonicId(diatonicId: number): number;
|
|
64
|
-
static validateDiatonicClass(diatonicClass: number): number;
|
|
65
|
-
static validateChromaticId(chromaticId: number): number;
|
|
66
|
-
static validatechromaticClass(chromaticClass: number): number;
|
|
67
|
-
static validateNoteLetter(note: string): NoteLetter;
|
|
68
|
-
static validateOctave(octave: number): number;
|
|
69
|
-
static validateAccidental(acc: number): Accidental;
|
|
70
|
-
/**
|
|
71
|
-
* Sort notes by diatonicId in ascending order.
|
|
72
|
-
* @param notes - Array of notes.
|
|
73
|
-
* @returns Sorted array of notes.
|
|
74
|
-
*/
|
|
75
|
-
static sort(notes: ReadonlyArray<Note>): Note[];
|
|
76
|
-
/**
|
|
77
|
-
* Remove duplicate notes.
|
|
78
|
-
* @param notes - Array of notes.
|
|
79
|
-
* @returns Sorted set of notes.
|
|
80
|
-
*/
|
|
81
|
-
static removeDuplicates(notes: ReadonlyArray<Note>): Note[];
|
|
82
|
-
static compareFunc(a: Note, b: Note): 1 | -1 | 0;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
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 };
|
package/dist/note-BFa43I86.d.ts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
declare enum SymbolSet {
|
|
2
|
-
Ascii = 0,
|
|
3
|
-
Unicode = 1
|
|
4
|
-
}
|
|
5
|
-
declare enum PitchNotation {
|
|
6
|
-
Scientific = 0,
|
|
7
|
-
Helmholtz = 1
|
|
8
|
-
}
|
|
9
|
-
declare const PitchNotationList: PitchNotation[];
|
|
10
|
-
declare const DefaultPitchNotation = PitchNotation.Scientific;
|
|
11
|
-
declare function validatePitchNotation(pn: unknown): PitchNotation;
|
|
12
|
-
declare function getPitchNotationName(pn: PitchNotation): string;
|
|
13
|
-
declare enum GuitarNoteLabel {
|
|
14
|
-
Default = "Default",
|
|
15
|
-
OmitOctave = "Omit Octave",
|
|
16
|
-
Interval = "Interval"
|
|
17
|
-
}
|
|
18
|
-
declare const DefaultGuitarNoteLabel = GuitarNoteLabel.Default;
|
|
19
|
-
declare const GuitarNoteLabelList: GuitarNoteLabel[];
|
|
20
|
-
declare function validateGuitarNoteLabel(label: string): GuitarNoteLabel;
|
|
21
|
-
|
|
22
|
-
type Accidental = -2 | -1 | 0 | 1 | 2;
|
|
23
|
-
type NoteLetter = "C" | "D" | "E" | "F" | "G" | "A" | "B";
|
|
24
|
-
type ParsedNote = {
|
|
25
|
-
noteLetter: NoteLetter;
|
|
26
|
-
accidental: Accidental;
|
|
27
|
-
octave?: number;
|
|
28
|
-
};
|
|
29
|
-
declare class Note {
|
|
30
|
-
private static noteByNameCache;
|
|
31
|
-
private static chromaticNoteCache;
|
|
32
|
-
readonly diatonicClass: number;
|
|
33
|
-
readonly accidental: Accidental;
|
|
34
|
-
readonly octave: number;
|
|
35
|
-
constructor(diatonicId: number, accidental: number);
|
|
36
|
-
constructor(diatonicClass: number, accidental: number, octave: number);
|
|
37
|
-
constructor(noteLetter: string, accidental: number, octave: number);
|
|
38
|
-
get diatonicId(): number;
|
|
39
|
-
get chromaticId(): number;
|
|
40
|
-
get midiNumber(): number;
|
|
41
|
-
get chromaticClass(): number;
|
|
42
|
-
get noteLetter(): NoteLetter;
|
|
43
|
-
format(pitchNotation: PitchNotation, symbolSet: SymbolSet): string;
|
|
44
|
-
formatOmitOctave(symbolSet: SymbolSet): string;
|
|
45
|
-
static getNote(noteName: string): Note;
|
|
46
|
-
static getChromaticNote(chromaticId: number): Note;
|
|
47
|
-
static getDiatonicClass(diatonicId: number): number;
|
|
48
|
-
static getDiatonicClass(noteName: string): number;
|
|
49
|
-
static getOctaveFromDiatonicId(diatonicId: number): number;
|
|
50
|
-
static getDiatonicIdInOctave(diatonicId: number, octave: number): number;
|
|
51
|
-
static getChromaticClass(chromaticId: number): number;
|
|
52
|
-
static getOctaveFromChromaticId(chromaticId: number): number;
|
|
53
|
-
static getChromaticIdInOctave(chromaticId: number, octave: number): number;
|
|
54
|
-
static equals(a: Note | null | undefined, b: Note | null | undefined): boolean;
|
|
55
|
-
static replaceAccidentalSymbols(str: string, symbolSet: SymbolSet): string;
|
|
56
|
-
static isValidNoteName(noteName: string): boolean;
|
|
57
|
-
static parseNote(noteName: string): Readonly<ParsedNote> | undefined;
|
|
58
|
-
static getScientificNoteName(noteName: string, symbolSet: SymbolSet): string;
|
|
59
|
-
static getAccidentalSymbol(accidental: Accidental, symbolsSet: SymbolSet): string | undefined;
|
|
60
|
-
static getAccidental(accidentalSymbol: string): Accidental;
|
|
61
|
-
static getNoteLetter(diatonicId: number): NoteLetter;
|
|
62
|
-
static findNextDiatonicIdAbove(diatonicId: number, bottomDiatonicId: number, addOctaveIfEqual: boolean): number;
|
|
63
|
-
static validateDiatonicId(diatonicId: number): number;
|
|
64
|
-
static validateDiatonicClass(diatonicClass: number): number;
|
|
65
|
-
static validateChromaticId(chromaticId: number): number;
|
|
66
|
-
static validatechromaticClass(chromaticClass: number): number;
|
|
67
|
-
static validateNoteLetter(note: string): NoteLetter;
|
|
68
|
-
static validateOctave(octave: number): number;
|
|
69
|
-
static validateAccidental(acc: number): Accidental;
|
|
70
|
-
/**
|
|
71
|
-
* Sort notes by diatonicId in ascending order.
|
|
72
|
-
* @param notes - Array of notes.
|
|
73
|
-
* @returns Sorted array of notes.
|
|
74
|
-
*/
|
|
75
|
-
static sort(notes: ReadonlyArray<Note>): Note[];
|
|
76
|
-
/**
|
|
77
|
-
* Remove duplicate notes.
|
|
78
|
-
* @param notes - Array of notes.
|
|
79
|
-
* @returns Sorted set of notes.
|
|
80
|
-
*/
|
|
81
|
-
static removeDuplicates(notes: ReadonlyArray<Note>): Note[];
|
|
82
|
-
static compareFunc(a: Note, b: Note): 1 | -1 | 0;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
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,74 +0,0 @@
|
|
|
1
|
-
import { N as Note, S as SymbolSet } from './note-BFa43I86.mjs';
|
|
2
|
-
import { K as KeySignature } from './tempo-B4h5Ktob.mjs';
|
|
3
|
-
|
|
4
|
-
type IntervalDirection = "Unison" | "Ascending" | "Descending";
|
|
5
|
-
type IntervalQuality = "Perfect" | "Major" | "minor" | "Augmented" | "Doubly Augmented" | "diminished" | "doubly diminished";
|
|
6
|
-
declare function validateIntervalQuality(q: string): IntervalQuality;
|
|
7
|
-
declare class Interval {
|
|
8
|
-
readonly note1: Note;
|
|
9
|
-
readonly note2: Note;
|
|
10
|
-
readonly direction: IntervalDirection;
|
|
11
|
-
readonly semitones: number;
|
|
12
|
-
readonly quantity: number;
|
|
13
|
-
readonly quality: IntervalQuality;
|
|
14
|
-
private constructor();
|
|
15
|
-
static get(note1: Note, note2: Note): Interval | undefined;
|
|
16
|
-
toString(): string;
|
|
17
|
-
toAbbrString(): string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
type Degree = 1 | 2 | "b3" | 3 | 4 | "b5" | 5 | "#5" | 6 | "bb7" | "b7" | 7 | "#7" | "b9" | 9 | "#9" | 11 | 13;
|
|
21
|
-
declare enum ScaleType {
|
|
22
|
-
Major = "Major",
|
|
23
|
-
NaturalMinor = "Natural Minor",
|
|
24
|
-
HarmonicMinor = "Harmonic Minor",
|
|
25
|
-
Ionian = "Ionian",
|
|
26
|
-
Dorian = "Dorian",
|
|
27
|
-
Phrygian = "Phrygian",
|
|
28
|
-
Lydian = "Lydian",
|
|
29
|
-
Mixolydian = "Mixolydian",
|
|
30
|
-
Aeolian = "Aeolian",
|
|
31
|
-
Locrian = "Locrian",
|
|
32
|
-
MajorPentatonic = "Major Pentatonic",
|
|
33
|
-
MinorPentatonic = "Minor Pentatonic",
|
|
34
|
-
MajorHexatonicBlues = "Major Hexatonic Blues",
|
|
35
|
-
MinorHexatonicBlues = "Minor Hexatonic Blues",
|
|
36
|
-
HeptatonicBlues = "Heptatonic Blues"
|
|
37
|
-
}
|
|
38
|
-
declare class Scale extends KeySignature {
|
|
39
|
-
readonly tonic: string;
|
|
40
|
-
readonly scaleType: ScaleType;
|
|
41
|
-
private readonly scaleDegrees;
|
|
42
|
-
private readonly scaleNotes;
|
|
43
|
-
private readonly chromaticClassDegree;
|
|
44
|
-
constructor(tonic: string, scaleType: ScaleType);
|
|
45
|
-
static equals(a: Scale | null | undefined, b: Scale | null | undefined): boolean;
|
|
46
|
-
getScaleName(symbolSet?: SymbolSet): string;
|
|
47
|
-
getScaleNotes(bottomNote: string, numOctaves: number): Note[];
|
|
48
|
-
getScaleOverview(): string;
|
|
49
|
-
getScaleSteps(): number[];
|
|
50
|
-
getScaleStringSteps(): string[];
|
|
51
|
-
isScaleNote(note: Note): boolean;
|
|
52
|
-
isScaleRootNote(note: Note): boolean;
|
|
53
|
-
getIntervalFromRootNote(note: Note): Interval;
|
|
54
|
-
private preferredChromaticNoteCache;
|
|
55
|
-
getPreferredChromaticNote(chromaticId: number): Note;
|
|
56
|
-
}
|
|
57
|
-
declare class ScaleFactory {
|
|
58
|
-
readonly type: ScaleType;
|
|
59
|
-
private tonicList;
|
|
60
|
-
private scaleMap;
|
|
61
|
-
constructor(type: ScaleType);
|
|
62
|
-
getTonicList(): ReadonlyArray<string>;
|
|
63
|
-
getDefaultTonic(): string;
|
|
64
|
-
getType(): ScaleType;
|
|
65
|
-
getScale(tonic: string): Scale;
|
|
66
|
-
hasScale(tonic: string): boolean;
|
|
67
|
-
}
|
|
68
|
-
declare function getScaleFactoryList(): ReadonlyArray<ScaleFactory | string>;
|
|
69
|
-
declare function getScaleFactory(scaleType: ScaleType): ScaleFactory;
|
|
70
|
-
declare function validateScaleType(scaleType: unknown): ScaleType;
|
|
71
|
-
declare function getScale(tonic: string, scaleType: ScaleType): Scale;
|
|
72
|
-
declare function getDefaultScale(): Scale;
|
|
73
|
-
|
|
74
|
-
export { type Degree as D, type IntervalDirection as I, ScaleType as S, 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, validateIntervalQuality as v };
|
package/dist/scale-ebJm37q1.d.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { N as Note, S as SymbolSet } from './note-BFa43I86.js';
|
|
2
|
-
import { K as KeySignature } from './tempo-DgqDEsn0.js';
|
|
3
|
-
|
|
4
|
-
type IntervalDirection = "Unison" | "Ascending" | "Descending";
|
|
5
|
-
type IntervalQuality = "Perfect" | "Major" | "minor" | "Augmented" | "Doubly Augmented" | "diminished" | "doubly diminished";
|
|
6
|
-
declare function validateIntervalQuality(q: string): IntervalQuality;
|
|
7
|
-
declare class Interval {
|
|
8
|
-
readonly note1: Note;
|
|
9
|
-
readonly note2: Note;
|
|
10
|
-
readonly direction: IntervalDirection;
|
|
11
|
-
readonly semitones: number;
|
|
12
|
-
readonly quantity: number;
|
|
13
|
-
readonly quality: IntervalQuality;
|
|
14
|
-
private constructor();
|
|
15
|
-
static get(note1: Note, note2: Note): Interval | undefined;
|
|
16
|
-
toString(): string;
|
|
17
|
-
toAbbrString(): string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
type Degree = 1 | 2 | "b3" | 3 | 4 | "b5" | 5 | "#5" | 6 | "bb7" | "b7" | 7 | "#7" | "b9" | 9 | "#9" | 11 | 13;
|
|
21
|
-
declare enum ScaleType {
|
|
22
|
-
Major = "Major",
|
|
23
|
-
NaturalMinor = "Natural Minor",
|
|
24
|
-
HarmonicMinor = "Harmonic Minor",
|
|
25
|
-
Ionian = "Ionian",
|
|
26
|
-
Dorian = "Dorian",
|
|
27
|
-
Phrygian = "Phrygian",
|
|
28
|
-
Lydian = "Lydian",
|
|
29
|
-
Mixolydian = "Mixolydian",
|
|
30
|
-
Aeolian = "Aeolian",
|
|
31
|
-
Locrian = "Locrian",
|
|
32
|
-
MajorPentatonic = "Major Pentatonic",
|
|
33
|
-
MinorPentatonic = "Minor Pentatonic",
|
|
34
|
-
MajorHexatonicBlues = "Major Hexatonic Blues",
|
|
35
|
-
MinorHexatonicBlues = "Minor Hexatonic Blues",
|
|
36
|
-
HeptatonicBlues = "Heptatonic Blues"
|
|
37
|
-
}
|
|
38
|
-
declare class Scale extends KeySignature {
|
|
39
|
-
readonly tonic: string;
|
|
40
|
-
readonly scaleType: ScaleType;
|
|
41
|
-
private readonly scaleDegrees;
|
|
42
|
-
private readonly scaleNotes;
|
|
43
|
-
private readonly chromaticClassDegree;
|
|
44
|
-
constructor(tonic: string, scaleType: ScaleType);
|
|
45
|
-
static equals(a: Scale | null | undefined, b: Scale | null | undefined): boolean;
|
|
46
|
-
getScaleName(symbolSet?: SymbolSet): string;
|
|
47
|
-
getScaleNotes(bottomNote: string, numOctaves: number): Note[];
|
|
48
|
-
getScaleOverview(): string;
|
|
49
|
-
getScaleSteps(): number[];
|
|
50
|
-
getScaleStringSteps(): string[];
|
|
51
|
-
isScaleNote(note: Note): boolean;
|
|
52
|
-
isScaleRootNote(note: Note): boolean;
|
|
53
|
-
getIntervalFromRootNote(note: Note): Interval;
|
|
54
|
-
private preferredChromaticNoteCache;
|
|
55
|
-
getPreferredChromaticNote(chromaticId: number): Note;
|
|
56
|
-
}
|
|
57
|
-
declare class ScaleFactory {
|
|
58
|
-
readonly type: ScaleType;
|
|
59
|
-
private tonicList;
|
|
60
|
-
private scaleMap;
|
|
61
|
-
constructor(type: ScaleType);
|
|
62
|
-
getTonicList(): ReadonlyArray<string>;
|
|
63
|
-
getDefaultTonic(): string;
|
|
64
|
-
getType(): ScaleType;
|
|
65
|
-
getScale(tonic: string): Scale;
|
|
66
|
-
hasScale(tonic: string): boolean;
|
|
67
|
-
}
|
|
68
|
-
declare function getScaleFactoryList(): ReadonlyArray<ScaleFactory | string>;
|
|
69
|
-
declare function getScaleFactory(scaleType: ScaleType): ScaleFactory;
|
|
70
|
-
declare function validateScaleType(scaleType: unknown): ScaleType;
|
|
71
|
-
declare function getScale(tonic: string, scaleType: ScaleType): Scale;
|
|
72
|
-
declare function getDefaultScale(): Scale;
|
|
73
|
-
|
|
74
|
-
export { type Degree as D, type IntervalDirection as I, ScaleType as S, 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, validateIntervalQuality as v };
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { N as Note, A as Accidental } from './note-BFa43I86.mjs';
|
|
2
|
-
|
|
3
|
-
declare enum Mode {
|
|
4
|
-
Ionian = 1,
|
|
5
|
-
Dorian = 2,
|
|
6
|
-
Phrygian = 3,
|
|
7
|
-
Lydian = 4,
|
|
8
|
-
Mixolydian = 5,
|
|
9
|
-
Aeolian = 6,
|
|
10
|
-
Locrian = 7
|
|
11
|
-
}
|
|
12
|
-
declare enum AccidentalType {
|
|
13
|
-
Natural = 0,
|
|
14
|
-
Flats = 1,
|
|
15
|
-
Sharps = 2
|
|
16
|
-
}
|
|
17
|
-
declare function getDefaultKeySignature(): KeySignature;
|
|
18
|
-
declare class KeySignature {
|
|
19
|
-
readonly tonic: string;
|
|
20
|
-
readonly mode: Mode;
|
|
21
|
-
private static readonly OrderOfSharps;
|
|
22
|
-
private static readonly OrderOfFlats;
|
|
23
|
-
private readonly naturalScaleNotes;
|
|
24
|
-
private readonly accidentalByDiatonicClass;
|
|
25
|
-
private readonly orderedAccidentedNotes;
|
|
26
|
-
/**
|
|
27
|
-
* @param tonic - Tonic/root note.
|
|
28
|
-
* @param mode - Mode: Ionian/Major = 1, Dorian = 2, ..., Locrian = 7
|
|
29
|
-
*/
|
|
30
|
-
protected constructor(tonic: string, mode: Mode);
|
|
31
|
-
getAccidentalType(): AccidentalType;
|
|
32
|
-
getNaturalScaleNotes(): ReadonlyArray<Note>;
|
|
33
|
-
getAccidental(diatonicId: number): Accidental;
|
|
34
|
-
getNumAccidentals(): number;
|
|
35
|
-
getOrderedAccidentalNotes(): ReadonlyArray<Note>;
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
* @param degree - number 1..7 or string e.g "b5" or "#4"
|
|
39
|
-
* @returns
|
|
40
|
-
*/
|
|
41
|
-
getNoteByDegree(degree: number | string): Note;
|
|
42
|
-
static equals(a: KeySignature | null | undefined, b: KeySignature | null | undefined): boolean;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
declare enum NoteLength {
|
|
46
|
-
Whole = 192,// * 3 because triplets are multiplied by 2 / 3, integer result
|
|
47
|
-
Half = 96,
|
|
48
|
-
Quarter = 48,
|
|
49
|
-
Eighth = 24,
|
|
50
|
-
Sixteenth = 12,
|
|
51
|
-
ThirtySecond = 6,
|
|
52
|
-
SixtyFourth = 3
|
|
53
|
-
}
|
|
54
|
-
declare const MaxNoteLength = NoteLength.Whole;
|
|
55
|
-
declare const MinNoteLength = NoteLength.SixtyFourth;
|
|
56
|
-
declare function validateNoteLength(noteLength: unknown): NoteLength;
|
|
57
|
-
declare class RhythmProps {
|
|
58
|
-
readonly noteLength: NoteLength;
|
|
59
|
-
readonly dotted: boolean;
|
|
60
|
-
readonly triplet: boolean;
|
|
61
|
-
readonly ticks: number;
|
|
62
|
-
readonly flagCount: number;
|
|
63
|
-
constructor(noteLength: NoteLength, dotted?: boolean, triplet?: boolean);
|
|
64
|
-
static createFromNoteSize(noteSize: number): RhythmProps;
|
|
65
|
-
canDot(): boolean;
|
|
66
|
-
hasStem(): boolean;
|
|
67
|
-
toString(): string;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
type TimeSignatureString = "2/4" | "3/4" | "4/4" | "6/8" | "9/8";
|
|
71
|
-
declare class TimeSignature {
|
|
72
|
-
readonly beatCount: number;
|
|
73
|
-
readonly beatSize: number;
|
|
74
|
-
/** Lengths in ticks */
|
|
75
|
-
readonly beatLength: NoteLength;
|
|
76
|
-
readonly measureTicks: number;
|
|
77
|
-
readonly beamGroupCount: number;
|
|
78
|
-
readonly beamGroupLength: number;
|
|
79
|
-
/**
|
|
80
|
-
* @param str - For example "4/4".
|
|
81
|
-
*/
|
|
82
|
-
constructor(str: TimeSignatureString);
|
|
83
|
-
/**
|
|
84
|
-
* @param beatCount - Measure beat count.
|
|
85
|
-
* @param beatSize - Size value: whole-note=1, half-note=2, quarter-note=4, etc.
|
|
86
|
-
*/
|
|
87
|
-
constructor(beatCount: number, beatSize: number);
|
|
88
|
-
is(beatCount: number, beatSize: number): boolean;
|
|
89
|
-
toString(): string;
|
|
90
|
-
}
|
|
91
|
-
declare function getDefaultTimeSignature(): TimeSignature;
|
|
92
|
-
|
|
93
|
-
type Tempo = {
|
|
94
|
-
beatsPerMinute: number;
|
|
95
|
-
options: {
|
|
96
|
-
beatLength: NoteLength;
|
|
97
|
-
dotted: boolean;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
declare function getDefaultTempo(): Readonly<Tempo>;
|
|
101
|
-
declare function getTempoString(tempo: Tempo): string;
|
|
102
|
-
declare function alterTempoSpeed(tempo: Tempo, speed: number): Tempo;
|
|
103
|
-
|
|
104
|
-
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 };
|
package/dist/tempo-DgqDEsn0.d.ts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { N as Note, A as Accidental } from './note-BFa43I86.js';
|
|
2
|
-
|
|
3
|
-
declare enum Mode {
|
|
4
|
-
Ionian = 1,
|
|
5
|
-
Dorian = 2,
|
|
6
|
-
Phrygian = 3,
|
|
7
|
-
Lydian = 4,
|
|
8
|
-
Mixolydian = 5,
|
|
9
|
-
Aeolian = 6,
|
|
10
|
-
Locrian = 7
|
|
11
|
-
}
|
|
12
|
-
declare enum AccidentalType {
|
|
13
|
-
Natural = 0,
|
|
14
|
-
Flats = 1,
|
|
15
|
-
Sharps = 2
|
|
16
|
-
}
|
|
17
|
-
declare function getDefaultKeySignature(): KeySignature;
|
|
18
|
-
declare class KeySignature {
|
|
19
|
-
readonly tonic: string;
|
|
20
|
-
readonly mode: Mode;
|
|
21
|
-
private static readonly OrderOfSharps;
|
|
22
|
-
private static readonly OrderOfFlats;
|
|
23
|
-
private readonly naturalScaleNotes;
|
|
24
|
-
private readonly accidentalByDiatonicClass;
|
|
25
|
-
private readonly orderedAccidentedNotes;
|
|
26
|
-
/**
|
|
27
|
-
* @param tonic - Tonic/root note.
|
|
28
|
-
* @param mode - Mode: Ionian/Major = 1, Dorian = 2, ..., Locrian = 7
|
|
29
|
-
*/
|
|
30
|
-
protected constructor(tonic: string, mode: Mode);
|
|
31
|
-
getAccidentalType(): AccidentalType;
|
|
32
|
-
getNaturalScaleNotes(): ReadonlyArray<Note>;
|
|
33
|
-
getAccidental(diatonicId: number): Accidental;
|
|
34
|
-
getNumAccidentals(): number;
|
|
35
|
-
getOrderedAccidentalNotes(): ReadonlyArray<Note>;
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
* @param degree - number 1..7 or string e.g "b5" or "#4"
|
|
39
|
-
* @returns
|
|
40
|
-
*/
|
|
41
|
-
getNoteByDegree(degree: number | string): Note;
|
|
42
|
-
static equals(a: KeySignature | null | undefined, b: KeySignature | null | undefined): boolean;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
declare enum NoteLength {
|
|
46
|
-
Whole = 192,// * 3 because triplets are multiplied by 2 / 3, integer result
|
|
47
|
-
Half = 96,
|
|
48
|
-
Quarter = 48,
|
|
49
|
-
Eighth = 24,
|
|
50
|
-
Sixteenth = 12,
|
|
51
|
-
ThirtySecond = 6,
|
|
52
|
-
SixtyFourth = 3
|
|
53
|
-
}
|
|
54
|
-
declare const MaxNoteLength = NoteLength.Whole;
|
|
55
|
-
declare const MinNoteLength = NoteLength.SixtyFourth;
|
|
56
|
-
declare function validateNoteLength(noteLength: unknown): NoteLength;
|
|
57
|
-
declare class RhythmProps {
|
|
58
|
-
readonly noteLength: NoteLength;
|
|
59
|
-
readonly dotted: boolean;
|
|
60
|
-
readonly triplet: boolean;
|
|
61
|
-
readonly ticks: number;
|
|
62
|
-
readonly flagCount: number;
|
|
63
|
-
constructor(noteLength: NoteLength, dotted?: boolean, triplet?: boolean);
|
|
64
|
-
static createFromNoteSize(noteSize: number): RhythmProps;
|
|
65
|
-
canDot(): boolean;
|
|
66
|
-
hasStem(): boolean;
|
|
67
|
-
toString(): string;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
type TimeSignatureString = "2/4" | "3/4" | "4/4" | "6/8" | "9/8";
|
|
71
|
-
declare class TimeSignature {
|
|
72
|
-
readonly beatCount: number;
|
|
73
|
-
readonly beatSize: number;
|
|
74
|
-
/** Lengths in ticks */
|
|
75
|
-
readonly beatLength: NoteLength;
|
|
76
|
-
readonly measureTicks: number;
|
|
77
|
-
readonly beamGroupCount: number;
|
|
78
|
-
readonly beamGroupLength: number;
|
|
79
|
-
/**
|
|
80
|
-
* @param str - For example "4/4".
|
|
81
|
-
*/
|
|
82
|
-
constructor(str: TimeSignatureString);
|
|
83
|
-
/**
|
|
84
|
-
* @param beatCount - Measure beat count.
|
|
85
|
-
* @param beatSize - Size value: whole-note=1, half-note=2, quarter-note=4, etc.
|
|
86
|
-
*/
|
|
87
|
-
constructor(beatCount: number, beatSize: number);
|
|
88
|
-
is(beatCount: number, beatSize: number): boolean;
|
|
89
|
-
toString(): string;
|
|
90
|
-
}
|
|
91
|
-
declare function getDefaultTimeSignature(): TimeSignature;
|
|
92
|
-
|
|
93
|
-
type Tempo = {
|
|
94
|
-
beatsPerMinute: number;
|
|
95
|
-
options: {
|
|
96
|
-
beatLength: NoteLength;
|
|
97
|
-
dotted: boolean;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
declare function getDefaultTempo(): Readonly<Tempo>;
|
|
101
|
-
declare function getTempoString(tempo: Tempo): string;
|
|
102
|
-
declare function alterTempoSpeed(tempo: Tempo, speed: number): Tempo;
|
|
103
|
-
|
|
104
|
-
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 };
|