@ugfoundation/swaralipi-js 0.8.2 → 0.9.1

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.
Files changed (52) hide show
  1. package/README.md +1 -1
  2. package/dist/{batch-6FPBT5DP.js → batch-NEM7JXHV.js} +5 -5
  3. package/dist/{batch-6FPBT5DP.js.map → batch-NEM7JXHV.js.map} +1 -1
  4. package/dist/{chunk-UMBKIGVQ.js → chunk-DOEFSS66.js} +5 -4
  5. package/dist/chunk-DOEFSS66.js.map +1 -0
  6. package/dist/{chunk-4HNT6OAT.js → chunk-MYVIQU4O.js} +12 -3
  7. package/dist/chunk-MYVIQU4O.js.map +1 -0
  8. package/dist/{chunk-4IVUPMRK.js → chunk-SEN266BY.js} +28 -13
  9. package/dist/chunk-SEN266BY.js.map +1 -0
  10. package/dist/{chunk-FULC22MN.js → chunk-Z6A3CP5V.js} +28 -19
  11. package/dist/chunk-Z6A3CP5V.js.map +1 -0
  12. package/dist/cli.cjs +33 -19
  13. package/dist/cli.cjs.map +1 -1
  14. package/dist/cli.js +3 -3
  15. package/dist/convert/index.cjs +31 -17
  16. package/dist/convert/index.cjs.map +1 -1
  17. package/dist/convert/index.d.cts +1 -1
  18. package/dist/convert/index.d.ts +1 -1
  19. package/dist/convert/index.js +3 -3
  20. package/dist/index.cjs +38 -17
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +2 -2
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.js +2 -2
  25. package/dist/{lay-Csa4CD46.d.cts → lay-CZIzR9cM.d.ts} +16 -2
  26. package/dist/{lay-Ct9ky_EE.d.ts → lay-CfDlPhH2.d.cts} +16 -2
  27. package/dist/player/index.cjs +116 -71
  28. package/dist/player/index.cjs.map +1 -1
  29. package/dist/player/index.d.cts +11 -9
  30. package/dist/player/index.d.ts +11 -9
  31. package/dist/player/index.js +89 -66
  32. package/dist/player/index.js.map +1 -1
  33. package/dist/{schedule-B_UaluBi.d.cts → schedule-BaovCtmf.d.ts} +31 -12
  34. package/dist/{schedule-CdILTNsk.d.ts → schedule-CU-VECDH.d.cts} +31 -12
  35. package/dist/{schema-DGA_bNVZ.d.ts → schema-Cf_epUIC.d.cts} +333 -63
  36. package/dist/{schema-DGA_bNVZ.d.cts → schema-Cf_epUIC.d.ts} +333 -63
  37. package/dist/spec/index.cjs +38 -17
  38. package/dist/spec/index.cjs.map +1 -1
  39. package/dist/spec/index.d.cts +26 -8
  40. package/dist/spec/index.d.ts +26 -8
  41. package/dist/spec/index.js +2 -2
  42. package/dist/viewer/index.cjs +156 -73
  43. package/dist/viewer/index.cjs.map +1 -1
  44. package/dist/viewer/index.d.cts +25 -7
  45. package/dist/viewer/index.d.ts +25 -7
  46. package/dist/viewer/index.js +78 -27
  47. package/dist/viewer/index.js.map +1 -1
  48. package/package.json +1 -1
  49. package/dist/chunk-4HNT6OAT.js.map +0 -1
  50. package/dist/chunk-4IVUPMRK.js.map +0 -1
  51. package/dist/chunk-FULC22MN.js.map +0 -1
  52. package/dist/chunk-UMBKIGVQ.js.map +0 -1
@@ -125,6 +125,57 @@ declare const noteSchema: z.ZodType<Note>;
125
125
  /** লয় tier. `Lay` (and the tempo factors) live in the zod-free ./lay.js,
126
126
  * which the viewer/player import directly; `satisfies` keeps the two in step. */
127
127
  declare const laySchema: z.ZodEnum<["drut", "madhya", "vilambit"]>;
128
+ /**
129
+ * Taal definition. `numBeats` is the cycle length in মাত্রা; `bhaags` (if
130
+ * present) must sum to `numBeats`; `sam`/`khaali` are 0-based beat indices.
131
+ */
132
+ declare const taalSchema: z.ZodEffects<z.ZodObject<{
133
+ /** Player sample key, e.g. `dadra`, `teentaal`. */
134
+ id: z.ZodString;
135
+ /**
136
+ * Which tabla loop variation to play, e.g. `pro` (CDN dir suffix). Optional
137
+ * and additive — omitted means the taal's default variation, so existing
138
+ * docs are unaffected. The player honors it but never exposes a variation
139
+ * picker; selecting a non-default variation is the consumer's premium policy.
140
+ */
141
+ variation: z.ZodOptional<z.ZodString>;
142
+ numBeats: z.ZodNumber;
143
+ /** Vibhag groupings; if given, they sum to numBeats. */
144
+ bhaags: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
145
+ /** Sam (cycle start) beat index, 0-based. */
146
+ sam: z.ZodOptional<z.ZodNumber>;
147
+ /** Khaali (wave) beat indices, 0-based. */
148
+ khaali: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
149
+ }, "strip", z.ZodTypeAny, {
150
+ id: string;
151
+ numBeats: number;
152
+ variation?: string | undefined;
153
+ bhaags?: number[] | undefined;
154
+ sam?: number | undefined;
155
+ khaali?: number[] | undefined;
156
+ }, {
157
+ id: string;
158
+ numBeats: number;
159
+ variation?: string | undefined;
160
+ bhaags?: number[] | undefined;
161
+ sam?: number | undefined;
162
+ khaali?: number[] | undefined;
163
+ }>, {
164
+ id: string;
165
+ numBeats: number;
166
+ variation?: string | undefined;
167
+ bhaags?: number[] | undefined;
168
+ sam?: number | undefined;
169
+ khaali?: number[] | undefined;
170
+ }, {
171
+ id: string;
172
+ numBeats: number;
173
+ variation?: string | undefined;
174
+ bhaags?: number[] | undefined;
175
+ sam?: number | undefined;
176
+ khaali?: number[] | undefined;
177
+ }>;
178
+ type Taal = z.infer<typeof taalSchema>;
128
179
  /** A written line of the song: a sequence of note tokens. */
129
180
  declare const rowSchema: z.ZodObject<{
130
181
  /** Optional line label (e.g. a tuk/section marker). */
@@ -136,15 +187,87 @@ declare const rowSchema: z.ZodObject<{
136
187
  * ("বিলম্বিত লয়:") in already-converted documents.
137
188
  */
138
189
  lay: z.ZodOptional<z.ZodEnum<["drut", "madhya", "vilambit"]>>;
190
+ /**
191
+ * তালফেরতা: the তাল this row switches to, held until another row changes it
192
+ * (absent on every row = the whole song in `meta.taal`). `null` = মুক্তছন্দ
193
+ * from here on: the accompaniment rests until a later row names a taal.
194
+ * Independent of `lay` — either, both or neither may change on one row.
195
+ */
196
+ taal: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodObject<{
197
+ /** Player sample key, e.g. `dadra`, `teentaal`. */
198
+ id: z.ZodString;
199
+ /**
200
+ * Which tabla loop variation to play, e.g. `pro` (CDN dir suffix). Optional
201
+ * and additive — omitted means the taal's default variation, so existing
202
+ * docs are unaffected. The player honors it but never exposes a variation
203
+ * picker; selecting a non-default variation is the consumer's premium policy.
204
+ */
205
+ variation: z.ZodOptional<z.ZodString>;
206
+ numBeats: z.ZodNumber;
207
+ /** Vibhag groupings; if given, they sum to numBeats. */
208
+ bhaags: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
209
+ /** Sam (cycle start) beat index, 0-based. */
210
+ sam: z.ZodOptional<z.ZodNumber>;
211
+ /** Khaali (wave) beat indices, 0-based. */
212
+ khaali: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
213
+ }, "strip", z.ZodTypeAny, {
214
+ id: string;
215
+ numBeats: number;
216
+ variation?: string | undefined;
217
+ bhaags?: number[] | undefined;
218
+ sam?: number | undefined;
219
+ khaali?: number[] | undefined;
220
+ }, {
221
+ id: string;
222
+ numBeats: number;
223
+ variation?: string | undefined;
224
+ bhaags?: number[] | undefined;
225
+ sam?: number | undefined;
226
+ khaali?: number[] | undefined;
227
+ }>, {
228
+ id: string;
229
+ numBeats: number;
230
+ variation?: string | undefined;
231
+ bhaags?: number[] | undefined;
232
+ sam?: number | undefined;
233
+ khaali?: number[] | undefined;
234
+ }, {
235
+ id: string;
236
+ numBeats: number;
237
+ variation?: string | undefined;
238
+ bhaags?: number[] | undefined;
239
+ sam?: number | undefined;
240
+ khaali?: number[] | undefined;
241
+ }>>>;
242
+ /** That taal's name as printed (e.g. `ষষ্ঠী(২/৪)`) — `meta.taalName`'s twin. */
243
+ taalName: z.ZodOptional<z.ZodString>;
139
244
  notes: z.ZodArray<z.ZodType<Note, z.ZodTypeDef, Note>, "many">;
140
245
  }, "strip", z.ZodTypeAny, {
141
246
  notes: Note[];
142
247
  label?: string | undefined;
143
248
  lay?: "drut" | "madhya" | "vilambit" | undefined;
249
+ taal?: {
250
+ id: string;
251
+ numBeats: number;
252
+ variation?: string | undefined;
253
+ bhaags?: number[] | undefined;
254
+ sam?: number | undefined;
255
+ khaali?: number[] | undefined;
256
+ } | null | undefined;
257
+ taalName?: string | undefined;
144
258
  }, {
145
259
  notes: Note[];
146
260
  label?: string | undefined;
147
261
  lay?: "drut" | "madhya" | "vilambit" | undefined;
262
+ taal?: {
263
+ id: string;
264
+ numBeats: number;
265
+ variation?: string | undefined;
266
+ bhaags?: number[] | undefined;
267
+ sam?: number | undefined;
268
+ khaali?: number[] | undefined;
269
+ } | null | undefined;
270
+ taalName?: string | undefined;
148
271
  }>;
149
272
  type Row = z.infer<typeof rowSchema>;
150
273
  /** A structural section: আস্থায়ী / অন্তরা / সঞ্চারী / আভোগ, or free text. */
@@ -160,21 +283,102 @@ declare const partSchema: z.ZodObject<{
160
283
  * ("বিলম্বিত লয়:") in already-converted documents.
161
284
  */
162
285
  lay: z.ZodOptional<z.ZodEnum<["drut", "madhya", "vilambit"]>>;
286
+ /**
287
+ * তালফেরতা: the তাল this row switches to, held until another row changes it
288
+ * (absent on every row = the whole song in `meta.taal`). `null` = মুক্তছন্দ
289
+ * from here on: the accompaniment rests until a later row names a taal.
290
+ * Independent of `lay` — either, both or neither may change on one row.
291
+ */
292
+ taal: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodObject<{
293
+ /** Player sample key, e.g. `dadra`, `teentaal`. */
294
+ id: z.ZodString;
295
+ /**
296
+ * Which tabla loop variation to play, e.g. `pro` (CDN dir suffix). Optional
297
+ * and additive — omitted means the taal's default variation, so existing
298
+ * docs are unaffected. The player honors it but never exposes a variation
299
+ * picker; selecting a non-default variation is the consumer's premium policy.
300
+ */
301
+ variation: z.ZodOptional<z.ZodString>;
302
+ numBeats: z.ZodNumber;
303
+ /** Vibhag groupings; if given, they sum to numBeats. */
304
+ bhaags: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
305
+ /** Sam (cycle start) beat index, 0-based. */
306
+ sam: z.ZodOptional<z.ZodNumber>;
307
+ /** Khaali (wave) beat indices, 0-based. */
308
+ khaali: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
309
+ }, "strip", z.ZodTypeAny, {
310
+ id: string;
311
+ numBeats: number;
312
+ variation?: string | undefined;
313
+ bhaags?: number[] | undefined;
314
+ sam?: number | undefined;
315
+ khaali?: number[] | undefined;
316
+ }, {
317
+ id: string;
318
+ numBeats: number;
319
+ variation?: string | undefined;
320
+ bhaags?: number[] | undefined;
321
+ sam?: number | undefined;
322
+ khaali?: number[] | undefined;
323
+ }>, {
324
+ id: string;
325
+ numBeats: number;
326
+ variation?: string | undefined;
327
+ bhaags?: number[] | undefined;
328
+ sam?: number | undefined;
329
+ khaali?: number[] | undefined;
330
+ }, {
331
+ id: string;
332
+ numBeats: number;
333
+ variation?: string | undefined;
334
+ bhaags?: number[] | undefined;
335
+ sam?: number | undefined;
336
+ khaali?: number[] | undefined;
337
+ }>>>;
338
+ /** That taal's name as printed (e.g. `ষষ্ঠী(২/৪)`) — `meta.taalName`'s twin. */
339
+ taalName: z.ZodOptional<z.ZodString>;
163
340
  notes: z.ZodArray<z.ZodType<Note, z.ZodTypeDef, Note>, "many">;
164
341
  }, "strip", z.ZodTypeAny, {
165
342
  notes: Note[];
166
343
  label?: string | undefined;
167
344
  lay?: "drut" | "madhya" | "vilambit" | undefined;
345
+ taal?: {
346
+ id: string;
347
+ numBeats: number;
348
+ variation?: string | undefined;
349
+ bhaags?: number[] | undefined;
350
+ sam?: number | undefined;
351
+ khaali?: number[] | undefined;
352
+ } | null | undefined;
353
+ taalName?: string | undefined;
168
354
  }, {
169
355
  notes: Note[];
170
356
  label?: string | undefined;
171
357
  lay?: "drut" | "madhya" | "vilambit" | undefined;
358
+ taal?: {
359
+ id: string;
360
+ numBeats: number;
361
+ variation?: string | undefined;
362
+ bhaags?: number[] | undefined;
363
+ sam?: number | undefined;
364
+ khaali?: number[] | undefined;
365
+ } | null | undefined;
366
+ taalName?: string | undefined;
172
367
  }>, "many">;
173
368
  }, "strip", z.ZodTypeAny, {
174
369
  rows: {
175
370
  notes: Note[];
176
371
  label?: string | undefined;
177
372
  lay?: "drut" | "madhya" | "vilambit" | undefined;
373
+ taal?: {
374
+ id: string;
375
+ numBeats: number;
376
+ variation?: string | undefined;
377
+ bhaags?: number[] | undefined;
378
+ sam?: number | undefined;
379
+ khaali?: number[] | undefined;
380
+ } | null | undefined;
381
+ taalName?: string | undefined;
178
382
  }[];
179
383
  name?: string | undefined;
180
384
  }, {
@@ -182,61 +386,19 @@ declare const partSchema: z.ZodObject<{
182
386
  notes: Note[];
183
387
  label?: string | undefined;
184
388
  lay?: "drut" | "madhya" | "vilambit" | undefined;
389
+ taal?: {
390
+ id: string;
391
+ numBeats: number;
392
+ variation?: string | undefined;
393
+ bhaags?: number[] | undefined;
394
+ sam?: number | undefined;
395
+ khaali?: number[] | undefined;
396
+ } | null | undefined;
397
+ taalName?: string | undefined;
185
398
  }[];
186
399
  name?: string | undefined;
187
400
  }>;
188
401
  type Part = z.infer<typeof partSchema>;
189
- /**
190
- * Taal definition. `numBeats` is the cycle length in মাত্রা; `bhaags` (if
191
- * present) must sum to `numBeats`; `sam`/`khaali` are 0-based beat indices.
192
- */
193
- declare const taalSchema: z.ZodEffects<z.ZodObject<{
194
- /** Player sample key, e.g. `dadra`, `teentaal`. */
195
- id: z.ZodString;
196
- /**
197
- * Which tabla loop variation to play, e.g. `pro` (CDN dir suffix). Optional
198
- * and additive — omitted means the taal's default variation, so existing
199
- * docs are unaffected. The player honors it but never exposes a variation
200
- * picker; selecting a non-default variation is the consumer's premium policy.
201
- */
202
- variation: z.ZodOptional<z.ZodString>;
203
- numBeats: z.ZodNumber;
204
- /** Vibhag groupings; if given, they sum to numBeats. */
205
- bhaags: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
206
- /** Sam (cycle start) beat index, 0-based. */
207
- sam: z.ZodOptional<z.ZodNumber>;
208
- /** Khaali (wave) beat indices, 0-based. */
209
- khaali: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
210
- }, "strip", z.ZodTypeAny, {
211
- id: string;
212
- numBeats: number;
213
- variation?: string | undefined;
214
- bhaags?: number[] | undefined;
215
- sam?: number | undefined;
216
- khaali?: number[] | undefined;
217
- }, {
218
- id: string;
219
- numBeats: number;
220
- variation?: string | undefined;
221
- bhaags?: number[] | undefined;
222
- sam?: number | undefined;
223
- khaali?: number[] | undefined;
224
- }>, {
225
- id: string;
226
- numBeats: number;
227
- variation?: string | undefined;
228
- bhaags?: number[] | undefined;
229
- sam?: number | undefined;
230
- khaali?: number[] | undefined;
231
- }, {
232
- id: string;
233
- numBeats: number;
234
- variation?: string | undefined;
235
- bhaags?: number[] | undefined;
236
- sam?: number | undefined;
237
- khaali?: number[] | undefined;
238
- }>;
239
- type Taal = z.infer<typeof taalSchema>;
240
402
  /** Document-level metadata. */
241
403
  declare const metaSchema: z.ZodObject<{
242
404
  title: z.ZodString;
@@ -326,8 +488,6 @@ declare const metaSchema: z.ZodObject<{
326
488
  source: z.ZodOptional<z.ZodString>;
327
489
  }, "strip", z.ZodTypeAny, {
328
490
  title: string;
329
- songId?: string | undefined;
330
- nltrId?: number | undefined;
331
491
  taal?: {
332
492
  id: string;
333
493
  numBeats: number;
@@ -337,6 +497,8 @@ declare const metaSchema: z.ZodObject<{
337
497
  khaali?: number[] | undefined;
338
498
  } | undefined;
339
499
  taalName?: string | undefined;
500
+ songId?: string | undefined;
501
+ nltrId?: number | undefined;
340
502
  tonic?: string | undefined;
341
503
  bpm?: number | null | undefined;
342
504
  laySpeeds?: {
@@ -350,8 +512,6 @@ declare const metaSchema: z.ZodObject<{
350
512
  source?: string | undefined;
351
513
  }, {
352
514
  title: string;
353
- songId?: string | undefined;
354
- nltrId?: number | undefined;
355
515
  taal?: {
356
516
  id: string;
357
517
  numBeats: number;
@@ -361,6 +521,8 @@ declare const metaSchema: z.ZodObject<{
361
521
  khaali?: number[] | undefined;
362
522
  } | undefined;
363
523
  taalName?: string | undefined;
524
+ songId?: string | undefined;
525
+ nltrId?: number | undefined;
364
526
  tonic?: string | undefined;
365
527
  bpm?: number | null | undefined;
366
528
  laySpeeds?: {
@@ -466,8 +628,6 @@ declare const swaralipiSchema: z.ZodObject<{
466
628
  source: z.ZodOptional<z.ZodString>;
467
629
  }, "strip", z.ZodTypeAny, {
468
630
  title: string;
469
- songId?: string | undefined;
470
- nltrId?: number | undefined;
471
631
  taal?: {
472
632
  id: string;
473
633
  numBeats: number;
@@ -477,6 +637,8 @@ declare const swaralipiSchema: z.ZodObject<{
477
637
  khaali?: number[] | undefined;
478
638
  } | undefined;
479
639
  taalName?: string | undefined;
640
+ songId?: string | undefined;
641
+ nltrId?: number | undefined;
480
642
  tonic?: string | undefined;
481
643
  bpm?: number | null | undefined;
482
644
  laySpeeds?: {
@@ -490,8 +652,6 @@ declare const swaralipiSchema: z.ZodObject<{
490
652
  source?: string | undefined;
491
653
  }, {
492
654
  title: string;
493
- songId?: string | undefined;
494
- nltrId?: number | undefined;
495
655
  taal?: {
496
656
  id: string;
497
657
  numBeats: number;
@@ -501,6 +661,8 @@ declare const swaralipiSchema: z.ZodObject<{
501
661
  khaali?: number[] | undefined;
502
662
  } | undefined;
503
663
  taalName?: string | undefined;
664
+ songId?: string | undefined;
665
+ nltrId?: number | undefined;
504
666
  tonic?: string | undefined;
505
667
  bpm?: number | null | undefined;
506
668
  laySpeeds?: {
@@ -525,21 +687,102 @@ declare const swaralipiSchema: z.ZodObject<{
525
687
  * ("বিলম্বিত লয়:") in already-converted documents.
526
688
  */
527
689
  lay: z.ZodOptional<z.ZodEnum<["drut", "madhya", "vilambit"]>>;
690
+ /**
691
+ * তালফেরতা: the তাল this row switches to, held until another row changes it
692
+ * (absent on every row = the whole song in `meta.taal`). `null` = মুক্তছন্দ
693
+ * from here on: the accompaniment rests until a later row names a taal.
694
+ * Independent of `lay` — either, both or neither may change on one row.
695
+ */
696
+ taal: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodObject<{
697
+ /** Player sample key, e.g. `dadra`, `teentaal`. */
698
+ id: z.ZodString;
699
+ /**
700
+ * Which tabla loop variation to play, e.g. `pro` (CDN dir suffix). Optional
701
+ * and additive — omitted means the taal's default variation, so existing
702
+ * docs are unaffected. The player honors it but never exposes a variation
703
+ * picker; selecting a non-default variation is the consumer's premium policy.
704
+ */
705
+ variation: z.ZodOptional<z.ZodString>;
706
+ numBeats: z.ZodNumber;
707
+ /** Vibhag groupings; if given, they sum to numBeats. */
708
+ bhaags: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
709
+ /** Sam (cycle start) beat index, 0-based. */
710
+ sam: z.ZodOptional<z.ZodNumber>;
711
+ /** Khaali (wave) beat indices, 0-based. */
712
+ khaali: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
713
+ }, "strip", z.ZodTypeAny, {
714
+ id: string;
715
+ numBeats: number;
716
+ variation?: string | undefined;
717
+ bhaags?: number[] | undefined;
718
+ sam?: number | undefined;
719
+ khaali?: number[] | undefined;
720
+ }, {
721
+ id: string;
722
+ numBeats: number;
723
+ variation?: string | undefined;
724
+ bhaags?: number[] | undefined;
725
+ sam?: number | undefined;
726
+ khaali?: number[] | undefined;
727
+ }>, {
728
+ id: string;
729
+ numBeats: number;
730
+ variation?: string | undefined;
731
+ bhaags?: number[] | undefined;
732
+ sam?: number | undefined;
733
+ khaali?: number[] | undefined;
734
+ }, {
735
+ id: string;
736
+ numBeats: number;
737
+ variation?: string | undefined;
738
+ bhaags?: number[] | undefined;
739
+ sam?: number | undefined;
740
+ khaali?: number[] | undefined;
741
+ }>>>;
742
+ /** That taal's name as printed (e.g. `ষষ্ঠী(২/৪)`) — `meta.taalName`'s twin. */
743
+ taalName: z.ZodOptional<z.ZodString>;
528
744
  notes: z.ZodArray<z.ZodType<Note, z.ZodTypeDef, Note>, "many">;
529
745
  }, "strip", z.ZodTypeAny, {
530
746
  notes: Note[];
531
747
  label?: string | undefined;
532
748
  lay?: "drut" | "madhya" | "vilambit" | undefined;
749
+ taal?: {
750
+ id: string;
751
+ numBeats: number;
752
+ variation?: string | undefined;
753
+ bhaags?: number[] | undefined;
754
+ sam?: number | undefined;
755
+ khaali?: number[] | undefined;
756
+ } | null | undefined;
757
+ taalName?: string | undefined;
533
758
  }, {
534
759
  notes: Note[];
535
760
  label?: string | undefined;
536
761
  lay?: "drut" | "madhya" | "vilambit" | undefined;
762
+ taal?: {
763
+ id: string;
764
+ numBeats: number;
765
+ variation?: string | undefined;
766
+ bhaags?: number[] | undefined;
767
+ sam?: number | undefined;
768
+ khaali?: number[] | undefined;
769
+ } | null | undefined;
770
+ taalName?: string | undefined;
537
771
  }>, "many">;
538
772
  }, "strip", z.ZodTypeAny, {
539
773
  rows: {
540
774
  notes: Note[];
541
775
  label?: string | undefined;
542
776
  lay?: "drut" | "madhya" | "vilambit" | undefined;
777
+ taal?: {
778
+ id: string;
779
+ numBeats: number;
780
+ variation?: string | undefined;
781
+ bhaags?: number[] | undefined;
782
+ sam?: number | undefined;
783
+ khaali?: number[] | undefined;
784
+ } | null | undefined;
785
+ taalName?: string | undefined;
543
786
  }[];
544
787
  name?: string | undefined;
545
788
  }, {
@@ -547,6 +790,15 @@ declare const swaralipiSchema: z.ZodObject<{
547
790
  notes: Note[];
548
791
  label?: string | undefined;
549
792
  lay?: "drut" | "madhya" | "vilambit" | undefined;
793
+ taal?: {
794
+ id: string;
795
+ numBeats: number;
796
+ variation?: string | undefined;
797
+ bhaags?: number[] | undefined;
798
+ sam?: number | undefined;
799
+ khaali?: number[] | undefined;
800
+ } | null | undefined;
801
+ taalName?: string | undefined;
550
802
  }[];
551
803
  name?: string | undefined;
552
804
  }>, "many">;
@@ -554,8 +806,6 @@ declare const swaralipiSchema: z.ZodObject<{
554
806
  version: string;
555
807
  meta: {
556
808
  title: string;
557
- songId?: string | undefined;
558
- nltrId?: number | undefined;
559
809
  taal?: {
560
810
  id: string;
561
811
  numBeats: number;
@@ -565,6 +815,8 @@ declare const swaralipiSchema: z.ZodObject<{
565
815
  khaali?: number[] | undefined;
566
816
  } | undefined;
567
817
  taalName?: string | undefined;
818
+ songId?: string | undefined;
819
+ nltrId?: number | undefined;
568
820
  tonic?: string | undefined;
569
821
  bpm?: number | null | undefined;
570
822
  laySpeeds?: {
@@ -582,6 +834,15 @@ declare const swaralipiSchema: z.ZodObject<{
582
834
  notes: Note[];
583
835
  label?: string | undefined;
584
836
  lay?: "drut" | "madhya" | "vilambit" | undefined;
837
+ taal?: {
838
+ id: string;
839
+ numBeats: number;
840
+ variation?: string | undefined;
841
+ bhaags?: number[] | undefined;
842
+ sam?: number | undefined;
843
+ khaali?: number[] | undefined;
844
+ } | null | undefined;
845
+ taalName?: string | undefined;
585
846
  }[];
586
847
  name?: string | undefined;
587
848
  }[];
@@ -589,8 +850,6 @@ declare const swaralipiSchema: z.ZodObject<{
589
850
  version: string;
590
851
  meta: {
591
852
  title: string;
592
- songId?: string | undefined;
593
- nltrId?: number | undefined;
594
853
  taal?: {
595
854
  id: string;
596
855
  numBeats: number;
@@ -600,6 +859,8 @@ declare const swaralipiSchema: z.ZodObject<{
600
859
  khaali?: number[] | undefined;
601
860
  } | undefined;
602
861
  taalName?: string | undefined;
862
+ songId?: string | undefined;
863
+ nltrId?: number | undefined;
603
864
  tonic?: string | undefined;
604
865
  bpm?: number | null | undefined;
605
866
  laySpeeds?: {
@@ -617,6 +878,15 @@ declare const swaralipiSchema: z.ZodObject<{
617
878
  notes: Note[];
618
879
  label?: string | undefined;
619
880
  lay?: "drut" | "madhya" | "vilambit" | undefined;
881
+ taal?: {
882
+ id: string;
883
+ numBeats: number;
884
+ variation?: string | undefined;
885
+ bhaags?: number[] | undefined;
886
+ sam?: number | undefined;
887
+ khaali?: number[] | undefined;
888
+ } | null | undefined;
889
+ taalName?: string | undefined;
620
890
  }[];
621
891
  name?: string | undefined;
622
892
  }[];
@@ -53,22 +53,6 @@ var noteSchema = zod.z.lazy(
53
53
  )
54
54
  );
55
55
  var laySchema = zod.z.enum(["drut", "madhya", "vilambit"]);
56
- var rowSchema = zod.z.object({
57
- /** Optional line label (e.g. a tuk/section marker). */
58
- label: zod.z.string().optional(),
59
- /**
60
- * লয়: the tempo tier this row switches to, held until another row changes
61
- * it (absent on every row = the whole song at `meta.bpm`, i.e. দ্রুত).
62
- * Read it with `rowLay()`, which also picks up the mark NLTR *prints*
63
- * ("বিলম্বিত লয়:") in already-converted documents.
64
- */
65
- lay: laySchema.optional(),
66
- notes: zod.z.array(noteSchema)
67
- });
68
- var partSchema = zod.z.object({
69
- name: zod.z.string().optional(),
70
- rows: zod.z.array(rowSchema)
71
- });
72
56
  var taalSchema = zod.z.object({
73
57
  /** Player sample key, e.g. `dadra`, `teentaal`. */
74
58
  id: zod.z.string(),
@@ -89,6 +73,31 @@ var taalSchema = zod.z.object({
89
73
  }).refine((t) => t.bhaags === void 0 || t.bhaags.reduce((a, b) => a + b, 0) === t.numBeats, {
90
74
  message: "bhaags must sum to numBeats"
91
75
  });
76
+ var rowSchema = zod.z.object({
77
+ /** Optional line label (e.g. a tuk/section marker). */
78
+ label: zod.z.string().optional(),
79
+ /**
80
+ * লয়: the tempo tier this row switches to, held until another row changes
81
+ * it (absent on every row = the whole song at `meta.bpm`, i.e. দ্রুত).
82
+ * Read it with `rowLay()`, which also picks up the mark NLTR *prints*
83
+ * ("বিলম্বিত লয়:") in already-converted documents.
84
+ */
85
+ lay: laySchema.optional(),
86
+ /**
87
+ * তালফেরতা: the তাল this row switches to, held until another row changes it
88
+ * (absent on every row = the whole song in `meta.taal`). `null` = মুক্তছন্দ
89
+ * from here on: the accompaniment rests until a later row names a taal.
90
+ * Independent of `lay` — either, both or neither may change on one row.
91
+ */
92
+ taal: taalSchema.nullable().optional(),
93
+ /** That taal's name as printed (e.g. `ষষ্ঠী(২/৪)`) — `meta.taalName`'s twin. */
94
+ taalName: zod.z.string().optional(),
95
+ notes: zod.z.array(noteSchema)
96
+ });
97
+ var partSchema = zod.z.object({
98
+ name: zod.z.string().optional(),
99
+ rows: zod.z.array(rowSchema)
100
+ });
92
101
  var metaSchema = zod.z.object({
93
102
  title: zod.z.string(),
94
103
  /** Cross-reference to a gitabitan.io song content id (filename, immutable). */
@@ -148,6 +157,15 @@ var TAALS = {
148
157
  dhamaar: { id: "dhamaar", numBeats: 14, bhaags: [5, 2, 3, 4], sam: 0, khaali: [7] }
149
158
  // ধামার
150
159
  };
160
+ var TAAL_FERTA = "\u09A4\u09BE\u09B2\u09AB\u09C7\u09B0\u09A4\u09BE";
161
+ function isTaalFerta(name) {
162
+ return name !== void 0 && name.normalize("NFC").replace(/[\s-]/g, "") === TAAL_FERTA;
163
+ }
164
+ function sameTaal(a, b) {
165
+ if (a === b) return true;
166
+ if (!a || !b) return false;
167
+ return a.id === b.id && a.numBeats === b.numBeats && a.variation === b.variation && String(a.bhaags) === String(b.bhaags);
168
+ }
151
169
 
152
170
  // src/spec/grace.ts
153
171
  function graceNotes(grace) {
@@ -185,7 +203,7 @@ function hasTivra(letter) {
185
203
  }
186
204
 
187
205
  // src/spec/index.ts
188
- var SPEC_VERSION = "0.8.2";
206
+ var SPEC_VERSION = "0.9.1";
189
207
  function parseSwaralipi(data) {
190
208
  return swaralipiSchema.parse(data);
191
209
  }
@@ -197,12 +215,14 @@ exports.LAYS = LAYS;
197
215
  exports.LAY_SPEEDS = LAY_SPEEDS;
198
216
  exports.SPEC_VERSION = SPEC_VERSION;
199
217
  exports.TAALS = TAALS;
218
+ exports.TAAL_FERTA = TAAL_FERTA;
200
219
  exports.barSchema = barSchema;
201
220
  exports.bracketSchema = bracketSchema;
202
221
  exports.graceNotes = graceNotes;
203
222
  exports.graceSchema = graceSchema;
204
223
  exports.hasKomal = hasKomal;
205
224
  exports.hasTivra = hasTivra;
225
+ exports.isTaalFerta = isTaalFerta;
206
226
  exports.laySchema = laySchema;
207
227
  exports.metaSchema = metaSchema;
208
228
  exports.microtoneSchema = microtoneSchema;
@@ -215,6 +235,7 @@ exports.resolveLaySpeeds = resolveLaySpeeds;
215
235
  exports.rowLay = rowLay;
216
236
  exports.rowSchema = rowSchema;
217
237
  exports.safeParseSwaralipi = safeParseSwaralipi;
238
+ exports.sameTaal = sameTaal;
218
239
  exports.svaraLetterSchema = svaraLetterSchema;
219
240
  exports.svaraSchema = svaraSchema;
220
241
  exports.swaralipiSchema = swaralipiSchema;