@leafo/lml 0.1.1 → 0.3.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.
- package/README.md +273 -40
- package/dist/auto-chords.d.ts +33 -8
- package/dist/auto-chords.d.ts.map +1 -1
- package/dist/auto-chords.js +19 -1
- package/dist/auto-chords.js.map +1 -1
- package/dist/grammar.d.ts.map +1 -1
- package/dist/grammar.js +1371 -283
- package/dist/grammar.js.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/music.d.ts +502 -5
- package/dist/music.d.ts.map +1 -1
- package/dist/music.js +500 -53
- package/dist/music.js.map +1 -1
- package/dist/note-utils.d.ts +13 -0
- package/dist/note-utils.d.ts.map +1 -0
- package/dist/note-utils.js +62 -0
- package/dist/note-utils.js.map +1 -0
- package/dist/noteUtils.d.ts +25 -0
- package/dist/noteUtils.d.ts.map +1 -0
- package/dist/noteUtils.js +86 -0
- package/dist/noteUtils.js.map +1 -0
- package/dist/parser.d.ts +137 -2
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +259 -36
- package/dist/parser.js.map +1 -1
- package/dist/song.d.ts +207 -2
- package/dist/song.d.ts.map +1 -1
- package/dist/song.js +251 -15
- package/dist/song.js.map +1 -1
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -18,8 +18,8 @@ import SongParser from "@leafo/lml"
|
|
|
18
18
|
// Parse and compile LML to a song
|
|
19
19
|
const song = SongParser.load(`
|
|
20
20
|
ks0 ts4/4
|
|
21
|
-
c5
|
|
22
|
-
|
|
21
|
+
c5 d e f
|
|
22
|
+
g*2 g*2
|
|
23
23
|
`)
|
|
24
24
|
|
|
25
25
|
// Access the notes
|
|
@@ -40,42 +40,108 @@ import SongParser from "@leafo/lml"
|
|
|
40
40
|
const parser = new SongParser()
|
|
41
41
|
|
|
42
42
|
// Phase 1: Parse text to AST
|
|
43
|
-
const ast = parser.parse("c5
|
|
44
|
-
// [["note", "C5"], ["note", "
|
|
43
|
+
const ast = parser.parse("c5 d e")
|
|
44
|
+
// [["note", "C5"], ["note", "D"], ["note", "E"]]
|
|
45
45
|
|
|
46
46
|
// Phase 2: Compile AST to song
|
|
47
47
|
const song = parser.compile(ast)
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
### Parser Options
|
|
51
|
+
|
|
52
|
+
Both `SongParser.load()` and `parser.compile()` accept an options object:
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
const song = SongParser.load("c d e f g", {
|
|
56
|
+
defaultOctave: 4, // Default octave for relative notes (default: 5)
|
|
57
|
+
})
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
This is useful for bass clef or other instruments that typically play in different registers.
|
|
61
|
+
|
|
50
62
|
## LML Syntax
|
|
51
63
|
|
|
52
64
|
### Notes
|
|
53
65
|
|
|
54
|
-
|
|
66
|
+
Notes are written as letter names (`a` through `g`) and placed sequentially, separated by whitespace. The octave is automatically determined by finding the closest one to the previous note. The first note defaults to octave 5 (configurable via `defaultOctave` option).
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
c d e f g a b c # c5 d5 e5 f5 g5 a5 b5 c6
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The algorithm picks the octave that minimizes the distance in semitones:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
c d e f g a b c # Ascending: c5 → c6
|
|
76
|
+
c6 b a g f e d c # Descending: c6 → c5
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Duration can be modified with `*` (multiply) or `/` (divide). The default duration is 1 beat.
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
c*2 d d e*4 # c is 2 beats, d is 1 beat each, e is 4 beats
|
|
83
|
+
c/2 d/2 e/4 # c and d are 0.5 beats, e is 0.25 beats
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Dotted notes use `.` after the duration. A dot adds half the note's value (1.5x), double-dot adds 1.75x, etc.
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
c. # dotted quarter: 1.5 beats
|
|
90
|
+
c.. # double-dotted quarter: 1.75 beats
|
|
91
|
+
c*2. # dotted half: 3 beats (2 * 1.5)
|
|
92
|
+
c/2. # dotted eighth: 0.75 beats (0.5 * 1.5)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
An explicit start position can be specified with `@` followed by the beat number. This places notes at absolute positions rather than sequentially.
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
c@0 d@4 e@8 # Notes at beats 0, 4, and 8
|
|
99
|
+
c*2@0 d*2@2 # Duration 2, at beats 0 and 2
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Notes can be made sharp with `+`, flat with `-`, or natural with `=`:
|
|
55
103
|
|
|
56
104
|
```
|
|
57
|
-
|
|
105
|
+
c c+ d- e # c c# db e
|
|
58
106
|
```
|
|
59
107
|
|
|
60
|
-
|
|
108
|
+
### Explicit Octaves
|
|
109
|
+
|
|
110
|
+
When you need precise control, add an octave number (0-9) after the note name:
|
|
61
111
|
|
|
62
112
|
```
|
|
63
|
-
c5
|
|
113
|
+
c5 d5 e5 # Explicit octaves
|
|
114
|
+
c3 d e f # Start at c3, then continue relatively: c3 d3 e3 f3
|
|
115
|
+
g4 c # Jump to g4, then c5 (closest to g4)
|
|
64
116
|
```
|
|
65
117
|
|
|
66
|
-
|
|
118
|
+
This is useful for:
|
|
119
|
+
- Setting the starting octave
|
|
120
|
+
- Jumping to a different register
|
|
121
|
+
- Writing music that spans multiple octaves
|
|
67
122
|
|
|
68
123
|
```
|
|
69
|
-
|
|
124
|
+
# Two octave arpeggio
|
|
125
|
+
c4 e g c5 e g c6
|
|
126
|
+
|
|
127
|
+
# Jump between registers
|
|
128
|
+
c5 d e g3 a b
|
|
70
129
|
```
|
|
71
130
|
|
|
72
131
|
### Rests
|
|
73
132
|
|
|
74
|
-
Insert silence using the rest command `r`,
|
|
133
|
+
Insert silence using the rest command `r`, with the same duration modifiers as notes. Rests can use `*N` to multiply, `/N` to divide, `.` for dotting, and `@` for explicit positioning.
|
|
75
134
|
|
|
76
135
|
```
|
|
77
|
-
|
|
78
|
-
|
|
136
|
+
c r d*2
|
|
137
|
+
d r2 a
|
|
138
|
+
r/2 # Half-beat rest (0.5 beats)
|
|
139
|
+
r/4 # Quarter-beat rest (0.25 beats)
|
|
140
|
+
r@4 # Rest at beat 4
|
|
141
|
+
r2@4 # Rest with duration 2 at beat 4
|
|
142
|
+
r. # Dotted rest: 1.5 beats
|
|
143
|
+
r2. # Dotted rest with duration: 3 beats
|
|
144
|
+
r/2. # Dotted half-beat rest: 0.75 beats
|
|
79
145
|
```
|
|
80
146
|
|
|
81
147
|
### Time Commands
|
|
@@ -88,13 +154,15 @@ Change the base duration using time commands. These take effect until the end of
|
|
|
88
154
|
|
|
89
155
|
```
|
|
90
156
|
dt
|
|
91
|
-
|
|
157
|
+
c d c d c d e*2
|
|
92
158
|
```
|
|
93
159
|
|
|
94
|
-
Time commands stack when repeated:
|
|
160
|
+
Time commands stack when repeated. You can also add a number to apply the effect multiple times:
|
|
95
161
|
|
|
96
162
|
```
|
|
97
|
-
dt dt
|
|
163
|
+
dt dt c d # Each note is 0.25 beats
|
|
164
|
+
dt2 c d # Same as above
|
|
165
|
+
ht3 c # Note is 8 beats (2^3)
|
|
98
166
|
```
|
|
99
167
|
|
|
100
168
|
### Position Restore
|
|
@@ -102,14 +170,14 @@ dt dt c5 d5 # Each note is 0.25 beats
|
|
|
102
170
|
Move the position back to the start using `|`. This is useful for writing chords or multiple voices.
|
|
103
171
|
|
|
104
172
|
```
|
|
105
|
-
c5 |
|
|
173
|
+
c5 | e | g # C major chord (c5 e5 g5)
|
|
106
174
|
```
|
|
107
175
|
|
|
108
176
|
Two voices:
|
|
109
177
|
|
|
110
178
|
```
|
|
111
|
-
| c5
|
|
112
|
-
| c4
|
|
179
|
+
| c5 g e*2
|
|
180
|
+
| c4*2 f*2
|
|
113
181
|
```
|
|
114
182
|
|
|
115
183
|
### Blocks
|
|
@@ -123,42 +191,51 @@ Blocks are delimited with `{` and `}`. They affect how commands work:
|
|
|
123
191
|
```
|
|
124
192
|
{
|
|
125
193
|
dt
|
|
126
|
-
c5 { dt
|
|
194
|
+
c5 { dt e f } d*2 e g a c
|
|
127
195
|
}
|
|
128
196
|
|
|
|
129
|
-
{ ht g4
|
|
197
|
+
{ ht g4 f }
|
|
130
198
|
```
|
|
131
199
|
|
|
132
200
|
### Measures
|
|
133
201
|
|
|
134
|
-
The `m` command moves the position to a
|
|
202
|
+
The `m` command moves the position to the start of a measure boundary, useful for aligning notes. Measure boundaries are determined by the current time signature. Use `m` alone to auto-increment to the next measure, or `m0`, `m1`, etc. for explicit positioning:
|
|
135
203
|
|
|
136
204
|
```
|
|
137
|
-
|
|
138
|
-
| c5
|
|
139
|
-
| g4
|
|
205
|
+
m {
|
|
206
|
+
| c5 c a g
|
|
207
|
+
| g4*4
|
|
140
208
|
}
|
|
141
209
|
|
|
142
|
-
|
|
143
|
-
| d5
|
|
144
|
-
| f4
|
|
210
|
+
m {
|
|
211
|
+
| d5 d a e
|
|
212
|
+
| f4*4
|
|
145
213
|
}
|
|
146
214
|
```
|
|
147
215
|
|
|
216
|
+
The first `m` goes to measure 0, then each subsequent `m` increments. Explicit measure numbers also update the counter:
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
m { c d } # measure 0
|
|
220
|
+
m { e f } # measure 1
|
|
221
|
+
m5 { g a } # measure 5
|
|
222
|
+
m { b c } # measure 6
|
|
223
|
+
```
|
|
224
|
+
|
|
148
225
|
### Key Signature
|
|
149
226
|
|
|
150
227
|
Set the key signature with `ks` followed by the number of sharps (positive) or flats (negative). Notes are automatically adjusted to match the key.
|
|
151
228
|
|
|
152
229
|
```
|
|
153
|
-
ks2
|
|
154
|
-
|
|
230
|
+
ks2 # D major (2 sharps: F#, C#)
|
|
231
|
+
c d e f # F becomes F#, C becomes C#
|
|
155
232
|
```
|
|
156
233
|
|
|
157
234
|
Use `=` to override the key signature with a natural:
|
|
158
235
|
|
|
159
236
|
```
|
|
160
237
|
ks-2
|
|
161
|
-
|
|
238
|
+
b c b= # B natural
|
|
162
239
|
```
|
|
163
240
|
|
|
164
241
|
### Time Signature
|
|
@@ -167,18 +244,69 @@ Set the time signature with `ts`:
|
|
|
167
244
|
|
|
168
245
|
```
|
|
169
246
|
ts3/4
|
|
170
|
-
|
|
247
|
+
c d e
|
|
171
248
|
```
|
|
172
249
|
|
|
173
250
|
This affects beats per measure and where measure lines appear.
|
|
174
251
|
|
|
252
|
+
Time signatures can change mid-song. Notes are placed sequentially regardless of time signature changes:
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
ts4/4
|
|
256
|
+
c d e f # 4 beats in 4/4
|
|
257
|
+
ts3/4
|
|
258
|
+
g a b # 3 beats in 3/4
|
|
259
|
+
ts4/4
|
|
260
|
+
c d e f # 4 beats in 4/4
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Time signature changes are tracked and accessible via `song.timeSignatures`:
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
const song = SongParser.load("ts3/4 c d e ts4/4 f g a b")
|
|
267
|
+
console.log(song.timeSignatures)
|
|
268
|
+
// [[0, 3], [3, 4]] // [beat_position, beats_per_measure]
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Measures API
|
|
272
|
+
|
|
273
|
+
Measures are implicitly created based on the time signature and the duration of notes in the song. Use `getMeasures()` to get an array of measure boundaries, useful for drawing grid lines or measure markers:
|
|
274
|
+
|
|
275
|
+
```typescript
|
|
276
|
+
const song = SongParser.load("c5 d e f g a b c") // 8 beats in 4/4
|
|
277
|
+
const measures = song.getMeasures()
|
|
278
|
+
// [{ start: 0, beats: 4 }, { start: 4, beats: 4 }]
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
This correctly handles time signature changes:
|
|
282
|
+
|
|
283
|
+
```typescript
|
|
284
|
+
const song = SongParser.load(`
|
|
285
|
+
ts4/4 c d e f # 4 beats
|
|
286
|
+
ts3/4 g a b # 3 beats
|
|
287
|
+
ts4/4 c d e f # 4 beats
|
|
288
|
+
`)
|
|
289
|
+
const measures = song.getMeasures()
|
|
290
|
+
// [
|
|
291
|
+
// { start: 0, beats: 4 },
|
|
292
|
+
// { start: 4, beats: 3 },
|
|
293
|
+
// { start: 7, beats: 4 }
|
|
294
|
+
// ]
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Each measure object contains:
|
|
298
|
+
- `start`: Beat position where the measure begins
|
|
299
|
+
- `beats`: Number of beats in this measure
|
|
300
|
+
|
|
301
|
+
Note: The `m` command (see [Measures](#measures)) is used to align notes to measure boundaries during composition, but is not required—`getMeasures()` computes measure boundaries from the time signature regardless of whether `m` was used.
|
|
302
|
+
|
|
175
303
|
### Chords
|
|
176
304
|
|
|
177
305
|
The `$` command specifies a chord symbol for auto-chord generation:
|
|
178
306
|
|
|
179
307
|
```
|
|
180
|
-
{$G c5
|
|
181
|
-
{$Dm
|
|
308
|
+
{$G c5*2 a d}
|
|
309
|
+
{$Dm e f g*2}
|
|
182
310
|
```
|
|
183
311
|
|
|
184
312
|
Supported chord types: `M`, `m`, `dim`, `dim7`, `dimM7`, `aug`, `augM7`, `M6`, `m6`, `M7`, `7`, `m7`, `m7b5`, `mM7`
|
|
@@ -188,8 +316,8 @@ Supported chord types: `M`, `m`, `dim`, `dim7`, `dimM7`, `aug`, `augM7`, `M6`, `
|
|
|
188
316
|
Songs can have multiple tracks, numbered starting from 0. Use `t` to switch tracks:
|
|
189
317
|
|
|
190
318
|
```
|
|
191
|
-
t0 c5
|
|
192
|
-
t1 g3
|
|
319
|
+
t0 c5 d e
|
|
320
|
+
t1 g3 g g
|
|
193
321
|
```
|
|
194
322
|
|
|
195
323
|
### Clefs
|
|
@@ -197,8 +325,52 @@ t1 g3 g3 g3
|
|
|
197
325
|
Set the clef with `/g` (treble), `/f` (bass), or `/c` (alto):
|
|
198
326
|
|
|
199
327
|
```
|
|
200
|
-
/g c5
|
|
201
|
-
/f c3
|
|
328
|
+
/g c5 d e
|
|
329
|
+
/f c3 d e
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
Clefs are stored as track metadata, not on individual notes. They hint to renderers which staff to use for displaying the track. Each track supports a single clef assignment. When no clef is specified, the staff is auto-detected based on the note range:
|
|
333
|
+
|
|
334
|
+
- Notes primarily above middle C → treble staff
|
|
335
|
+
- Notes primarily below middle C → bass staff
|
|
336
|
+
- Notes spanning both ranges → grand staff (treble + bass)
|
|
337
|
+
|
|
338
|
+
Clefs are accessible via `track.clefs`:
|
|
339
|
+
|
|
340
|
+
```typescript
|
|
341
|
+
const song = SongParser.load("/f c3 d e")
|
|
342
|
+
console.log(song.tracks[0].clefs)
|
|
343
|
+
// [[0, "f"]] // [position, clefType]
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### Strings
|
|
347
|
+
|
|
348
|
+
Quoted strings can be placed anywhere in a song. They are tagged with their position in beats and stored separately from notes. This is useful for lyrics or annotations.
|
|
349
|
+
|
|
350
|
+
```
|
|
351
|
+
c "hel" d "lo" e "world"
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Both single and double quotes are supported. Strings can span multiple lines:
|
|
355
|
+
|
|
356
|
+
```
|
|
357
|
+
c*2 'First verse
|
|
358
|
+
continues here' d*2
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Escape sequences are supported: `\"`, `\'`, `\\`, `\n`.
|
|
362
|
+
|
|
363
|
+
```
|
|
364
|
+
"say \"hello\""
|
|
365
|
+
'it\'s working'
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Strings are accessible via `song.strings`:
|
|
369
|
+
|
|
370
|
+
```typescript
|
|
371
|
+
const song = SongParser.load('c "la" d "la"')
|
|
372
|
+
console.log(song.strings)
|
|
373
|
+
// [[1, "la"], [2, "la"]] // [position, text]
|
|
202
374
|
```
|
|
203
375
|
|
|
204
376
|
### Comments
|
|
@@ -206,10 +378,43 @@ Set the clef with `/g` (treble), `/f` (bass), or `/c` (alto):
|
|
|
206
378
|
Text after `#` is ignored:
|
|
207
379
|
|
|
208
380
|
```
|
|
209
|
-
|
|
381
|
+
c d # this is a comment
|
|
210
382
|
# full line comment
|
|
211
|
-
|
|
383
|
+
e f
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
### Frontmatter
|
|
387
|
+
|
|
388
|
+
Metadata can be embedded at the start of a file using comment-style frontmatter. Lines matching `# key: value` at the very beginning (before any commands) are parsed as metadata:
|
|
389
|
+
|
|
212
390
|
```
|
|
391
|
+
# title: Moonlight Sonata
|
|
392
|
+
# author: Beethoven
|
|
393
|
+
# bpm: 120
|
|
394
|
+
# difficulty: intermediate
|
|
395
|
+
|
|
396
|
+
ts4/4 ks-3
|
|
397
|
+
c d e f
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
The convention is to use lowercase key names. Frontmatter is accessible via `song.metadata.frontmatter`:
|
|
401
|
+
|
|
402
|
+
```typescript
|
|
403
|
+
const song = SongParser.load(`
|
|
404
|
+
# title: My Song
|
|
405
|
+
# bpm: 90
|
|
406
|
+
c d e
|
|
407
|
+
`)
|
|
408
|
+
|
|
409
|
+
console.log(song.metadata.frontmatter)
|
|
410
|
+
// { title: "My Song", bpm: "90" }
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
Notes:
|
|
414
|
+
- Frontmatter must appear at the start of the file, before any music commands
|
|
415
|
+
- Keys are case-sensitive
|
|
416
|
+
- All values are stored as strings
|
|
417
|
+
- Once a non-frontmatter line is encountered, subsequent `# key: value` lines are treated as regular comments
|
|
213
418
|
|
|
214
419
|
## Music Theory Utilities
|
|
215
420
|
|
|
@@ -243,6 +448,34 @@ key.name() // "D"
|
|
|
243
448
|
key.accidentalNotes() // ["F", "C"]
|
|
244
449
|
```
|
|
245
450
|
|
|
451
|
+
## Limitations
|
|
452
|
+
|
|
453
|
+
Current limitations that may be addressed in future versions:
|
|
454
|
+
|
|
455
|
+
- **Clefs are per-track**: Each track supports only a single clef. Mid-track clef changes are not supported.
|
|
456
|
+
|
|
457
|
+
- **Key signature metadata is global**: While key signatures (`ks`) can change mid-song and correctly affect note parsing, the metadata only stores the final value. Renderers cannot determine where key signature changes occur within the song. (Time signature changes are tracked via `song.timeSignatures` and `song.getMeasures()`.)
|
|
458
|
+
|
|
459
|
+
- **Time signature changes should be placed at measure boundaries**: Time signatures are recorded at the cursor position when parsed. When combined with measure markers (`m`) and notes that extend past measure boundaries, the recorded position may not align with where the measure actually starts. For predictable behavior, place time signature changes immediately after a measure marker (which positions the cursor at the boundary):
|
|
460
|
+
|
|
461
|
+
```
|
|
462
|
+
# Recommended: time signature is always applied at start of measure
|
|
463
|
+
m ts4/4 c d e f
|
|
464
|
+
m ts3/4 g a b
|
|
465
|
+
|
|
466
|
+
# Although you can also write it before the m command, if the previous measure
|
|
467
|
+
# accidentally pushed the cursor into the next measure then the time signature
|
|
468
|
+
# application will be delayed a measure:
|
|
469
|
+
|
|
470
|
+
ts3/4
|
|
471
|
+
m g*4 # extends 1 beat past 3-beat measure
|
|
472
|
+
ts4/4 # recorded at beat 4, but next measure starts at beat 3
|
|
473
|
+
m a b c d
|
|
474
|
+
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
- **No explicit grand staff**: Grand staff is only available through auto-detection when notes span both treble and bass registers. There is no syntax to explicitly request a grand staff.
|
|
478
|
+
|
|
246
479
|
## License
|
|
247
480
|
|
|
248
481
|
MIT
|
package/dist/auto-chords.d.ts
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
|
+
import { type ChordShapeName } from "./music.js";
|
|
1
2
|
import { SongNote, MultiTrackSong } from "./song.js";
|
|
3
|
+
/**
|
|
4
|
+
* @category AutoChords
|
|
5
|
+
*/
|
|
2
6
|
export interface AutoChordsOptions {
|
|
3
7
|
rate?: number;
|
|
4
8
|
chordMinSpacing?: number;
|
|
5
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* @category AutoChords
|
|
12
|
+
*/
|
|
6
13
|
export interface ChordBlock {
|
|
7
14
|
start: number;
|
|
8
15
|
stop: number;
|
|
9
|
-
chord: [string,
|
|
16
|
+
chord: [string, ChordShapeName];
|
|
10
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* @category AutoChords
|
|
20
|
+
*/
|
|
11
21
|
export declare class AutoChords {
|
|
12
22
|
static defaultChords(song: MultiTrackSong, options?: AutoChordsOptions): AutoChords;
|
|
13
|
-
static coerceChord(macro: string): [string,
|
|
23
|
+
static coerceChord(macro: string): [string, ChordShapeName] | undefined;
|
|
14
24
|
static allGenerators: (typeof AutoChords)[];
|
|
15
25
|
static displayName: string;
|
|
16
26
|
song: MultiTrackSong;
|
|
@@ -20,27 +30,42 @@ export declare class AutoChords {
|
|
|
20
30
|
addChords(): void;
|
|
21
31
|
minPitchInRange(start: number, stop: number): number;
|
|
22
32
|
rootBelow(name: string, maxPitch: number): string;
|
|
23
|
-
notesForChord(_root: string, _shape:
|
|
33
|
+
notesForChord(_root: string, _shape: ChordShapeName, _blockStart: number, _blockStop: number): SongNote[];
|
|
24
34
|
inDivisions(start: number, stop: number, count: number, fn: (left: number, right: number, k: number) => void): void;
|
|
25
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* @category AutoChords
|
|
38
|
+
*/
|
|
26
39
|
export declare class RootAutoChords extends AutoChords {
|
|
27
40
|
static displayName: string;
|
|
28
|
-
notesForChord(root: string, _shape:
|
|
41
|
+
notesForChord(root: string, _shape: ChordShapeName, blockStart: number, blockStop: number): SongNote[];
|
|
29
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* @category AutoChords
|
|
45
|
+
*/
|
|
30
46
|
export declare class TriadAutoChords extends AutoChords {
|
|
31
47
|
static displayName: string;
|
|
32
|
-
notesForChord(root: string, shape:
|
|
48
|
+
notesForChord(root: string, shape: ChordShapeName, blockStart: number, blockStop: number): SongNote[];
|
|
33
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* @category AutoChords
|
|
52
|
+
*/
|
|
34
53
|
export declare class Root5AutoChords extends AutoChords {
|
|
35
54
|
static displayName: string;
|
|
36
|
-
notesForChord(root: string, shape:
|
|
55
|
+
notesForChord(root: string, shape: ChordShapeName, blockStart: number, blockStop: number): SongNote[];
|
|
37
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* @category AutoChords
|
|
59
|
+
*/
|
|
38
60
|
export declare class ArpAutoChords extends AutoChords {
|
|
39
61
|
static displayName: string;
|
|
40
|
-
notesForChord(root: string, shape:
|
|
62
|
+
notesForChord(root: string, shape: ChordShapeName, blockStart: number, blockStop: number): SongNote[];
|
|
41
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* @category AutoChords
|
|
66
|
+
*/
|
|
42
67
|
export declare class BossaNovaAutoChords extends AutoChords {
|
|
43
68
|
static displayName: string;
|
|
44
|
-
notesForChord(root: string, shape:
|
|
69
|
+
notesForChord(root: string, shape: ChordShapeName, blockStart: number, blockStop: number): SongNote[];
|
|
45
70
|
}
|
|
46
71
|
//# sourceMappingURL=auto-chords.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-chords.d.ts","sourceRoot":"","sources":["../src/auto-chords.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auto-chords.d.ts","sourceRoot":"","sources":["../src/auto-chords.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,QAAQ,EAAgB,cAAc,EAAE,MAAM,WAAW,CAAA;AAElE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;C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AU;IAC7C,OAAgB,WAAW,SAAU;IAErC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ,EAAE;CAgBtG;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,OAAgB,WAAW,SAAW;IAEtC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ,EAAE;CA+BtG;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,UAAU;IAC3C,OAAgB,WAAW,SAAQ;IAEnC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ,EAAE;CA2CtG;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,UAAU;IACjD,OAAgB,WAAW,SAAe;IAE1C,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ,EAAE;CA2CtG"}
|
package/dist/auto-chords.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Chord, parseNote, noteName, addInterval, MIDDLE_C_PITCH, OCTAVE_SIZE } from "./music.js";
|
|
2
2
|
import { SongNote } from "./song.js";
|
|
3
|
+
/**
|
|
4
|
+
* @category AutoChords
|
|
5
|
+
*/
|
|
3
6
|
export class AutoChords {
|
|
4
7
|
static defaultChords(song, options) {
|
|
5
8
|
return new BossaNovaAutoChords(song, options);
|
|
@@ -15,7 +18,7 @@ export class AutoChords {
|
|
|
15
18
|
if (shape == "") {
|
|
16
19
|
shape = "M";
|
|
17
20
|
}
|
|
18
|
-
if (!Chord.SHAPES
|
|
21
|
+
if (!(shape in Chord.SHAPES)) {
|
|
19
22
|
return;
|
|
20
23
|
}
|
|
21
24
|
return [root, shape];
|
|
@@ -112,6 +115,9 @@ export class AutoChords {
|
|
|
112
115
|
}
|
|
113
116
|
AutoChords.allGenerators = [];
|
|
114
117
|
AutoChords.displayName = "Auto Chords";
|
|
118
|
+
/**
|
|
119
|
+
* @category AutoChords
|
|
120
|
+
*/
|
|
115
121
|
export class RootAutoChords extends AutoChords {
|
|
116
122
|
notesForChord(root, _shape, blockStart, blockStop) {
|
|
117
123
|
const maxPitch = this.minPitchInRange(blockStart, blockStop);
|
|
@@ -124,6 +130,9 @@ export class RootAutoChords extends AutoChords {
|
|
|
124
130
|
}
|
|
125
131
|
}
|
|
126
132
|
RootAutoChords.displayName = "Root";
|
|
133
|
+
/**
|
|
134
|
+
* @category AutoChords
|
|
135
|
+
*/
|
|
127
136
|
export class TriadAutoChords extends AutoChords {
|
|
128
137
|
notesForChord(root, shape, blockStart, blockStop) {
|
|
129
138
|
const maxPitch = this.minPitchInRange(blockStart, blockStop);
|
|
@@ -137,6 +146,9 @@ export class TriadAutoChords extends AutoChords {
|
|
|
137
146
|
}
|
|
138
147
|
}
|
|
139
148
|
TriadAutoChords.displayName = "Triad";
|
|
149
|
+
/**
|
|
150
|
+
* @category AutoChords
|
|
151
|
+
*/
|
|
140
152
|
export class Root5AutoChords extends AutoChords {
|
|
141
153
|
notesForChord(root, shape, blockStart, blockStop) {
|
|
142
154
|
const maxPitch = this.minPitchInRange(blockStart, blockStop);
|
|
@@ -163,6 +175,9 @@ export class Root5AutoChords extends AutoChords {
|
|
|
163
175
|
}
|
|
164
176
|
}
|
|
165
177
|
Root5AutoChords.displayName = "Root+5";
|
|
178
|
+
/**
|
|
179
|
+
* @category AutoChords
|
|
180
|
+
*/
|
|
166
181
|
export class ArpAutoChords extends AutoChords {
|
|
167
182
|
notesForChord(root, shape, blockStart, blockStop) {
|
|
168
183
|
const maxPitch = this.minPitchInRange(blockStart, blockStop);
|
|
@@ -197,6 +212,9 @@ export class ArpAutoChords extends AutoChords {
|
|
|
197
212
|
}
|
|
198
213
|
}
|
|
199
214
|
ArpAutoChords.displayName = "Arp";
|
|
215
|
+
/**
|
|
216
|
+
* @category AutoChords
|
|
217
|
+
*/
|
|
200
218
|
export class BossaNovaAutoChords extends AutoChords {
|
|
201
219
|
notesForChord(root, shape, blockStart, blockStop) {
|
|
202
220
|
const maxPitch = this.minPitchInRange(blockStart, blockStop);
|
package/dist/auto-chords.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-chords.js","sourceRoot":"","sources":["../src/auto-chords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"auto-chords.js","sourceRoot":"","sources":["../src/auto-chords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAErE,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,QAAQ,EAAgC,MAAM,WAAW,CAAA;AAmBlE;;GAEG;AACH,MAAM,OAAO,UAAU;IACrB,MAAM,CAAC,aAAa,CAAC,IAAoB,EAAE,OAA2B;QACpE,OAAO,IAAI,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAC/C,CAAC;IAED,yCAAyC;IACzC,MAAM,CAAC,WAAW,CAAC,KAAa;QAC9B,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAA;QAC5C,IAAI,CAAC,CAAC,EAAE,CAAC;YAAC,OAAM;QAAC,CAAC;QAClB,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;QAEvB,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IA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,KAAK,CAAC;oBACJ,GAAG,CAAC,IAAI,CACN,IAAI,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,CAChC,CAAA;oBACD,MAAK;gBACP,KAAK,CAAC;oBACJ,GAAG,CAAC,IAAI,CACN,IAAI,QAAQ,CAAC,GAAG,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAChC,CAAA;oBACD,MAAK;YACT,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,GAAG,CAAA;IACZ,CAAC;;AA5Ce,+BAAW,GAAG,YAAY,CAAA;AA+C5C,UAAU,CAAC,aAAa,GAAG;IACzB,cAAc;IACd,eAAe;IACf,eAAe;IACf,aAAa;IACb,mBAAmB;CACpB,CAAA"}
|
package/dist/grammar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grammar.d.ts","sourceRoot":"","sources":["../src/grammar.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"grammar.d.ts","sourceRoot":"","sources":["../src/grammar.js"],"names":[],"mappings":"AA8uEA,8CAGE;AA5uEF;IAwCE,uDA2GC;IAlJD,oEAMC;IAJC,cAAwB;IACxB,WAAkB;IAClB,cAAwB;IAI1B,6BA6BC;CA8GF;AAED,0DAilEC"}
|