@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.
Files changed (38) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +144 -63
  3. package/dist/audio/index.d.mts +1 -1
  4. package/dist/audio/index.js +1 -1
  5. package/dist/audio/index.mjs +2 -2
  6. package/dist/audio-cg/index.js +1 -1
  7. package/dist/audio-cg/index.mjs +2 -2
  8. package/dist/{chunk-2EPWQZKJ.mjs → chunk-ZWFAOHYM.mjs} +2 -2
  9. package/dist/core/index.js +2 -2
  10. package/dist/core/index.mjs +3 -3
  11. package/dist/{guitar-kbJYu3Am.d.mts → guitar-zASF7B1g.d.mts} +1 -1
  12. package/dist/iife/index.global.js +11 -12
  13. package/dist/interface-CLb7xa7_.d.mts +1768 -0
  14. package/dist/interface-DXyXwLBB.d.ts +1768 -0
  15. package/dist/{note-CraqEy8x.d.mts → note-B5ZtlHc8.d.mts} +1 -1
  16. package/dist/pieces/index.d.mts +3 -3
  17. package/dist/pieces/index.d.ts +2 -2
  18. package/dist/pieces/index.js +4 -52
  19. package/dist/pieces/index.mjs +8 -56
  20. package/dist/react-ui/index.d.mts +5 -4
  21. package/dist/react-ui/index.d.ts +3 -2
  22. package/dist/react-ui/index.js +1 -1
  23. package/dist/react-ui/index.mjs +2 -2
  24. package/dist/scale-B_2MZaT9.d.ts +87 -0
  25. package/dist/scale-C-YS5iVG.d.mts +87 -0
  26. package/dist/score/index.d.mts +42 -1557
  27. package/dist/score/index.d.ts +42 -1557
  28. package/dist/score/index.js +2845 -2029
  29. package/dist/score/index.mjs +2813 -2007
  30. package/dist/tempo-DoJd-UYT.d.ts +120 -0
  31. package/dist/tempo-TjQKn46X.d.mts +120 -0
  32. package/dist/theory/index.d.mts +6 -5
  33. package/dist/theory/index.d.ts +3 -2
  34. package/dist/theory/index.js +1 -1
  35. package/dist/theory/index.mjs +2 -2
  36. package/package.json +1 -1
  37. package/dist/tempo--588tdcv.d.ts +0 -203
  38. package/dist/tempo-BEJBHZ5I.d.mts +0 -203
@@ -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 };
@@ -1,8 +1,9 @@
1
- import { N as Note } from '../note-CraqEy8x.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-CraqEy8x.mjs';
3
- import { D as Degree } from '../tempo-BEJBHZ5I.mjs';
4
- export { A as AccidentalType, b as Interval, I as IntervalDirection, a as IntervalQuality, K as KeySignature, q as MaxNoteLength, r as MinNoteLength, M as Mode, N as NoteLength, R as RhythmProps, c as Scale, d as ScaleFactory, S as ScaleType, m as Tempo, k as TimeSignature, T as TimeSignatureString, p as alterTempoSpeed, j as getDefaultKeySignature, i as getDefaultScale, n as getDefaultTempo, l as getDefaultTimeSignature, h as getScale, e as getScaleFactory, g as getScaleFactoryList, o as getTempoString, v as validateIntervalQuality, s as validateNoteLength, f as validateScaleType } from '../tempo-BEJBHZ5I.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-kbJYu3Am.mjs';
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';
6
7
 
7
8
  /** @public */
8
9
  type ChordInfo = {
@@ -1,8 +1,9 @@
1
1
  import { N as Note } from '../note-B5ZtlHc8.js';
2
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 '../tempo--588tdcv.js';
4
- export { A as AccidentalType, b as Interval, I as IntervalDirection, a as IntervalQuality, K as KeySignature, q as MaxNoteLength, r as MinNoteLength, M as Mode, N as NoteLength, R as RhythmProps, c as Scale, d as ScaleFactory, S as ScaleType, m as Tempo, k as TimeSignature, T as TimeSignatureString, p as alterTempoSpeed, j as getDefaultKeySignature, i as getDefaultScale, n as getDefaultTempo, l as getDefaultTimeSignature, h as getScale, e as getScaleFactory, g as getScaleFactoryList, o as getTempoString, v as validateIntervalQuality, s as validateNoteLength, f as validateScaleType } from '../tempo--588tdcv.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
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';
6
7
 
7
8
  /** @public */
8
9
  type ChordInfo = {
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v2.0.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
1
+ /* WebMusicScore v3.0.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,7 +1,7 @@
1
- /* WebMusicScore v2.0.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
1
+ /* WebMusicScore v3.0.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
2
2
  import {
3
3
  __publicField
4
- } from "../chunk-2EPWQZKJ.mjs";
4
+ } from "../chunk-ZWFAOHYM.mjs";
5
5
 
6
6
  // src/theory/chord.ts
7
7
  import { Utils as Utils6 } from "@tspro/ts-utils-lib";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tspro/web-music-score",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
4
4
  "author": "PahkaSoft",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -1,203 +0,0 @@
1
- import { N as Note, A as Accidental, S as SymbolSet } 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
- 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 };