@ugfoundation/swaralipi-js 0.14.1 → 0.15.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 +3 -1
- package/dist/{batch-J72GGBG2.js → batch-SYLHDJJL.js} +5 -5
- package/dist/{batch-J72GGBG2.js.map → batch-SYLHDJJL.js.map} +1 -1
- package/dist/{chunk-KUZSW4FN.js → chunk-J5JYJL5N.js} +3 -3
- package/dist/{chunk-KUZSW4FN.js.map → chunk-J5JYJL5N.js.map} +1 -1
- package/dist/{chunk-KOHSKHXI.js → chunk-K73Y46WU.js} +3 -3
- package/dist/{chunk-KOHSKHXI.js.map → chunk-K73Y46WU.js.map} +1 -1
- package/dist/{chunk-GIOGYJMM.js → chunk-SPZO4573.js} +36 -8
- package/dist/chunk-SPZO4573.js.map +1 -0
- package/dist/{chunk-4WDAVRET.js → chunk-WBYJUYI6.js} +6 -6
- package/dist/{chunk-4WDAVRET.js.map → chunk-WBYJUYI6.js.map} +1 -1
- package/dist/cli.cjs +4 -4
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +3 -3
- package/dist/convert/index.cjs +4 -4
- package/dist/convert/index.cjs.map +1 -1
- package/dist/convert/index.js +3 -3
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/{instruments-DTIuTlda.d.cts → instruments-C-KtHQiW.d.cts} +10 -7
- package/dist/{instruments-NcUb0ozc.d.ts → instruments-SoUQBZNd.d.ts} +10 -7
- package/dist/player/index.cjs +94 -32
- package/dist/player/index.cjs.map +1 -1
- package/dist/player/index.d.cts +22 -2
- package/dist/player/index.d.ts +22 -2
- package/dist/player/index.js +64 -30
- package/dist/player/index.js.map +1 -1
- package/dist/spec/index.cjs +2 -2
- package/dist/spec/index.cjs.map +1 -1
- package/dist/spec/index.d.cts +1 -1
- package/dist/spec/index.d.ts +1 -1
- package/dist/spec/index.js +2 -2
- package/dist/viewer/index.cjs +44 -11
- package/dist/viewer/index.cjs.map +1 -1
- package/dist/viewer/index.d.cts +4 -2
- package/dist/viewer/index.d.ts +4 -2
- package/dist/viewer/index.js +11 -6
- package/dist/viewer/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-GIOGYJMM.js.map +0 -1
package/dist/viewer/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { O as Octave, a as SvaraLetter, N as Note, M as Meta, S as Swaralipi, T as Taal } from '../schema-DZag9qkF.cjs';
|
|
2
2
|
import { L as Lay } from '../lay-CXhC-HRO.cjs';
|
|
3
|
-
import { D as DrumVoice, S as Schedule, P as PlayEvent } from '../instruments-
|
|
3
|
+
import { D as DrumVoice, S as Schedule, P as PlayEvent } from '../instruments-C-KtHQiW.cjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'tone';
|
|
6
6
|
|
|
@@ -341,7 +341,9 @@ interface AbcMeter {
|
|
|
341
341
|
* Bar lines are inserted every `beatsPerBar` matra (= one তাল cycle, so an ABC
|
|
342
342
|
* measure is one আবর্তন). This is what lets abcjs **wrap into short systems** —
|
|
343
343
|
* it only breaks lines at bar lines. `M:` is set to match so the notes-per-bar
|
|
344
|
-
* check-out. The tempo (`Q:`) rides the header.
|
|
344
|
+
* check-out. The tempo (`Q:`) rides the header. A pickup (the schedule's
|
|
345
|
+
* `samBeat`) is a short first bar, so every bar line after it is a সম — the
|
|
346
|
+
* anacrusis as ABC writes it: whatever stands before the first `|`.
|
|
345
347
|
*
|
|
346
348
|
* `drums`, if given, is the taal's per-beat `drumPattern()` — a second
|
|
347
349
|
* `V:2 clef=perc` percussion staff is added below the melody, cycling that
|
package/dist/viewer/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { O as Octave, a as SvaraLetter, N as Note, M as Meta, S as Swaralipi, T as Taal } from '../schema-DZag9qkF.js';
|
|
2
2
|
import { L as Lay } from '../lay-CWlEhImP.js';
|
|
3
|
-
import { D as DrumVoice, S as Schedule, P as PlayEvent } from '../instruments-
|
|
3
|
+
import { D as DrumVoice, S as Schedule, P as PlayEvent } from '../instruments-SoUQBZNd.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'tone';
|
|
6
6
|
|
|
@@ -341,7 +341,9 @@ interface AbcMeter {
|
|
|
341
341
|
* Bar lines are inserted every `beatsPerBar` matra (= one তাল cycle, so an ABC
|
|
342
342
|
* measure is one আবর্তন). This is what lets abcjs **wrap into short systems** —
|
|
343
343
|
* it only breaks lines at bar lines. `M:` is set to match so the notes-per-bar
|
|
344
|
-
* check-out. The tempo (`Q:`) rides the header.
|
|
344
|
+
* check-out. The tempo (`Q:`) rides the header. A pickup (the schedule's
|
|
345
|
+
* `samBeat`) is a short first bar, so every bar line after it is a সম — the
|
|
346
|
+
* anacrusis as ABC writes it: whatever stands before the first `|`.
|
|
345
347
|
*
|
|
346
348
|
* `drums`, if given, is the taal's per-beat `drumPattern()` — a second
|
|
347
349
|
* `V:2 clef=perc` percussion staff is added below the melody, cycling that
|
package/dist/viewer/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isArcRaw, glideTargets, buildSchedule, drumPattern } from '../chunk-
|
|
1
|
+
import { isArcRaw, glideTargets, buildSchedule, drumPattern } from '../chunk-SPZO4573.js';
|
|
2
2
|
import '../chunk-BSZ3WQUP.js';
|
|
3
|
-
import { hasKomal, isTaalFerta, sameTaal, TAALS, graceNotes } from '../chunk-
|
|
3
|
+
import { hasKomal, isTaalFerta, sameTaal, TAALS, graceNotes } from '../chunk-K73Y46WU.js';
|
|
4
4
|
|
|
5
5
|
// src/viewer/glyphs.ts
|
|
6
6
|
var SWARABITAN_SHUDDHA = {
|
|
@@ -1003,8 +1003,8 @@ function buildAbc(schedule, lyricOf, opts) {
|
|
|
1003
1003
|
let beatsPerBar = barLen(meters[0]);
|
|
1004
1004
|
const tokens = [];
|
|
1005
1005
|
const words = [];
|
|
1006
|
-
let barPos = 0;
|
|
1007
1006
|
const EPS2 = 1e-6;
|
|
1007
|
+
let barPos = (beatsPerBar - schedule.samBeat % beatsPerBar) % beatsPerBar;
|
|
1008
1008
|
const advance = (dur) => {
|
|
1009
1009
|
barPos += dur;
|
|
1010
1010
|
while (barPos >= beatsPerBar - EPS2) {
|
|
@@ -1052,7 +1052,7 @@ function buildAbc(schedule, lyricOf, opts) {
|
|
|
1052
1052
|
if (withDrums) {
|
|
1053
1053
|
lines.push("V:1", melodyBody);
|
|
1054
1054
|
if (opts.lyrics && words.some((w) => w !== "*" && w !== "|")) lines.push(`w: ${words.join(" ")}`);
|
|
1055
|
-
lines.push("V:2 clef=perc stem=up", buildDrumVoice(schedule.totalBeats, meters));
|
|
1055
|
+
lines.push("V:2 clef=perc stem=up", buildDrumVoice(schedule.totalBeats, meters, schedule.samBeat));
|
|
1056
1056
|
} else {
|
|
1057
1057
|
lines.push(melodyBody);
|
|
1058
1058
|
if (opts.lyrics && words.some((w) => w !== "*" && w !== "|")) lines.push(`w: ${words.join(" ")}`);
|
|
@@ -1081,7 +1081,7 @@ function percMapLines(voices) {
|
|
|
1081
1081
|
}
|
|
1082
1082
|
return lines;
|
|
1083
1083
|
}
|
|
1084
|
-
function buildDrumVoice(totalBeats, meters) {
|
|
1084
|
+
function buildDrumVoice(totalBeats, meters, pickup = 0) {
|
|
1085
1085
|
const tokens = [];
|
|
1086
1086
|
meters.forEach((m, i) => {
|
|
1087
1087
|
const bpb = barLen(m);
|
|
@@ -1090,7 +1090,12 @@ function buildDrumVoice(totalBeats, meters) {
|
|
|
1090
1090
|
if (bpb !== barLen(meters[i - 1])) tokens.push(`[M:${ratioMeter(bpb)}]`);
|
|
1091
1091
|
}
|
|
1092
1092
|
const end = meters[i + 1]?.beat ?? Math.max(1, Math.ceil(totalBeats));
|
|
1093
|
-
|
|
1093
|
+
let from = m.beat;
|
|
1094
|
+
if (i === 0 && pickup > 0 && pickup < end) {
|
|
1095
|
+
tokens.push(`z${abcDuration(pickup)}`, "|");
|
|
1096
|
+
from += pickup;
|
|
1097
|
+
}
|
|
1098
|
+
const n = Math.ceil(end - from - 1e-6);
|
|
1094
1099
|
for (let beat = 0; beat < n; beat++) {
|
|
1095
1100
|
tokens.push(m.drums?.length ? DRUM_ABC[m.drums[beat % m.drums.length]].note : "z");
|
|
1096
1101
|
if ((beat + 1) % bpb === 0) tokens.push("|");
|