cantor-digitalis 0.0.2 → 0.0.3
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 +42 -0
- package/dist/index.d.ts +3 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +261 -318
- package/dist/index.js.map +1 -1
- package/dist/nodes/anti-resonance.d.ts.map +1 -1
- package/dist/nodes/formant-resonator.d.ts.map +1 -1
- package/dist/nodes/glottal-formant.d.ts.map +1 -1
- package/dist/nodes/noise-source.d.ts.map +1 -1
- package/dist/nodes/pulse-train.d.ts.map +1 -1
- package/dist/nodes/spectral-tilt.d.ts.map +1 -1
- package/dist/nodes/worklet-utils.d.ts +18 -0
- package/dist/nodes/worklet-utils.d.ts.map +1 -0
- package/dist/parameters/index.d.ts +21 -5
- package/dist/parameters/index.d.ts.map +1 -1
- package/dist/parameters/vowels.d.ts +33 -5
- package/dist/parameters/vowels.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,6 +83,48 @@ Additionally, the synthesizer exposes `AudioParam` objects for the synth-level p
|
|
|
83
83
|
| `vocalTractSize` | 0–1 | Vocal tract scaling (child to giant) |
|
|
84
84
|
| `isFalsetto` | bool | Laryngeal mechanism (M1/M2) |
|
|
85
85
|
|
|
86
|
+
### Custom Vowel Tables
|
|
87
|
+
|
|
88
|
+
You may notice that the synthesizer sings with a french accent. The default vowels are the French vowel sounds from the research paper. The frequency and bandwidths of the formants for each vowel can change the character of the produced sound significantly. You can provide a custom vowel table, mapping locations in vowel space to a set of formant frequencies, amplitudes, and bandwidths. You can source these from other research papers, or analyze the formant frequencies of recorded vowel sounds using tools like [Praat](https://www.fon.hum.uva.nl/praat/).
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
import { generateSynthParams, VowelTable, defaultVowelTable } from "cantor-digitalis";
|
|
92
|
+
|
|
93
|
+
// Create a custom vowel table
|
|
94
|
+
const customTable: VowelTable = {
|
|
95
|
+
vowels: [
|
|
96
|
+
{
|
|
97
|
+
ipa: "a",
|
|
98
|
+
h: 0.5, // backness: 0 = back, 1 = front
|
|
99
|
+
v: 1, // height: 0 = close, 1 = open
|
|
100
|
+
formants: [
|
|
101
|
+
{ frequency: 700, amplitude: 0, bandwidth: 100 },
|
|
102
|
+
{ frequency: 1200, amplitude: -3, bandwidth: 120 },
|
|
103
|
+
{ frequency: 2500, amplitude: -10, bandwidth: 150 },
|
|
104
|
+
{ frequency: 3500, amplitude: -15, bandwidth: 200 },
|
|
105
|
+
{ frequency: 4500, amplitude: -20, bandwidth: 250 },
|
|
106
|
+
{ frequency: 5500, amplitude: -25, bandwidth: 300 },
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
ipa: "i",
|
|
111
|
+
h: 1, v: 0,
|
|
112
|
+
formants: [/* ... */],
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
ipa: "u",
|
|
116
|
+
h: 0, v: 0,
|
|
117
|
+
formants: [/* ... */],
|
|
118
|
+
volumeAdjustment: -5, // optional: balance overall amplitude for this vowel
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
idwPower: 2, // optional: interpolation sharpness (default: 2)
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// Use with generateSynthParams
|
|
125
|
+
const synthParams = generateSynthParams(params, { vowelTable: customTable });
|
|
126
|
+
```
|
|
127
|
+
|
|
86
128
|
### Synth Parameters
|
|
87
129
|
|
|
88
130
|
These low-level parameters directly control the audio processing and correspond to the physical/acoustic properties in the research paper.
|
package/dist/index.d.ts
CHANGED
|
@@ -7,10 +7,9 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
export { Voice } from "./nodes/voice";
|
|
10
|
-
export { generateSynthParams } from "./parameters";
|
|
11
|
-
export type { PerceptualParams, SynthParams, SynthFormant, SynthFeatures } from "./parameters";
|
|
12
|
-
export { interpolateFormants
|
|
13
|
-
export type { Formant, VowelData } from "./parameters/vowels";
|
|
10
|
+
export { generateSynthParams, defaultVowelTable } from "./parameters";
|
|
11
|
+
export type { PerceptualParams, SynthParams, SynthFormant, SynthOptions, SynthFeatures, VowelTable, VowelData, Formant, } from "./parameters";
|
|
12
|
+
export { interpolateFormants } from "./parameters/vowels";
|
|
14
13
|
export type { Node } from "./nodes/types";
|
|
15
14
|
export { GlottalFlowDerivative } from "./nodes/glottal-flow-derivative";
|
|
16
15
|
export type { GlottalFlowDerivativeParams } from "./nodes/glottal-flow-derivative";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtE,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,EACV,SAAS,EACT,OAAO,GACR,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG1D,YAAY,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,YAAY,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,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