@k-l-lambda/lilylet 0.1.40 → 0.1.44
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/lib/index.js
CHANGED
|
@@ -6,3 +6,5 @@ import * as musicXmlDecoder from "./musicXmlDecoder.js";
|
|
|
6
6
|
import * as lilypondEncoder from "./lilypondEncoder.js";
|
|
7
7
|
import * as musicXmlEncoder from "./musicXmlEncoder.js";
|
|
8
8
|
export { meiEncoder, musicXmlDecoder, lilypondEncoder, musicXmlEncoder, };
|
|
9
|
+
// Note: lilypondDecoder is optional and requires @k-l-lambda/lotus
|
|
10
|
+
// Import it directly from '@k-l-lambda/lilylet/lib/lilypondDecoder.js' if needed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k-l-lambda/lilylet",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.44",
|
|
4
4
|
"description": "Lilylet is a lilyopnd-like sheet music language designed for Markdown rendering and symbolic music representation in AIGC applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
package/source/lilylet/index.ts
CHANGED
|
@@ -595,7 +595,7 @@ const parseLilyDocument = (lilyDocument: lilyParser.LilyDocument): ParsedMeasure
|
|
|
595
595
|
if (timeSigStr !== lastTimeSig) {
|
|
596
596
|
voice.events.push({
|
|
597
597
|
type: 'context',
|
|
598
|
-
|
|
598
|
+
time: {
|
|
599
599
|
numerator: context.time.value.numerator,
|
|
600
600
|
denominator: context.time.value.denominator,
|
|
601
601
|
},
|
|
@@ -841,12 +841,12 @@ const parseLilyDocument = (lilyDocument: lilyParser.LilyDocument): ParsedMeasure
|
|
|
841
841
|
|
|
842
842
|
// Remove the last noteCount note/rest events from voice.events
|
|
843
843
|
// (they were already added by the Chord/Rest handlers)
|
|
844
|
-
const tupletEvents:
|
|
844
|
+
const tupletEvents: (NoteEvent | RestEvent)[] = [];
|
|
845
845
|
let removed = 0;
|
|
846
846
|
while (removed < noteCount && voice.events.length > 0) {
|
|
847
847
|
const lastEvent = voice.events[voice.events.length - 1];
|
|
848
848
|
if (lastEvent.type === 'note' || lastEvent.type === 'rest') {
|
|
849
|
-
tupletEvents.unshift(voice.events.pop()!);
|
|
849
|
+
tupletEvents.unshift(voice.events.pop()! as NoteEvent | RestEvent);
|
|
850
850
|
removed++;
|
|
851
851
|
} else {
|
|
852
852
|
break; // Stop if we hit a non-note/rest event
|