@k-l-lambda/lilylet 0.1.34 → 0.1.36
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 +30 -25
- package/lib/grammar.jison.js +193 -153
- package/lib/meiEncoder.js +135 -28
- package/lib/musicXmlDecoder.js +4 -4
- package/lib/serializer.js +93 -21
- package/lib/types.d.ts +4 -1
- package/package.json +1 -1
- package/source/lilylet/grammar.jison.js +193 -153
- package/source/lilylet/lilylet.jison +46 -7
- package/source/lilylet/meiEncoder.ts +152 -28
- package/source/lilylet/musicXmlDecoder.ts +4 -4
- package/source/lilylet/serializer.ts +119 -23
- package/source/lilylet/types.ts +7 -1
- package/lib/lilypondDecoder.d.ts +0 -28
- package/lib/lilypondDecoder.js +0 -645
package/README.md
CHANGED
|
@@ -1,7 +1,37 @@
|
|
|
1
1
|
# Lilylet
|
|
2
2
|
|
|
3
|
+

|
|
4
|
+
|
|
3
5
|
Lilylet is a LilyPond-like music notation language designed for Markdown rendering and symbolic music representation in AIGC applications.
|
|
4
6
|
|
|
7
|
+
## Hello World
|
|
8
|
+
|
|
9
|
+
```lyl
|
|
10
|
+
\key c \major \time 4/4 \clef "treble" c1 \bar "|."
|
|
11
|
+
```
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## A Comprehensive Example
|
|
16
|
+
|
|
17
|
+
```lyl
|
|
18
|
+
[title "Jesu, meine Freude"]
|
|
19
|
+
[subtitle "BWV 610"]
|
|
20
|
+
[composer "J.S. Bach"]
|
|
21
|
+
|
|
22
|
+
\staff "1" \key c \minor \time 4/4 \clef "treble" \stemUp g'4 g f ef \\
|
|
23
|
+
\staff "1" \stemDown ef16[ d ef8]~ ef16[ f ef d] c8[ d]~ d[ c] \\
|
|
24
|
+
\staff "2" \clef "bass" c16[ b c8]~ c16[ b c g] a8[ g]~ g16[ g af ef] \\
|
|
25
|
+
\staff "3" \clef "bass" r8 c,16[ d] ef[ d ef8]~ ef16[ a, b g] c[ b c8] | % 1
|
|
26
|
+
|
|
27
|
+
\staff "1" \stemUp d2 c\fermata \\
|
|
28
|
+
\staff "1" \stemDown c8[ c4 b8] c8.[ \staff "2" \stemUp g16] \staff "1" c[ b c d] \\
|
|
29
|
+
\staff "2" f,16[ ef f d] g[ af g f] ef[ d ef8]~ ef16[ f ef d] \\
|
|
30
|
+
\staff "3" r16 g,[ af f] g[ f g8] c,2 | % 2
|
|
31
|
+
```
|
|
32
|
+

|
|
33
|
+
|
|
34
|
+
|
|
5
35
|
## Try It Online
|
|
6
36
|
|
|
7
37
|
- [Live Editor](https://k-l-lambda.github.io/lilylet-live-editor/) - Interactive editor with real-time music notation rendering
|
|
@@ -33,28 +63,3 @@ LilyPond is powerful but overly flexible—the same music can be written in mult
|
|
|
33
63
|
- **Shorter context description**: Removes redundant information, allowing LLMs to process more music content within limited context windows
|
|
34
64
|
- **Formatted layout**: Fixed syntax structure facilitates model learning and generation
|
|
35
65
|
- **Markdown-embeddable**: Music snippets can be directly embedded in documents
|
|
36
|
-
|
|
37
|
-
### Basic Syntax
|
|
38
|
-
|
|
39
|
-
| Element | Syntax | Description |
|
|
40
|
-
|---------|--------|-------------|
|
|
41
|
-
| Staff | `\staff "1"` | Specifies which staff the current voice belongs to |
|
|
42
|
-
| Key | `\key c \major` | C major |
|
|
43
|
-
| Time | `\time 4/4` | 4/4 time signature |
|
|
44
|
-
| Clef | `\clef "treble"` | Treble clef |
|
|
45
|
-
| Notes | `c4 d8 e16` | C quarter note, D eighth note, E sixteenth note |
|
|
46
|
-
| Accidentals | `cs` `cf` `css` `cff` | C sharp, C flat, C double-sharp, C double-flat |
|
|
47
|
-
| Octave | `c'` `c,` | One octave higher, one octave lower |
|
|
48
|
-
| Chord | `<c e g>4` | C major triad, quarter note |
|
|
49
|
-
| Voice separator | `\\` | Separates multiple voices within the same staff |
|
|
50
|
-
| Part separator | `\\\` | Separates different instrument tracks (parts) in a score |
|
|
51
|
-
| Bar line | `\|` | Separates measures |
|
|
52
|
-
|
|
53
|
-
## Syntax Example
|
|
54
|
-
|
|
55
|
-
```lilylet
|
|
56
|
-
\staff "1" \key e \major \time 2/4 \clef "treble" \stemUp e8 [ ds16 e16 ] fs4 ~ \\
|
|
57
|
-
\staff "1" s4 \stemDown ds4 ~ \\
|
|
58
|
-
\staff "2" \key e \major \clef "bass" \stemUp e,,4 b4 \\
|
|
59
|
-
\staff "2" \stemDown e,,16 [ b'8 -> b16 ] b,16 [ b'8 -> b16 ] |
|
|
60
|
-
```
|