@onjmin/dtm 1.0.7 → 2.0.2
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 +115 -0
- package/dist/index.d.mts +268 -101
- package/dist/index.d.ts +268 -101
- package/dist/index.js +1384 -719
- package/dist/index.mjs +1355 -701
- package/dist/voice-worker.js +3 -3
- package/package.json +2 -2
package/dist/voice-worker.js
CHANGED
|
@@ -535,7 +535,7 @@
|
|
|
535
535
|
|
|
536
536
|
// src/voice-worker.ts
|
|
537
537
|
var KOE_SAMPLE_RATE = 48e3;
|
|
538
|
-
var
|
|
538
|
+
var unitsToFreq = (units) => 440 * 2 ** ((units - 2139) / 372);
|
|
539
539
|
var wself = globalThis;
|
|
540
540
|
var bank = null;
|
|
541
541
|
var worldline = null;
|
|
@@ -576,7 +576,7 @@
|
|
|
576
576
|
if (!consonantPcm || !vowelPcm) return null;
|
|
577
577
|
const spliced = spliceCompositePcm(consonantPcm, vowelPcm, KOE_SAMPLE_RATE);
|
|
578
578
|
if (!spliced) return null;
|
|
579
|
-
const targetHz =
|
|
579
|
+
const targetHz = unitsToFreq(pitch);
|
|
580
580
|
const audio = worldline.renderNote({
|
|
581
581
|
pcm: spliced.pcm,
|
|
582
582
|
pitch: vibrato ? vibratoPitchCurve(targetHz, spliced.preMs) : targetHz,
|
|
@@ -608,7 +608,7 @@
|
|
|
608
608
|
if (!pcm || pcm.length === 0) return null;
|
|
609
609
|
const entry = bank.manifest.phonemes[alias];
|
|
610
610
|
const lead = leadInFromEntry(entry);
|
|
611
|
-
const targetHz =
|
|
611
|
+
const targetHz = unitsToFreq(pitch);
|
|
612
612
|
if (worldline) {
|
|
613
613
|
const audio = worldline.renderNote({
|
|
614
614
|
pcm,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "onjmin",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "@onjmin/dtm",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "2.0.2",
|
|
6
6
|
"description": "MMLを中間言語に用いた、モバイルファーストなDAW / ピアノロール打ち込みコンポーネント",
|
|
7
7
|
"homepage": "https://onjmin.github.io/dtm",
|
|
8
8
|
"repository": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"typescript": "5.8.3"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@onjmin/chord-parser": "1.
|
|
57
|
+
"@onjmin/chord-parser": "1.1.1",
|
|
58
58
|
"@onjmin/koe": "1.0.5",
|
|
59
59
|
"midi-json-parser": "8.1.74"
|
|
60
60
|
},
|