@scorelabs/core 1.0.2 → 1.0.4
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/README.md +10 -10
- package/dist/importers/MusicXMLParser.d.ts +2 -0
- package/dist/importers/MusicXMLParser.js +388 -78
- package/dist/models/Instrument.d.ts +1 -0
- package/dist/models/Instrument.js +13 -2
- package/dist/models/Measure.js +22 -5
- package/dist/models/Note.d.ts +31 -6
- package/dist/models/Note.js +104 -39
- package/dist/models/NoteSet.d.ts +14 -3
- package/dist/models/NoteSet.js +125 -26
- package/dist/models/Pitch.js +7 -1
- package/dist/models/Score.d.ts +5 -1
- package/dist/models/Score.js +58 -25
- package/dist/models/types.d.ts +16 -2
- package/dist/models/types.js +11 -0
- package/dist/utils/tier.d.ts +36 -0
- package/dist/utils/tier.js +112 -0
- package/package.json +34 -31
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ const c4 = new Note(new Pitch('C', 4), Duration.Quarter);
|
|
|
43
43
|
const noteSet = new NoteSet([c4]);
|
|
44
44
|
|
|
45
45
|
// Transpose up a whole step
|
|
46
|
-
const d4Set = noteSet.transpose(2);
|
|
46
|
+
const d4Set = noteSet.transpose(2);
|
|
47
47
|
|
|
48
48
|
console.log(d4Set.pitch.toString()); // "D4"
|
|
49
49
|
```
|
|
@@ -52,15 +52,15 @@ console.log(d4Set.pitch.toString()); // "D4"
|
|
|
52
52
|
|
|
53
53
|
The library is organized into two main modules:
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
- **`models/`**: Contains the data structures representing musical elements.
|
|
56
|
+
- `Score`: The root object representing a musical piece.
|
|
57
|
+
- `Part`: Represents a single instrument or voice within a score.
|
|
58
|
+
- `Staff`: A collection of measures for a specific part.
|
|
59
|
+
- `Measure`: Contains musical events like notes, rests, and directions.
|
|
60
|
+
- `NoteSet`: A grouping of simultaneous `Note` objects (chords).
|
|
61
|
+
- `Note`: The fundamental musical unit containing pitch, duration, and stylistic attributes.
|
|
62
|
+
- **`importers/`**: logic for importing external formats.
|
|
63
|
+
- `MusicXMLParser`: Converts MusicXML data into the internal object model.
|
|
64
64
|
|
|
65
65
|
## Development
|
|
66
66
|
|
|
@@ -9,6 +9,7 @@ export declare class MusicXMLParser {
|
|
|
9
9
|
private currentKeyFifths;
|
|
10
10
|
private currentBeats;
|
|
11
11
|
private currentBeatType;
|
|
12
|
+
private currentSymbol;
|
|
12
13
|
private instrumentPitchMap;
|
|
13
14
|
private _domParser;
|
|
14
15
|
constructor(domParserInstance?: any);
|
|
@@ -23,6 +24,7 @@ export declare class MusicXMLParser {
|
|
|
23
24
|
private parsePart;
|
|
24
25
|
private parseNote;
|
|
25
26
|
private parseHarmony;
|
|
27
|
+
private parseFrame;
|
|
26
28
|
private parseBarlines;
|
|
27
29
|
private postProcess;
|
|
28
30
|
private cleanAccidentals;
|