@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.
- package/README.md +1 -1
- package/dist/{batch-6FPBT5DP.js → batch-NEM7JXHV.js} +5 -5
- package/dist/{batch-6FPBT5DP.js.map → batch-NEM7JXHV.js.map} +1 -1
- package/dist/{chunk-UMBKIGVQ.js → chunk-DOEFSS66.js} +5 -4
- package/dist/chunk-DOEFSS66.js.map +1 -0
- package/dist/{chunk-4HNT6OAT.js → chunk-MYVIQU4O.js} +12 -3
- package/dist/chunk-MYVIQU4O.js.map +1 -0
- package/dist/{chunk-4IVUPMRK.js → chunk-SEN266BY.js} +28 -13
- package/dist/chunk-SEN266BY.js.map +1 -0
- package/dist/{chunk-FULC22MN.js → chunk-Z6A3CP5V.js} +28 -19
- package/dist/chunk-Z6A3CP5V.js.map +1 -0
- package/dist/cli.cjs +33 -19
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +3 -3
- package/dist/convert/index.cjs +31 -17
- package/dist/convert/index.cjs.map +1 -1
- package/dist/convert/index.d.cts +1 -1
- package/dist/convert/index.d.ts +1 -1
- package/dist/convert/index.js +3 -3
- package/dist/index.cjs +38 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{lay-Csa4CD46.d.cts → lay-CZIzR9cM.d.ts} +16 -2
- package/dist/{lay-Ct9ky_EE.d.ts → lay-CfDlPhH2.d.cts} +16 -2
- package/dist/player/index.cjs +116 -71
- package/dist/player/index.cjs.map +1 -1
- package/dist/player/index.d.cts +11 -9
- package/dist/player/index.d.ts +11 -9
- package/dist/player/index.js +89 -66
- package/dist/player/index.js.map +1 -1
- package/dist/{schedule-B_UaluBi.d.cts → schedule-BaovCtmf.d.ts} +31 -12
- package/dist/{schedule-CdILTNsk.d.ts → schedule-CU-VECDH.d.cts} +31 -12
- package/dist/{schema-DGA_bNVZ.d.ts → schema-Cf_epUIC.d.cts} +333 -63
- package/dist/{schema-DGA_bNVZ.d.cts → schema-Cf_epUIC.d.ts} +333 -63
- package/dist/spec/index.cjs +38 -17
- package/dist/spec/index.cjs.map +1 -1
- package/dist/spec/index.d.cts +26 -8
- package/dist/spec/index.d.ts +26 -8
- package/dist/spec/index.js +2 -2
- package/dist/viewer/index.cjs +156 -73
- package/dist/viewer/index.cjs.map +1 -1
- package/dist/viewer/index.d.cts +25 -7
- package/dist/viewer/index.d.ts +25 -7
- package/dist/viewer/index.js +78 -27
- package/dist/viewer/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-4HNT6OAT.js.map +0 -1
- package/dist/chunk-4IVUPMRK.js.map +0 -1
- package/dist/chunk-FULC22MN.js.map +0 -1
- package/dist/chunk-UMBKIGVQ.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as tone from 'tone';
|
|
2
|
-
import { T as Taal, S as Swaralipi, N as Note } from './schema-
|
|
3
|
-
import { T as TaalId, L as Lay, a as LaySpeeds } from './lay-
|
|
2
|
+
import { T as Taal, S as Swaralipi, N as Note } from './schema-Cf_epUIC.js';
|
|
3
|
+
import { T as TaalId, L as Lay, a as LaySpeeds } from './lay-CZIzR9cM.js';
|
|
4
4
|
|
|
5
5
|
/** The dynamically-imported Tone module, typed without importing it. */
|
|
6
6
|
type ToneModule = typeof tone;
|
|
@@ -161,9 +161,10 @@ interface PlayEvent {
|
|
|
161
161
|
durationBeats: number;
|
|
162
162
|
/** Pitch as MIDI, or null for a rest / আ-কার hold column. */
|
|
163
163
|
midi: number | null;
|
|
164
|
-
/**
|
|
165
|
-
/** MIDI of each কণ grace on this note, in written order (empty = none). */
|
|
164
|
+
/** MIDI of each কণ grace on this column, in written order (empty = none). */
|
|
166
165
|
kan: number[];
|
|
166
|
+
/** MIDI of each রেশ grace on this column, in written order (empty = none). */
|
|
167
|
+
resh: number[];
|
|
167
168
|
/** `part.row.note` highlight path. */
|
|
168
169
|
path: string;
|
|
169
170
|
kind: 'note' | 'rest' | 'sustain';
|
|
@@ -176,10 +177,12 @@ interface PlayEvent {
|
|
|
176
177
|
glide?: true;
|
|
177
178
|
}
|
|
178
179
|
/**
|
|
179
|
-
* One
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
180
|
+
* One accompaniment stretch of the timeline: a লয় and a তাল held constant.
|
|
181
|
+
* A new segment starts wherever either changes — they are independent marks.
|
|
182
|
+
* `scale` is the fraction of the base bpm the passage sounds at, and it is
|
|
183
|
+
* exactly the factor a looping accompaniment must change its own tempo by —
|
|
184
|
+
* `beat` × secondsPerBeat gives its start in seconds. Always at least one
|
|
185
|
+
* segment, the first at beat 0.
|
|
183
186
|
*/
|
|
184
187
|
interface TempoSegment {
|
|
185
188
|
/** Start, in schedule beats (see PlayEvent.beat). */
|
|
@@ -188,6 +191,9 @@ interface TempoSegment {
|
|
|
188
191
|
endBeat: number;
|
|
189
192
|
scale: number;
|
|
190
193
|
lay: Lay;
|
|
194
|
+
/** তাল in force: `meta.taal` until a row's `taal` changes it. `null` = an
|
|
195
|
+
* explicit মুক্তছন্দ passage; `undefined` = the document names no taal. */
|
|
196
|
+
taal?: Taal | null;
|
|
191
197
|
}
|
|
192
198
|
interface Schedule {
|
|
193
199
|
events: PlayEvent[];
|
|
@@ -203,9 +209,9 @@ interface Schedule {
|
|
|
203
209
|
* no sam tick. The player/exporter apply it only when a rhythm actually loops.
|
|
204
210
|
*/
|
|
205
211
|
pickupBeats: number;
|
|
206
|
-
/** লয় stretches, in order and gapless. One entry (drut, scale 1
|
|
207
|
-
* document that never changes
|
|
208
|
-
* `row.lay` existed. */
|
|
212
|
+
/** লয় / তাল stretches, in order and gapless. One entry (drut, scale 1,
|
|
213
|
+
* `meta.taal`) for a document that never changes either — i.e. every
|
|
214
|
+
* document written before `row.lay` / `row.taal` existed. */
|
|
209
215
|
tempo: TempoSegment[];
|
|
210
216
|
}
|
|
211
217
|
interface ScheduleOptions {
|
|
@@ -255,6 +261,19 @@ declare function meendContinuations(notes: Note[]): Set<number>;
|
|
|
255
261
|
* Consumers skip events that are themselves `glide` (already consumed here).
|
|
256
262
|
*/
|
|
257
263
|
declare function glideTargets(events: PlayEvent[], i: number): PlayEvent[];
|
|
264
|
+
/** Schedule beats between a grace and its column's start; consecutive graces step by it. */
|
|
265
|
+
declare const GRACE_STEP = 0.12;
|
|
266
|
+
/**
|
|
267
|
+
* When each grace of `ev` sounds, in written order, mirrored around the
|
|
268
|
+
* column's start: a কণ (written left of its svara) touches just before it, a
|
|
269
|
+
* রেশ (written right) just after — so on a hold or rest column they touch under
|
|
270
|
+
* whatever is still ringing. Not at the column's end: every grace is a fresh
|
|
271
|
+
* strike, and one struck just before the next column is heard as its কণ.
|
|
272
|
+
*/
|
|
273
|
+
declare function graceTouches(ev: PlayEvent): {
|
|
274
|
+
midi: number;
|
|
275
|
+
beat: number;
|
|
276
|
+
}[];
|
|
258
277
|
/**
|
|
259
278
|
* Walk a document into a flat, time-ordered list of play events.
|
|
260
279
|
*
|
|
@@ -274,4 +293,4 @@ declare function glideTargets(events: PlayEvent[], i: number): PlayEvent[];
|
|
|
274
293
|
*/
|
|
275
294
|
declare function buildSchedule(doc: Swaralipi, opts?: ScheduleOptions): Schedule;
|
|
276
295
|
|
|
277
|
-
export { ARC_RAW_RE as A,
|
|
296
|
+
export { ARC_RAW_RE as A, subsetUrls as B, tablaBpms as C, type DrumVoice as D, tablaUrl as E, triggerGlide as F, GRACE_STEP as G, type InstrumentId as I, MEEND_HOLD as M, type PlayEvent as P, type Schedule as S, type TempoSegment as T, type InstrumentDef as a, DEFAULT_SOUNDS_BASE as b, DRUM_KIT_BASE as c, type GlideLeg as d, INSTRUMENTS as e, SALAMANDER_BASE as f, SAMPLED_TAALS as g, type ScheduleOptions as h, TABLA_BPMS as i, TABLA_VARIATIONS as j, TONEJS_INSTRUMENTS_BASE as k, type ToneModule as l, buildSchedule as m, createBuffers as n, drumPattern as o, glideTargets as p, graceTouches as q, instrumentSampleUrl as r, isArcRaw as s, meendContinuations as t, nearestSampleKey as u, nearestTablaBpm as v, normalizeBase as w, probeUrl as x, quantizeLoopEnd as y, santoorUrls as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as tone from 'tone';
|
|
2
|
-
import { T as Taal, S as Swaralipi, N as Note } from './schema-
|
|
3
|
-
import { T as TaalId, L as Lay, a as LaySpeeds } from './lay-
|
|
2
|
+
import { T as Taal, S as Swaralipi, N as Note } from './schema-Cf_epUIC.cjs';
|
|
3
|
+
import { T as TaalId, L as Lay, a as LaySpeeds } from './lay-CfDlPhH2.cjs';
|
|
4
4
|
|
|
5
5
|
/** The dynamically-imported Tone module, typed without importing it. */
|
|
6
6
|
type ToneModule = typeof tone;
|
|
@@ -161,9 +161,10 @@ interface PlayEvent {
|
|
|
161
161
|
durationBeats: number;
|
|
162
162
|
/** Pitch as MIDI, or null for a rest / আ-কার hold column. */
|
|
163
163
|
midi: number | null;
|
|
164
|
-
/**
|
|
165
|
-
/** MIDI of each কণ grace on this note, in written order (empty = none). */
|
|
164
|
+
/** MIDI of each কণ grace on this column, in written order (empty = none). */
|
|
166
165
|
kan: number[];
|
|
166
|
+
/** MIDI of each রেশ grace on this column, in written order (empty = none). */
|
|
167
|
+
resh: number[];
|
|
167
168
|
/** `part.row.note` highlight path. */
|
|
168
169
|
path: string;
|
|
169
170
|
kind: 'note' | 'rest' | 'sustain';
|
|
@@ -176,10 +177,12 @@ interface PlayEvent {
|
|
|
176
177
|
glide?: true;
|
|
177
178
|
}
|
|
178
179
|
/**
|
|
179
|
-
* One
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
180
|
+
* One accompaniment stretch of the timeline: a লয় and a তাল held constant.
|
|
181
|
+
* A new segment starts wherever either changes — they are independent marks.
|
|
182
|
+
* `scale` is the fraction of the base bpm the passage sounds at, and it is
|
|
183
|
+
* exactly the factor a looping accompaniment must change its own tempo by —
|
|
184
|
+
* `beat` × secondsPerBeat gives its start in seconds. Always at least one
|
|
185
|
+
* segment, the first at beat 0.
|
|
183
186
|
*/
|
|
184
187
|
interface TempoSegment {
|
|
185
188
|
/** Start, in schedule beats (see PlayEvent.beat). */
|
|
@@ -188,6 +191,9 @@ interface TempoSegment {
|
|
|
188
191
|
endBeat: number;
|
|
189
192
|
scale: number;
|
|
190
193
|
lay: Lay;
|
|
194
|
+
/** তাল in force: `meta.taal` until a row's `taal` changes it. `null` = an
|
|
195
|
+
* explicit মুক্তছন্দ passage; `undefined` = the document names no taal. */
|
|
196
|
+
taal?: Taal | null;
|
|
191
197
|
}
|
|
192
198
|
interface Schedule {
|
|
193
199
|
events: PlayEvent[];
|
|
@@ -203,9 +209,9 @@ interface Schedule {
|
|
|
203
209
|
* no sam tick. The player/exporter apply it only when a rhythm actually loops.
|
|
204
210
|
*/
|
|
205
211
|
pickupBeats: number;
|
|
206
|
-
/** লয় stretches, in order and gapless. One entry (drut, scale 1
|
|
207
|
-
* document that never changes
|
|
208
|
-
* `row.lay` existed. */
|
|
212
|
+
/** লয় / তাল stretches, in order and gapless. One entry (drut, scale 1,
|
|
213
|
+
* `meta.taal`) for a document that never changes either — i.e. every
|
|
214
|
+
* document written before `row.lay` / `row.taal` existed. */
|
|
209
215
|
tempo: TempoSegment[];
|
|
210
216
|
}
|
|
211
217
|
interface ScheduleOptions {
|
|
@@ -255,6 +261,19 @@ declare function meendContinuations(notes: Note[]): Set<number>;
|
|
|
255
261
|
* Consumers skip events that are themselves `glide` (already consumed here).
|
|
256
262
|
*/
|
|
257
263
|
declare function glideTargets(events: PlayEvent[], i: number): PlayEvent[];
|
|
264
|
+
/** Schedule beats between a grace and its column's start; consecutive graces step by it. */
|
|
265
|
+
declare const GRACE_STEP = 0.12;
|
|
266
|
+
/**
|
|
267
|
+
* When each grace of `ev` sounds, in written order, mirrored around the
|
|
268
|
+
* column's start: a কণ (written left of its svara) touches just before it, a
|
|
269
|
+
* রেশ (written right) just after — so on a hold or rest column they touch under
|
|
270
|
+
* whatever is still ringing. Not at the column's end: every grace is a fresh
|
|
271
|
+
* strike, and one struck just before the next column is heard as its কণ.
|
|
272
|
+
*/
|
|
273
|
+
declare function graceTouches(ev: PlayEvent): {
|
|
274
|
+
midi: number;
|
|
275
|
+
beat: number;
|
|
276
|
+
}[];
|
|
258
277
|
/**
|
|
259
278
|
* Walk a document into a flat, time-ordered list of play events.
|
|
260
279
|
*
|
|
@@ -274,4 +293,4 @@ declare function glideTargets(events: PlayEvent[], i: number): PlayEvent[];
|
|
|
274
293
|
*/
|
|
275
294
|
declare function buildSchedule(doc: Swaralipi, opts?: ScheduleOptions): Schedule;
|
|
276
295
|
|
|
277
|
-
export { ARC_RAW_RE as A,
|
|
296
|
+
export { ARC_RAW_RE as A, subsetUrls as B, tablaBpms as C, type DrumVoice as D, tablaUrl as E, triggerGlide as F, GRACE_STEP as G, type InstrumentId as I, MEEND_HOLD as M, type PlayEvent as P, type Schedule as S, type TempoSegment as T, type InstrumentDef as a, DEFAULT_SOUNDS_BASE as b, DRUM_KIT_BASE as c, type GlideLeg as d, INSTRUMENTS as e, SALAMANDER_BASE as f, SAMPLED_TAALS as g, type ScheduleOptions as h, TABLA_BPMS as i, TABLA_VARIATIONS as j, TONEJS_INSTRUMENTS_BASE as k, type ToneModule as l, buildSchedule as m, createBuffers as n, drumPattern as o, glideTargets as p, graceTouches as q, instrumentSampleUrl as r, isArcRaw as s, meendContinuations as t, nearestSampleKey as u, nearestTablaBpm as v, normalizeBase as w, probeUrl as x, quantizeLoopEnd as y, santoorUrls as z };
|