@k-l-lambda/lilylet 0.1.49 → 0.1.51
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/abc/abc.d.ts +102 -0
- package/lib/abc/abc.js +25 -0
- package/lib/abc/grammar.jison.js +1203 -0
- package/lib/abc/parser.d.ts +3 -0
- package/lib/abc/parser.js +6 -0
- package/lib/abcDecoder.d.ts +1 -0
- package/lib/abcDecoder.js +1 -0
- package/lib/grammar.jison.js +1 -1303
- package/lib/index.d.ts +1 -8
- package/lib/index.js +1 -10
- package/lib/lilylet/abcDecoder.d.ts +25 -0
- package/lib/lilylet/abcDecoder.js +1007 -0
- package/lib/lilylet/grammar.jison.js +1308 -0
- package/lib/lilylet/index.d.ts +10 -0
- package/lib/lilylet/index.js +10 -0
- package/lib/lilylet/lilypondDecoder.d.ts +29 -0
- package/lib/lilylet/lilypondDecoder.js +1053 -0
- package/lib/lilylet/lilypondEncoder.d.ts +34 -0
- package/lib/lilylet/lilypondEncoder.js +759 -0
- package/lib/lilylet/meiEncoder.d.ts +8 -0
- package/lib/lilylet/meiEncoder.js +1813 -0
- package/lib/lilylet/musicXmlDecoder.d.ts +20 -0
- package/lib/lilylet/musicXmlDecoder.js +1195 -0
- package/lib/lilylet/musicXmlEncoder.d.ts +15 -0
- package/lib/lilylet/musicXmlEncoder.js +701 -0
- package/lib/lilylet/musicXmlTypes.d.ts +199 -0
- package/lib/lilylet/musicXmlTypes.js +7 -0
- package/lib/lilylet/musicXmlUtils.d.ts +92 -0
- package/lib/lilylet/musicXmlUtils.js +469 -0
- package/lib/lilylet/parser.d.ts +3 -0
- package/lib/lilylet/parser.js +151 -0
- package/lib/lilylet/serializer.d.ts +11 -0
- package/lib/lilylet/serializer.js +702 -0
- package/lib/lilylet/types.d.ts +245 -0
- package/lib/lilylet/types.js +99 -0
- package/lib/lilypondDecoder.d.ts +1 -29
- package/lib/lilypondDecoder.js +1 -1006
- package/lib/lilypondEncoder.d.ts +1 -34
- package/lib/lilypondEncoder.js +1 -759
- package/lib/meiEncoder.d.ts +1 -8
- package/lib/meiEncoder.js +1 -1545
- package/lib/musicXmlDecoder.d.ts +1 -20
- package/lib/musicXmlDecoder.js +1 -1151
- package/lib/musicXmlEncoder.d.ts +1 -15
- package/lib/musicXmlEncoder.js +1 -666
- package/lib/musicXmlTypes.d.ts +1 -199
- package/lib/musicXmlTypes.js +1 -7
- package/lib/musicXmlUtils.d.ts +1 -81
- package/lib/musicXmlUtils.js +1 -435
- package/lib/parser.d.ts +1 -3
- package/lib/parser.js +1 -151
- package/lib/serializer.d.ts +1 -11
- package/lib/serializer.js +1 -650
- package/lib/types.d.ts +1 -244
- package/lib/types.js +1 -99
- package/package.json +2 -1
- package/source/abc/abc.jison +692 -0
- package/source/abc/abc.ts +176 -0
- package/source/abc/grammar.jison.js +1203 -0
- package/source/abc/parser.ts +12 -0
- package/source/lilylet/abcDecoder.ts +1121 -0
- package/source/lilylet/grammar.jison.js +195 -190
- package/source/lilylet/index.ts +4 -3
- package/source/lilylet/lilylet.jison +10 -3
- package/source/lilylet/lilypondDecoder.ts +91 -41
- package/source/lilylet/meiEncoder.ts +284 -0
- package/source/lilylet/musicXmlDecoder.ts +74 -27
- package/source/lilylet/musicXmlEncoder.ts +201 -146
- package/source/lilylet/musicXmlUtils.ts +46 -4
- package/source/lilylet/serializer.ts +75 -21
- package/source/lilylet/types.ts +1 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
|
|
2
|
+
interface Fraction {
|
|
3
|
+
numerator: number;
|
|
4
|
+
denominator: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
namespace ABC {
|
|
9
|
+
type Token = string;
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
interface KeyValue {
|
|
13
|
+
name: string;
|
|
14
|
+
value: any;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export interface ControlTerm {
|
|
19
|
+
control: KeyValue;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export interface Triplet {
|
|
24
|
+
triplet: number;
|
|
25
|
+
multiplier?: number; // optional multiplier for triplet note duration
|
|
26
|
+
n?: number; // optional number of notes in the triplet
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
export interface OctaveShift {
|
|
31
|
+
octaveShift: number; // positive for shift down (8vb), negative for shift up (8va)
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
export interface Fingering {
|
|
36
|
+
fingering: string;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
export interface Tremolo {
|
|
41
|
+
tremolo: number; // number of slashes
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
interface Grace {
|
|
46
|
+
grace: boolean;
|
|
47
|
+
acciaccatura: Token;
|
|
48
|
+
events: GraceMusicTerm[];
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
interface Comment {
|
|
53
|
+
comment: string;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
export interface Articulation {
|
|
58
|
+
articulation: Token;
|
|
59
|
+
scope?: '(' | ')';
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
export type Expressive =
|
|
64
|
+
| Articulation
|
|
65
|
+
| { express: Token } // for tokens like '(' , ')', '.' , '-' stored as { express: $1 }
|
|
66
|
+
;
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
export interface TextTerm {
|
|
70
|
+
text: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
export interface Pitch {
|
|
75
|
+
acc: number | null; // accidentals: '^' | '_' | '=' or null
|
|
76
|
+
phonet: Token; // underlying letter token or rest
|
|
77
|
+
quotes: number; // number of single/double quotes: positive for sup, negative for sub, null if none
|
|
78
|
+
tie?: boolean;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
export interface Chord {
|
|
83
|
+
pitches: Pitch[];
|
|
84
|
+
tie?: any;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
export interface EventData {
|
|
89
|
+
chord: Chord;
|
|
90
|
+
duration?: Fraction;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
export interface EventTerm {
|
|
95
|
+
event: EventData;
|
|
96
|
+
broken?: number;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
export type MusicTerm =
|
|
101
|
+
| Expressive
|
|
102
|
+
| TextTerm
|
|
103
|
+
| EventTerm
|
|
104
|
+
| Grace
|
|
105
|
+
| ControlTerm
|
|
106
|
+
| Triplet
|
|
107
|
+
| OctaveShift
|
|
108
|
+
| Fingering
|
|
109
|
+
| Tremolo
|
|
110
|
+
;
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
export type GraceMusicTerm =
|
|
114
|
+
| Expressive
|
|
115
|
+
| EventTerm
|
|
116
|
+
| Fingering
|
|
117
|
+
;
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
type Header = KeyValue | Comment;
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
export interface BarPatch {
|
|
124
|
+
control: { [k: string]: any };
|
|
125
|
+
terms: MusicTerm[];
|
|
126
|
+
bar: Token;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
export interface StaffGroup {
|
|
131
|
+
items: (StaffGroup | string)[];
|
|
132
|
+
bound?: 'arc' | 'square' | 'curly';
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
export interface StaffLayout {
|
|
137
|
+
staffLayout: StaffGroup[];
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
export interface KeySignature {
|
|
142
|
+
root: string;
|
|
143
|
+
mode?: string;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
export interface ClefValue {
|
|
148
|
+
clef: string;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
interface Measure {
|
|
153
|
+
index: number;
|
|
154
|
+
voices: BarPatch[];
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
interface Body {
|
|
159
|
+
measures: Measure[];
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
export interface Tune {
|
|
164
|
+
header: Header[];
|
|
165
|
+
body: Body;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
export type Document = Tune[];
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
export {
|
|
175
|
+
ABC,
|
|
176
|
+
};
|