bellows-voice 0.0.0-stage → 0.1.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.
Files changed (111) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +77 -2
  3. package/THIRD_PARTY_NOTICES.md +131 -0
  4. package/dist/catalog.gen.d.ts +4 -0
  5. package/dist/catalog.gen.d.ts.map +1 -0
  6. package/dist/chunk-HE3CF4RZ.js +3 -0
  7. package/dist/chunk-HE3CF4RZ.js.map +7 -0
  8. package/dist/chunk-QJYKYLE2.js +6 -0
  9. package/dist/chunk-QJYKYLE2.js.map +7 -0
  10. package/dist/dsp/air.d.ts +31 -0
  11. package/dist/dsp/air.d.ts.map +1 -0
  12. package/dist/dsp/airway-tube.d.ts +46 -0
  13. package/dist/dsp/airway-tube.d.ts.map +1 -0
  14. package/dist/dsp/area-rate.d.ts +19 -0
  15. package/dist/dsp/area-rate.d.ts.map +1 -0
  16. package/dist/dsp/cascade.d.ts +55 -0
  17. package/dist/dsp/cascade.d.ts.map +1 -0
  18. package/dist/dsp/critdamp.d.ts +99 -0
  19. package/dist/dsp/critdamp.d.ts.map +1 -0
  20. package/dist/dsp/fold-oscillator.d.ts +94 -0
  21. package/dist/dsp/fold-oscillator.d.ts.map +1 -0
  22. package/dist/dsp/geometric-glottis.d.ts +39 -0
  23. package/dist/dsp/geometric-glottis.d.ts.map +1 -0
  24. package/dist/dsp/glottal.d.ts +169 -0
  25. package/dist/dsp/glottal.d.ts.map +1 -0
  26. package/dist/dsp/junction-airway.d.ts +293 -0
  27. package/dist/dsp/junction-airway.d.ts.map +1 -0
  28. package/dist/dsp/phonation-threshold.d.ts +35 -0
  29. package/dist/dsp/phonation-threshold.d.ts.map +1 -0
  30. package/dist/dsp/pitch-servo.d.ts +32 -0
  31. package/dist/dsp/pitch-servo.d.ts.map +1 -0
  32. package/dist/dsp/pitchglide.d.ts +42 -0
  33. package/dist/dsp/pitchglide.d.ts.map +1 -0
  34. package/dist/engine.d.ts +6 -0
  35. package/dist/engine.d.ts.map +1 -0
  36. package/dist/engine.js +3 -0
  37. package/dist/engine.js.map +7 -0
  38. package/dist/engines/vocal-articulators.d.ts +22 -0
  39. package/dist/engines/vocal-articulators.d.ts.map +1 -0
  40. package/dist/engines/vocal-drive.d.ts +55 -0
  41. package/dist/engines/vocal-drive.d.ts.map +1 -0
  42. package/dist/engines/vocal-geometry.d.ts +129 -0
  43. package/dist/engines/vocal-geometry.d.ts.map +1 -0
  44. package/dist/engines/vocal-lead.d.ts +19 -0
  45. package/dist/engines/vocal-lead.d.ts.map +1 -0
  46. package/dist/engines/vocal-phonemes.d.ts +44 -0
  47. package/dist/engines/vocal-phonemes.d.ts.map +1 -0
  48. package/dist/engines/vocal-planner.d.ts +157 -0
  49. package/dist/engines/vocal-planner.d.ts.map +1 -0
  50. package/dist/engines/vocal-roof.d.ts +36 -0
  51. package/dist/engines/vocal-roof.d.ts.map +1 -0
  52. package/dist/engines/vocal-tables.gen.d.ts +50 -0
  53. package/dist/engines/vocal-tables.gen.d.ts.map +1 -0
  54. package/dist/engines/vocal.d.ts +4 -0
  55. package/dist/engines/vocal.d.ts.map +1 -0
  56. package/dist/engines/vowel-solver.d.ts +37 -0
  57. package/dist/engines/vowel-solver.d.ts.map +1 -0
  58. package/dist/index.d.ts +7 -0
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/index.js +3 -0
  61. package/dist/index.js.map +7 -0
  62. package/dist/lyrics/accents.d.ts +94 -0
  63. package/dist/lyrics/accents.d.ts.map +1 -0
  64. package/dist/lyrics/allophones.d.ts +14 -0
  65. package/dist/lyrics/allophones.d.ts.map +1 -0
  66. package/dist/lyrics/arpabet.d.ts +4 -0
  67. package/dist/lyrics/arpabet.d.ts.map +1 -0
  68. package/dist/lyrics/cmudict.d.ts +3 -0
  69. package/dist/lyrics/cmudict.d.ts.map +1 -0
  70. package/dist/lyrics/durations.d.ts +14 -0
  71. package/dist/lyrics/durations.d.ts.map +1 -0
  72. package/dist/lyrics/english.d.ts +25 -0
  73. package/dist/lyrics/english.d.ts.map +1 -0
  74. package/dist/lyrics/ipa-front-end.d.ts +9 -0
  75. package/dist/lyrics/ipa-front-end.d.ts.map +1 -0
  76. package/dist/lyrics/ipa.d.ts +20 -0
  77. package/dist/lyrics/ipa.d.ts.map +1 -0
  78. package/dist/lyrics/letter-to-sound.d.ts +4 -0
  79. package/dist/lyrics/letter-to-sound.d.ts.map +1 -0
  80. package/dist/lyrics/lexical-sets.d.ts +10 -0
  81. package/dist/lyrics/lexical-sets.d.ts.map +1 -0
  82. package/dist/lyrics/pronounce.d.ts +34 -0
  83. package/dist/lyrics/pronounce.d.ts.map +1 -0
  84. package/dist/lyrics/read.d.ts +27 -0
  85. package/dist/lyrics/read.d.ts.map +1 -0
  86. package/dist/lyrics/sing.d.ts +53 -0
  87. package/dist/lyrics/sing.d.ts.map +1 -0
  88. package/dist/lyrics/speech.d.ts +29 -0
  89. package/dist/lyrics/speech.d.ts.map +1 -0
  90. package/dist/lyrics/syllabify.d.ts +25 -0
  91. package/dist/lyrics/syllabify.d.ts.map +1 -0
  92. package/dist/lyrics/types.d.ts +87 -0
  93. package/dist/lyrics/types.d.ts.map +1 -0
  94. package/dist/plugin.d.ts +5 -0
  95. package/dist/plugin.d.ts.map +1 -0
  96. package/dist/register.d.ts +3 -0
  97. package/dist/register.d.ts.map +1 -0
  98. package/dist/sing.d.ts +67 -0
  99. package/dist/sing.d.ts.map +1 -0
  100. package/dist/singer.d.ts +131 -0
  101. package/dist/singer.d.ts.map +1 -0
  102. package/dist/text.d.ts +13 -0
  103. package/dist/text.d.ts.map +1 -0
  104. package/dist/text.js +3 -0
  105. package/dist/text.js.map +7 -0
  106. package/dist/worklet-code.gen.d.ts +2 -0
  107. package/dist/worklet-code.gen.d.ts.map +1 -0
  108. package/dist/worklet-entry.d.ts +2 -0
  109. package/dist/worklet-entry.d.ts.map +1 -0
  110. package/dist/worklet.js +2 -0
  111. package/package.json +70 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Moheeb Zara
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,78 @@
1
- # Temporary Holding Version
1
+ # bellows-voice
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A singing and speaking voice for [bellows](https://bellows.live). It is an articulatory synthesizer, a physical model of a singer: lyrics move 17 articulators (jaw, tongue, lips, velum and the rest), their positions become the shape of the throat and mouth, and air from the lungs flows through that shape in a waveguide airway. It sings and speaks English in eight accents, and IPA.
4
+
5
+ ```sh
6
+ npm install bellowsjs bellows-voice
7
+ ```
8
+
9
+ ```js
10
+ import { Bellows } from 'bellowsjs';
11
+ import { voice, singer } from 'bellows-voice';
12
+
13
+ const b = await Bellows.boot({ plugins: [voice] }); // from a click handler
14
+ const alto = singer(b, { body: 1 }); // 0 male, 1 female, 2 child
15
+
16
+ alto.sing('twinkle twinkle little star', [
17
+ { note: 'C4', dur: '4n' }, { note: 'C4', dur: '4n' },
18
+ { note: 'G4', dur: '4n' }, { note: 'G4', dur: '4n' },
19
+ { note: 'A4', dur: '4n' }, { note: 'A4', dur: '4n' },
20
+ { note: 'G4', dur: '2n' },
21
+ ], { at: b.now() + 0.5 });
22
+
23
+ alto.speak('Good morning. Where are you from?', { accent: 'australian' });
24
+ ```
25
+
26
+ `voice` is a bellows plugin: the engine, prebuilt as one script that loads into bellows' AudioWorklet beside its kernel, so a page that never sings never loads it. `singer(b, params, opts)` makes an instrument on it and gives it `sing()` and `speak()`, which reach bellows only through its public API. Notes go through bellows' tempo map and tuning like any other note.
27
+
28
+ ## Accents
29
+
30
+ ```js
31
+ const tenor = singer(b, { body: 0 }, { accent: 'southern-british' });
32
+ tenor.sing('the water in the bath was far too hot', melody, { accent: 'scottish' });
33
+ ```
34
+
35
+ Built in: `general-american` (the default), `southern-british`, `london`, `australian`, `new-zealand`, `irish`, `scottish`, `southern-us`. An accent is plain data: each of Wells's lexical sets (KIT, BATH, GOAT, NURSE...) voiced as a vowel or a diphthong with its glide timing, whether r after a vowel is said, and its t, l, th, r and h rules. Spread a built-in to make your own:
36
+
37
+ ```js
38
+ import { ACCENTS } from 'bellows-voice';
39
+ const mine = { ...ACCENTS.irish, id: 'mine', sets: { ...ACCENTS.irish.sets, FACE: 'eɪ' } };
40
+ ```
41
+
42
+ ## Text to IPA, without audio
43
+
44
+ ```js
45
+ import { toIPA, pronounce } from 'bellows-voice/text';
46
+
47
+ toIPA('far away', { accent: 'southern-british' }); // 'fɑɹ ə.ˈweɪ'
48
+ pronounce('hello').words[0].sets; // [undefined, 'GOAT']
49
+ ```
50
+
51
+ `bellows-voice/text` is pure TypeScript with no audio and no bellows, for a page, a server or a test.
52
+
53
+ ## Rendering
54
+
55
+ `b.render()` renders through the worklet with the plugin loaded, exactly as it plays. To render with `renderOffline()` or in Node without a worklet, register the engine on that thread:
56
+
57
+ ```js
58
+ import { renderOffline, registerBuiltins } from 'bellowsjs';
59
+ import { registerVoice } from 'bellows-voice/engine';
60
+ registerBuiltins();
61
+ registerVoice();
62
+ ```
63
+
64
+ ## Pronunciations
65
+
66
+ Words go through English letter-to-sound rules unless you give a pronouncing dictionary: `alto.dictionary = parseCmudict(text)` with your own copy of CMUdict (none ships). IPA between slashes, `/ˈlɪt.əl/`, sets the sounds directly.
67
+
68
+ ## Content-Security-Policy
69
+
70
+ The plugin loads through a blob URL, as bellows' kernel does. A host that blocks blob: script sources serves `bellows-voice/worklet.js` itself and passes `{ ...voice, workletUrl: '/path/to/worklet.js' }`.
71
+
72
+ ## Credits
73
+
74
+ The voice owes a large debt to [CHIMERA](https://github.com/jamesondh/chimera-vocal-synth), Jameson Hodge's physical-model voice synthesizer (MIT): the articulators and their speeds, the gesture planner, the mouth geometry, the airway's physical elements, the glottal source and the lyric front end are ported from it or learned from its code (THIRD_PARTY_NOTICES.md). The waveguide airway, the pitch behaviour, accents, speech and the vowel solver are bellows-voice's own.
75
+
76
+ Documentation: [bellows.live/docs/singing](https://bellows.live/docs/singing). Design notes: `docs/`.
77
+
78
+ MIT License.
@@ -0,0 +1,131 @@
1
+ # Third-party notices
2
+
3
+ bellows-voice is licensed under MIT (see LICENSE). Parts of it are ported from, or learned
4
+ from, the software below, which is distributed under its own license. The notice for each is
5
+ reproduced here because the build strips source comments from the executable bundles, so the
6
+ headers in the source files do not reach their code. Each bundle (`dist/index.js`,
7
+ `dist/text.js`, `dist/engine.js`, `dist/worklet.js` and the chunks they share) opens instead
8
+ with a one-line banner naming bellows-voice's license and CHIMERA's copyright and MIT license
9
+ and pointing here; the shipped source maps quote the sources whole, headers included.
10
+
11
+ This code lived in bellowsjs until 0.4.0 and moved here with its history; the paths below are
12
+ this repository's.
13
+
14
+ ## CHIMERA
15
+
16
+ CHIMERA, a physical-model voice synthesizer by Jameson Hodge.
17
+ https://github.com/jamesondh/chimera-vocal-synth
18
+
19
+ Copyright (c) 2026 Jameson Hodge
20
+
21
+ Everything below was taken from CHIMERA at commit `1d3ea49`. Where a TypeScript original is
22
+ named, it is the engine CHIMERA deleted in commit `cd247a6`, readable at `cd247a6^:src/engine`.
23
+
24
+ ### Ported from CHIMERA
25
+
26
+ These files are translations of CHIMERA's code. Each one starts with a header naming the
27
+ CHIMERA file it came from and what was changed.
28
+
29
+ | file | CHIMERA source |
30
+ | --- | --- |
31
+ | `src/dsp/glottal.ts` | `crates/chimera/src/sources/glottis.rs`, the drift in `math.rs`, the voice mapping in `voice/human_voice.rs` (TypeScript original `sources/glottis.ts`) |
32
+ | `src/lyrics/ipa.ts` | `crates/chimera/src/phonetics/ipa.rs` (`phonetics/ipa.ts`) |
33
+ | `src/lyrics/arpabet.ts` | `crates/chimera/src/phonetics/english.rs` (`phonetics/english.ts`) |
34
+ | `src/lyrics/letter-to-sound.ts` | `crates/chimera/src/phonetics/english.rs` (`phonetics/english.ts`) |
35
+ | `src/lyrics/english.ts` | `crates/chimera/src/phonetics/english.rs` and `syllables.rs` (`phonetics/english.ts`, `phonetics/syllables.ts`) |
36
+ | `src/lyrics/syllabify.ts` | `crates/chimera/src/phonetics/syllables.rs` (`phonetics/syllables.ts`) |
37
+ | `src/lyrics/read.ts` | `crates/chimera/src/phonetics/syllables.rs` (`phonetics/syllables.ts`) |
38
+ | `src/lyrics/durations.ts` | the consonant durations of `crates/chimera/src/phonetics/inventory.rs` (`phonetics/inventory.ts`) |
39
+ | `src/lyrics/types.ts` | the Segment and Syllable model of `crates/chimera/src/phonetics/mod.rs` and the FrontEnd trait of `syllables.rs` (`phonetics/syllables.ts`, `phonetics/planner.ts`) |
40
+ | `src/dsp/area-rate.ts` | the area rate limit, `crates/chimera/src/voice/human_airway.rs:151-156, 190-262`, applied to the junction airway's grid sections and their sub-section minima |
41
+ | `src/engines/vocal-geometry.ts` | the midsagittal geometry, `crates/chimera/src/anatomy/human.rs` 276-278 (body constants), 421-439 (NEUTRAL), 507-519 (constants), 644-692 (landmarks, area law, template-to-body map), 725-1263 (`compute`: jaw, velum, outer wall, lips, tongue, inner wall, grid rays, contact model, lip contact, area laws, spike clamp, lateral channel, centreline), 1266-1282 (`epilarynx_area`), 1287-1374 (`resample` with sub-section minima), 1398-1490 (`project_on`, `point_along`, `signed_gap`, `closest_approach`); `anatomy/geom.rs` (polar, rotate_about, ray_polyline, crossing_t, ray_crossings, bezier3, bezier2, arc, catmull_rom, tangent_angle); `math.rs` 89-158. Changes: preallocated point lists, results in scratch fields, a body set in place, drawing-only outputs left out |
42
+
43
+ In the repository only, `test/lyrics/chimera-golden.test.ts` carries cases converted from
44
+ CHIMERA's golden fixtures (`crates/chimera/tests/golden/phonetics-*.json`), and the lyric
45
+ tests beside it quote CHIMERA's behaviour to show where the port differs. Tests are not
46
+ published to npm.
47
+
48
+ ### Techniques learned from CHIMERA and reimplemented
49
+
50
+ These files contain no CHIMERA code. They follow an approach, a rule or a set of values found
51
+ in CHIMERA, written again in bellows' own idiom, and they say so in their headers.
52
+
53
+ | file | what follows CHIMERA |
54
+ | --- | --- |
55
+ | `src/lyrics/sing.ts` | the sung timing rules: vowel on the beat, onsets borrowing from the previous note, proportional consonant squeeze (`phonetics/sing.rs`) |
56
+ | `src/dsp/critdamp.ts` | critically damped tracking of articulation targets (`control/articulators.rs`) |
57
+ | `src/engines/vocal.ts` | the articulators and their speeds (`control/articulators.rs`), the contact rule (`voice/human_voice.rs:520-552`; here it moves only the output stage of the articulator cascade), the sung breath (`phonetics/planner.rs:376-379`), the vibrato bloom (`phonetics/sing.rs`), the voice's wiring of planner, geometry and airway |
58
+ | `src/engines/vocal-planner.ts` | the gestural planner: vowel overlap ramps, a consonant's dominant, secondary, velar-place and alveolar-fronting gestures with their lead, early and release-hold times and speeds by manner, the affricate split, the tap, the nasal velum gesture, the glottal and voiceless abduction rules and the end of the breath group, and the blend of gestures with the rest posture (`phonetics/planner.rs:24, 88-108, 196-390, 532-577`, `control/score.rs:273-430`, `voice/human_voice.rs:445`), planned online here; the return gestures, the closure-then-anterior priority, the per-articulator lead and the virtual lip target are bellows' own |
59
+ | `src/engines/vocal-roof.ts` | the roof polylines (from `anatomy/human.rs`), the template-to-body transform (`human.rs:685`), the tip kept outside the tongue body (`human.rs:828`) |
60
+ | `src/engines/vocal-drive.ts` | CHIMERA's section counts (`voice/human_airway.rs:75-80`), the area rate law on each keyframe (`human_airway.rs:190-262`), the jet rule of the smallest sub-section minimum (`airway/network.rs:919-930`), the anatomical moving-wall flow (`airway/network.rs` node continuity) |
61
+ | `src/dsp/junction-airway.ts` | the airway's elements: trachea 12 k cm by 2.5 k^2 and the lungs' resistance, the nasal profile, the glottal port (kinetic 0.37, slit 1.4 k, depth 0.3 k) and the velum port (length 1.0 k, kinetic 0.3 and 0.8), perimeter and viscous factors and wall radiation 0.25 (`voice/human_airway.rs:84-123`); viscous resistance at 700 Hz, closed area 2e-4, Borda-Carnot loss with a 0.1 contraction loss, the 60 Hz moving-wall filter, the Flanagan radiators (`airway/network.rs:360, 417, 866, 919-930, 1067-1068`); the voicing gate (`sources/glottis.rs:170-176`); the effort mapping (`voice/human_voice.rs:317-350`); the output gain (`human_voice.rs:220`). The formulation (a waveguide at Courant number 1 with the flow solved in its junctions) is bellows' own; the turbulence sources follow Stevens and Birkholz (below), not CHIMERA |
62
+ | `src/dsp/airway-tube.ts` | the fixed tubes' wall and viscous elements (`airway/network.rs:860-1010`), lumped onto a few nodes here |
63
+ | `src/dsp/air.ts` | the physical constants and the trachea's and nasal cavity's wall tissues (`physics.rs:5-35`); the tract wall's mass, 1.5 g/cm^2, is CHIMERA's `WALL_SOFT` (`physics.rs:28`), its stiffness and damping Birkholz and Zhang's (below) |
64
+ | `src/engines/vocal-tables.gen.ts` and `data/vocal/` | CHIMERA's articulator ranges and speeds, rest posture, inventory and calibrated targets, body constants and roofs, and tables measured on its geometry: the formant-tuning rows and the layout lengths (`data/vocal/README.md`) |
65
+ | `src/engines/vocal-phonemes.ts` | the phoneme classes checked against `phonetics/inventory.rs`, and the stop release rules, no aspiration after /s/, 12 ms when unaspirated, aspiration only before a vowel (`phonetics/planner.rs`) |
66
+
67
+ `src/lyrics/ipa-front-end.ts` and `src/lyrics/cmudict.ts` were written for bellows; they use
68
+ the ported tokenizer and syllabifier and read the dictionary formats CHIMERA reads.
69
+
70
+ Published research keeps its own credit, given in the files that use it: for the
71
+ articulatory voice, the digital waveguide (J. O. Smith, Physical Audio Signal Processing) and
72
+ the Kelly-Lochbaum scattering junction (Kelly and Lochbaum 1962) behind `src/dsp/junction-airway.ts`,
73
+ Jongman, Wayland and Wong (2000) for the fricative spectra its noise is calibrated against,
74
+ Stevens (Acoustic Phonetics, 1998) for the turbulence source law and corner, Birkholz (ISSP 2014)
75
+ for the constriction detection, source types, places and their split between junctions, Jackson
76
+ and Shadle (2000) and Pincas and Jackson (2005) for frication pulsing with voicing behind a
77
+ convective delay, VocalTractLab 2.4's manual for the velic noise source (implemented from the
78
+ papers and the manual, not from VocalTractLab's GPL code), Birkholz and Zhang (Interspeech 2025)
79
+ for the vocal tract wall's mass, stiffness and damping (`src/dsp/air.ts`), Story and Bunton for
80
+ the velopharyngeal port at which a stop turns nasal (`test/engines-physical/vocal.test.ts`), Pink
81
+ Trombone (Neil Thapen) as the proof that such a tract runs in a browser, Story (2005) for the
82
+ parametric area model behind the design, Saitou, Unoki and Akagi (2005) for sung pitch with
83
+ overshoot and preparation (`src/dsp/pitchglide.ts`), Sundberg for the singer's formant and
84
+ Joliveau, Smith and Wolfe (2004) for first-resonance tuning on high notes (`src/engines/vocal.ts`),
85
+ Hanson (2009) and Lofqvist et al. (1989) for the fold stiffness gesture that raises the pitch after
86
+ voiceless obstruents (`src/engines/vocal-planner.ts`); Titze (1984, 1988, 1989) and Birkholz,
87
+ Drechsel and Stone (Interspeech 2019) for the geometric two-edge glottis (`src/dsp/geometric-glottis.ts`),
88
+ Titze (1988, 1992) and Lucero (1999) for the phonation threshold and its hysteresis
89
+ (`src/dsp/phonation-threshold.ts`), Ishizaka and Flanagan (1972), Steinecke and Herzel (1995) and
90
+ Birkholz, Kroger and Neuschaefer-Rube (2011) for the self-oscillating two-mass folds
91
+ (`src/dsp/fold-oscillator.ts`); Shadle (1991) for keeping the obstacle source broadband while the
92
+ free-jet, wall and labiodental sources fall through a second pole, and the critical Reynolds number
93
+ of a turbulent jet (Flanagan, Speech Analysis, Synthesis and Perception) for the threshold under
94
+ which a constriction makes no noise (`src/dsp/junction-airway.ts`); Klatt (1980) and Gold and
95
+ Rabiner (1968) behind the resonators and the higher-pole correction in `src/dsp/resonator.ts`;
96
+ Lisker and Abramson (1964) for voice onset times; Birkholz, Kroger and Neuschaefer-Rube (2011) and
97
+ Birkholz and Hoole (2012) for the six-stage articulator cascade (`src/dsp/cascade.ts`), the
98
+ VocalTractLab 2.4 manual (Birkholz 2025) for return gestures and Lofqvist and Gracco (1997) for
99
+ the virtual lip target (`src/engines/vocal-planner.ts`), all implemented from the publications. The consonant
100
+ durations are CHIMERA's own values, not a published table; `src/lyrics/durations.ts` says how
101
+ they compare with Klatt's.
102
+
103
+ ### No dictionary data
104
+
105
+ bellows ships no pronouncing dictionary: no CMUdict and no copy of CHIMERA's. `parseCmudict()`
106
+ reads a dictionary the caller loads, and `Bellows.dictionary` or the `dictionary` option of
107
+ `sing()` takes the resulting map. Without one, words go through letter-to-sound rules.
108
+
109
+ ### License
110
+
111
+ MIT License
112
+
113
+ Copyright (c) 2026 Jameson Hodge
114
+
115
+ Permission is hereby granted, free of charge, to any person obtaining a copy
116
+ of this software and associated documentation files (the "Software"), to deal
117
+ in the Software without restriction, including without limitation the rights
118
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
119
+ copies of the Software, and to permit persons to whom the Software is
120
+ furnished to do so, subject to the following conditions:
121
+
122
+ The above copyright notice and this permission notice shall be included in all
123
+ copies or substantial portions of the Software.
124
+
125
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
126
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
127
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
128
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
129
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
130
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
131
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ import type { EngineInfo } from 'bellowsjs';
2
+ /** The vocal engine as listEngines() describes it, without its DSP. */
3
+ export declare const VOCAL_ENGINE_INFO: EngineInfo;
4
+ //# sourceMappingURL=catalog.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.gen.d.ts","sourceRoot":"","sources":["../src/catalog.gen.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,uEAAuE;AAEvE,eAAO,MAAM,iBAAiB,EAAE,UA6J/B,CAAC"}
@@ -0,0 +1,3 @@
1
+ /*! bellows-voice | MIT, Copyright (c) 2026 Moheeb Zara | includes code from CHIMERA, https://github.com/jamesondh/chimera-vocal-synth, Copyright (c) 2026 Jameson Hodge, MIT License | notices in THIRD_PARTY_NOTICES.md */
2
+ var T=["_","\u0251","\xE6","\u028C","\u0254","\u025B","\u025D","\u026A","i","\u028A","u","e","o","a","\u0259","p","b","t","d","k","g","f","v","\u03B8","\xF0","s","z","\u0283","\u0292","h","t\u0283","d\u0292","m","n","\u014B","l","\u0279","w","j","\u027E","\u0294","\u026B","\u0252","\u0250","\u025C","\u0289","\u0268","\u0258","\u0275","y","\xF8","\u0153","\u026F","\u0264"],R={\u025A:"\u025D",\u0261:"g",r:"\u0279",\u02A7:"t\u0283",\u02A4:"d\u0292"},b=new Map(T.map((s,e)=>[s,e]));function J(s){let e=b.get(s);if(e!==void 0)return e;let t=R[s];return t===void 0?-1:b.get(t)??-1}var K=1,n={cls:"vowel",voiced:!0},D={_:{cls:"silence",voiced:!1},\u0251:n,\u00E6:n,\u028C:n,\u0254:n,\u025B:n,\u025D:n,\u026A:n,i:n,\u028A:n,u:n,e:n,o:n,a:n,\u0259:n,p:{cls:"stop",voiced:!1,aspiration:1,vot:.058},b:{cls:"stop",voiced:!0,vot:.001},t:{cls:"stop",voiced:!1,aspiration:1,vot:.07},d:{cls:"stop",voiced:!0,vot:.005},k:{cls:"stop",voiced:!1,aspiration:1,vot:.08},g:{cls:"stop",voiced:!0,vot:.021},f:{cls:"fricative",voiced:!1},v:{cls:"fricative",voiced:!0},\u03B8:{cls:"fricative",voiced:!1},\u00F0:{cls:"fricative",voiced:!0},s:{cls:"fricative",voiced:!1},z:{cls:"fricative",voiced:!0},\u0283:{cls:"fricative",voiced:!1},\u0292:{cls:"fricative",voiced:!0},h:{cls:"glottal",voiced:!1},t\u0283:{cls:"affricate",voiced:!1},d\u0292:{cls:"affricate",voiced:!0},m:{cls:"nasal",voiced:!0},n:{cls:"nasal",voiced:!0},\u014B:{cls:"nasal",voiced:!0},l:{cls:"approximant",voiced:!0},\u0279:{cls:"approximant",voiced:!0},w:{cls:"approximant",voiced:!0},j:{cls:"approximant",voiced:!0},\u027E:{cls:"flap",voiced:!0},\u0294:{cls:"glottal",voiced:!1},\u026B:{cls:"approximant",voiced:!0},\u0252:n,\u0250:n,\u025C:n,\u0289:n,\u0268:n,\u0258:n,\u0275:n,y:n,\u00F8:n,\u0153:n,\u026F:n,\u0264:n},m=T.map(s=>{let e=D[s];return{ipa:s,cls:e.cls,voiced:e.voiced,aspiration:e.aspiration??0,vot:e.vot??0}}),N=.012,C=b.get("s")??-1,_=new Uint8Array(m.length),g=new Uint8Array(m.length);m.forEach((s,e)=>{_[e]=s.cls==="vowel"||s.cls==="silence"?1:s.cls==="approximant"?2:0,g[e]=s.cls==="stop"?1:0});function f(s){return s>=0&&s<m.length&&s===Math.floor(s)}function U(s,e){return f(s)&&g[s]===1&&m[s].aspiration>0&&e!==C}function Q(s,e,t){if(!f(s)||g[s]!==1||!f(t))return 0;let i=_[t];if(i===0)return 0;let r=m[s].vot;return i===1&&U(s,e)||r<N?r:N}import{clamp as l}from"bellowsjs";var y=5.83392170191739,O=.001,x=1e9,A=2*Math.PI*10,u=1e15,G=.001,X=1e9;function L(s){if(!(s>=G&&s<=X))throw new RangeError(`step rate must be within [1e-3, 1e9] Hz, got ${s}`);return 1/s}function V(s){let e=l(s,0,Number.MAX_VALUE);return e>0?y/e:x}var h=1e-30,I=class{h;omega=A;decay;x=0;v=0;goal=0;constructor(e){this.h=L(e),this.decay=Math.exp(-this.omega*this.h)}setOmega(e){if(!Number.isFinite(e))return;let t=l(e,O,x);t<this.omega&&(this.v*=t/this.omega),this.omega=t,this.decay=Math.exp(-t*this.h)}setTime(e){Number.isFinite(e)&&this.setOmega(V(e))}setTarget(e){Number.isFinite(e)&&(this.goal=l(e,-u,u))}snap(e){Number.isFinite(e)&&(this.x=this.goal=l(e,-u,u),this.v=0)}step(){let e=this.omega,t=this.x-this.goal,i=(this.v+e*t)*this.h,r=(t+i)*this.decay,o=(this.v-e*i)*this.decay;return r<h&&r>-h&&o<h&&o>-h?(this.x=this.goal,this.v=0):(this.x=this.goal+r,this.v=o),this.x}get value(){return this.x}get velocity(){return this.v}get target(){return this.goal}},P=class{channels;values;h;v;goal;omega;decay;constructor(e,t){if(!(Number.isInteger(e)&&e>0&&e<=1<<20))throw new RangeError(`channel count must be an integer from 1 to 2^20, got ${e}`);this.channels=e,this.h=L(t),this.values=new Float64Array(e),this.v=new Float64Array(e),this.goal=new Float64Array(e),this.omega=new Float64Array(e).fill(A),this.decay=new Float64Array(e).fill(Math.exp(-A*this.h))}setOmega(e,t){if(!Number.isFinite(t))return;let i=l(t,O,x);i<this.omega[e]&&(this.v[e]*=i/this.omega[e]),this.omega[e]=i,this.decay[e]=Math.exp(-i*this.h)}setTime(e,t){Number.isFinite(t)&&this.setOmega(e,V(t))}setTarget(e,t){Number.isFinite(t)&&(this.goal[e]=l(t,-u,u))}snap(e,t){Number.isFinite(t)&&(this.values[e]=this.goal[e]=l(t,-u,u),this.v[e]=0)}place(e,t,i){!Number.isFinite(t)||!Number.isFinite(i)||(this.values[e]=l(t,-u,u),this.v[e]=l(i,-u,u))}placeFrom(e,t,i){let r=t[i],o=t[i+1];r-r!==0||o-o!==0||(this.values[e]=r<-1e15?-1e15:r>1e15?1e15:r,this.v[e]=o<-1e15?-1e15:o>1e15?1e15:o)}get velocities(){return this.v}value(e){return this.values[e]}velocity(e){return this.v[e]}target(e){return this.goal[e]}setAll(e,t){for(let i=0;i<this.channels;i++){let r=e[i];r===r&&r-r===0&&(this.goal[i]=r<-1e15?-1e15:r>1e15?1e15:r);let o=t[i];if(!(o===o&&o-o===0))continue;let c=o<.001?.001:o>1e9?1e9:o;c!==this.omega[i]&&(c<this.omega[i]&&(this.v[i]*=c/this.omega[i]),this.omega[i]=c,this.decay[i]=Math.exp(-c*this.h))}}step(){let e=this.values,t=this.v,i=this.goal,r=this.omega,o=this.decay,c=this.h;for(let a=0;a<this.channels;a++){let E=r[a],F=e[a]-i[a],w=(t[a]+E*F)*c,p=(F+w)*o[a],d=(t[a]-E*w)*o[a];p<h&&p>-h&&d<h&&d>-h?(e[a]=i[a],t[a]=0):(e[a]=i[a]+p,t[a]=d)}}};import{clamp as S}from"bellowsjs";import{clamp as M}from"bellowsjs";var k=.2,j=1,v=class{h;x=0;v=0;goal=0;w=2*Math.PI*5.5;zeta=.6;prep=0;a=1;b=0;c=0;d=1;constructor(e){if(!(e>=10&&e<=1e7))throw new RangeError(`PitchGlide step rate ${e} Hz is outside [10, 1e7]`);this.h=1/e,this.update()}setSpeed(e){Number.isFinite(e)&&(this.w=2*Math.PI*M(e,.1,200),this.update())}setDamping(e){Number.isFinite(e)&&(this.zeta=M(e,k,1),this.update())}setPreparation(e){Number.isFinite(e)&&(this.prep=M(e,0,j))}setTarget(e){if(!Number.isFinite(e))return;let t=e-this.goal;this.goal=e,t!==0&&this.prep>0&&(this.v-=this.w*this.prep*t)}snap(e){Number.isFinite(e)&&(this.x=this.goal=e,this.v=0)}step(){return this.advance(),this.x}advance(){let e=this.x-this.goal,t=this.v;this.x=this.goal+this.a*e+this.b*t,this.v=this.c*e+this.d*t}get value(){return this.x}get velocity(){return this.v}get target(){return this.goal}leadTime(){let e=0,t=10/this.w;for(let i=0;i<60;i++){let r=.5*(e+t);this.stepResponse(r)<.5?e=r:t=r}return .5*(e+t)}stepResponse(e){let t=this.w,i=this.zeta,r=-1,o=-t*this.prep,c=Math.exp(-i*t*e);if(i>=1-1e-9)return 1+c*(r+(o+t*r)*e);let a=t*Math.sqrt(1-i*i);return 1+c*(r*Math.cos(a*e)+(o+i*t*r)/a*Math.sin(a*e))}update(){let e=this.w,t=this.zeta,i=this.h,r=Math.exp(-t*e*i);if(t>=1-1e-9){this.a=(1+e*i)*r,this.b=i*r,this.c=-e*e*i*r,this.d=(1-e*i)*r;return}let o=e*Math.sqrt(1-t*t),c=Math.cos(o*i),a=Math.sin(o*i);this.a=r*(c+t*e/o*a),this.b=r*a/o,this.c=-r*e*e*a/o,this.d=r*(c-t*e/o*a)}};var re=.3,q={glide:.17,overshoot:.095,preparation:.25};function $(s){let e=s>0?s<.6?s:.6:0;if(!(e>1e-6))return 1;let t=Math.log(e);return-t/Math.sqrt(Math.PI*Math.PI+t*t)}function z(s){let e=S(s,.005,.5);return y/(2*Math.PI*e)}function se(s,e,t){let i=q,r=new v(1e3);return r.setSpeed(z(Number.isFinite(s)?s:i.glide)),r.setDamping($(Number.isFinite(e)?e:i.overshoot)),r.setPreparation(S(Number.isFinite(t)?t:i.preparation,0,1)),r.leadTime()}export{T as a,J as b,K as c,m as d,U as e,Q as f,y as g,O as h,x as i,I as j,P as k,v as l,re as m,q as n,$ as o,z as p,se as q};
3
+ //# sourceMappingURL=chunk-HE3CF4RZ.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/engines/vocal-phonemes.ts", "../src/dsp/critdamp.ts", "../src/engines/vocal-lead.ts", "../src/dsp/pitchglide.ts"],
4
+ "sourcesContent": ["/*\n * The phonemes the vocal engine can render, and the index each one answers\n * to on the engine's `phoneme` parameter.\n *\n * Parameters are numbers, so a phoneme crosses into the kernel as its index\n * in VOCAL_PHONEMES, carried by an ordinary Param event. That keeps a sung\n * phrase on the same sample-accurate event path as every other automation,\n * in realtime and offline alike.\n *\n * APPEND ONLY. A saved patch or a recorded event stream stores the index,\n * so reordering this list changes what old material sings.\n *\n * What each sound is made of (its articulators, targets and gestures)\n * lives in engines/vocal-tables.gen.ts and engines/vocal-planner.ts. This\n * file keeps what a caller needs without the engine: the list, the class\n * of each sound, and the stop release rules src/sing.ts times sung\n * releases by. The classes, the voicing and the release rules follow\n * CHIMERA by Jameson Hodge (crates/chimera/src/phonetics/inventory.rs and\n * phonetics/planner.rs, at 1d3ea49). Reimplemented here. See\n * THIRD_PARTY_NOTICES.md.\n */\n\nexport const VOCAL_PHONEMES = [\n /* 0: silence inside a phrase, voicing and noise off */\n '_',\n /* 1 to 14: vowels. Diphthongs are sung as two of these. */\n '\u0251', '\u00E6', '\u028C', '\u0254', '\u025B', '\u025D', '\u026A', 'i', '\u028A', 'u', 'e', 'o', 'a', '\u0259',\n /* 15 to 20: stops */\n 'p', 'b', 't', 'd', 'k', 'g',\n /* 21 to 29: fricatives */\n 'f', 'v', '\u03B8', '\u00F0', 's', 'z', '\u0283', '\u0292', 'h',\n /* 30 to 31: affricates */\n 't\u0283', 'd\u0292',\n /* 32 to 34: nasals */\n 'm', 'n', '\u014B',\n /* 35 to 38: approximants */\n 'l', '\u0279', 'w', 'j',\n /* 39 to 40: flap and glottal stop */\n '\u027E', '\u0294',\n /* 41: the velarized (dark) lateral of a syllable coda, \"tell\", \"milk\" */\n '\u026B',\n /*\n * 42 to 53: vowels other accents need and General American lacks, bellows' own, solved from formant\n * targets (scripts/gen-extra-vowels.mjs): British LOT and NURSE, Australian STRUT and GOOSE, the\n * central and rounded front and unrounded back qualities.\n */\n '\u0252', '\u0250', '\u025C', '\u0289', '\u0268', '\u0258', '\u0275', 'y', '\u00F8', '\u0153', '\u026F', '\u0264',\n] as const;\n\nexport type VocalPhoneme = (typeof VOCAL_PHONEMES)[number];\n\n/** Spellings that mean a phoneme above. */\nconst ALIASES: Readonly<Record<string, VocalPhoneme>> = {\n \u025A: '\u025D',\n \u0261: 'g',\n r: '\u0279',\n \u02A7: 't\u0283',\n \u02A4: 'd\u0292',\n};\n\nconst INDEX = new Map<string, number>(VOCAL_PHONEMES.map((s, i) => [s, i]));\n\n/** Index of an IPA symbol on the `phoneme` parameter, through the aliases; -1 if the engine has no such sound. */\nexport function vocalPhonemeIndex(ipa: string): number {\n const direct = INDEX.get(ipa);\n if (direct !== undefined) return direct;\n const alias = ALIASES[ipa];\n return alias === undefined ? -1 : (INDEX.get(alias) ?? -1);\n}\n\n/** The default phoneme, an open /\u0251/, so a plain note-on sings \"ah\". */\nexport const VOCAL_DEFAULT_PHONEME = 1;\n\n/* ------------------------------------------------------------------ */\n/* Classes and release times */\n/* ------------------------------------------------------------------ */\n\nexport type VocalClass =\n | 'silence'\n | 'vowel'\n | 'stop'\n | 'fricative'\n | 'affricate'\n | 'nasal'\n | 'approximant'\n | 'flap'\n | 'glottal';\n\n/** One phoneme's class, voicing and release time. */\nexport interface VocalAcoustics {\n readonly ipa: VocalPhoneme;\n readonly cls: VocalClass;\n readonly voiced: boolean;\n /** 1 for a stop English aspirates (p t k), 0 otherwise. */\n readonly aspiration: number;\n /** Seconds from a stop's release to voicing (Lisker and Abramson 1964, word-initial English means); 0 for the rest. */\n readonly vot: number;\n}\n\ntype Row = { cls: VocalClass; voiced: boolean; aspiration?: number; vot?: number };\nconst V: Row = { cls: 'vowel', voiced: true };\n\n/*\n * VOT: 58, 70 and 80 ms for /p t k/, which are aspirated, and 1, 5 and 21\n * ms for /b d g/, the means usually quoted from Lisker and Abramson\n * (1964), A cross-language study of voicing in initial stops, Word 20,\n * 384-422 (CHIMERA's planner uses 50 ms for all three, planner.rs:492).\n * The classes and voicing agree with CHIMERA's inventory; /h/ is\n * 'glottal' there and here.\n */\nconst SOUNDS: Readonly<Record<VocalPhoneme, Row>> = {\n _: { cls: 'silence', voiced: false },\n \u0251: V, \u00E6: V, \u028C: V, \u0254: V, \u025B: V, \u025D: V, \u026A: V, i: V, \u028A: V, u: V, e: V, o: V, a: V, \u0259: V,\n p: { cls: 'stop', voiced: false, aspiration: 1, vot: 0.058 },\n b: { cls: 'stop', voiced: true, vot: 0.001 },\n t: { cls: 'stop', voiced: false, aspiration: 1, vot: 0.07 },\n d: { cls: 'stop', voiced: true, vot: 0.005 },\n k: { cls: 'stop', voiced: false, aspiration: 1, vot: 0.08 },\n g: { cls: 'stop', voiced: true, vot: 0.021 },\n f: { cls: 'fricative', voiced: false },\n v: { cls: 'fricative', voiced: true },\n \u03B8: { cls: 'fricative', voiced: false },\n \u00F0: { cls: 'fricative', voiced: true },\n s: { cls: 'fricative', voiced: false },\n z: { cls: 'fricative', voiced: true },\n \u0283: { cls: 'fricative', voiced: false },\n \u0292: { cls: 'fricative', voiced: true },\n h: { cls: 'glottal', voiced: false },\n t\u0283: { cls: 'affricate', voiced: false },\n d\u0292: { cls: 'affricate', voiced: true },\n m: { cls: 'nasal', voiced: true },\n n: { cls: 'nasal', voiced: true },\n \u014B: { cls: 'nasal', voiced: true },\n l: { cls: 'approximant', voiced: true },\n \u0279: { cls: 'approximant', voiced: true },\n w: { cls: 'approximant', voiced: true },\n j: { cls: 'approximant', voiced: true },\n \u027E: { cls: 'flap', voiced: true },\n \u0294: { cls: 'glottal', voiced: false },\n \u026B: { cls: 'approximant', voiced: true },\n \u0252: V, \u0250: V, \u025C: V, \u0289: V, \u0268: V, \u0258: V, \u0275: V, y: V, \u00F8: V, \u0153: V, \u026F: V, \u0264: V,\n};\n\n/** One row per entry of VOCAL_PHONEMES, in the same order. */\nexport const VOCAL_ACOUSTICS: readonly VocalAcoustics[] = VOCAL_PHONEMES.map((ipa): VocalAcoustics => {\n const s = SOUNDS[ipa];\n return { ipa, cls: s.cls, voiced: s.voiced, aspiration: s.aspiration ?? 0, vot: s.vot ?? 0 };\n});\n\n/**\n * Release to voicing of a stop that is not aspirated, in seconds: CHIMERA's\n * 12 ms for an unaspirated stop (crates/chimera/src/phonetics/planner.rs:340-349).\n */\nexport const VOCAL_UNASPIRATED_VOT = 0.012;\n\nconst S_INDEX = INDEX.get('s') ?? -1;\n/* What a stop's release is held for, by the sound it opens into: 0 nothing, 1 a vowel or silence, 2 an approximant. */\nconst RELEASE_INTO = new Uint8Array(VOCAL_ACOUSTICS.length);\nconst IS_STOP = new Uint8Array(VOCAL_ACOUSTICS.length);\nVOCAL_ACOUSTICS.forEach((row, i) => {\n RELEASE_INTO[i] = row.cls === 'vowel' || row.cls === 'silence' ? 1 : row.cls === 'approximant' ? 2 : 0;\n IS_STOP[i] = row.cls === 'stop' ? 1 : 0;\n});\n\nfunction inTable(i: number): boolean {\n return i >= 0 && i < VOCAL_ACOUSTICS.length && i === Math.floor(i);\n}\n\n/**\n * Whether the vocal engine aspirates the release of the stop at index\n * `stop`, `prev` being the sound before it (-1 at the start of a note): a\n * voiceless stop, except after /s/, where English does not aspirate (/sp\n * st sk/, CHIMERA's rule, planner.rs:340). One rule for the engine and for\n * src/sing.ts, which times sung releases by it.\n */\nexport function vocalReleaseAspirated(stop: number, prev: number): boolean {\n return inTable(stop) && IS_STOP[stop] === 1 && VOCAL_ACOUSTICS[stop].aspiration > 0 && prev !== S_INDEX;\n}\n\n/**\n * Seconds the vocal engine holds voicing at the stop's own level after\n * releasing the stop at index `stop` into the sound at `next`: the stop's\n * VOT before a vowel or silence when the release is aspirated, else\n * VOCAL_UNASPIRATED_VOT (or the stop's VOT if shorter); before an\n * approximant the short one either way, because a long aspiration would\n * devoice the whole glide of /tw/ or /kl/, which English devoices only at\n * its start. CHIMERA aspirates only before a vowel (planner.rs:341). 0\n * before any other consonant, where the release opens into that sound.\n */\nexport function vocalReleaseVot(stop: number, prev: number, next: number): number {\n if (!inTable(stop) || IS_STOP[stop] !== 1 || !inTable(next)) return 0;\n const into = RELEASE_INTO[next];\n if (into === 0) return 0;\n const vot = VOCAL_ACOUSTICS[stop].vot;\n if (into === 1 && vocalReleaseAspirated(stop, prev)) return vot;\n return vot < VOCAL_UNASPIRATED_VOT ? vot : VOCAL_UNASPIRATED_VOT;\n}\n", "/*\n * Critically damped second-order tracking: a value that glides to a target\n * the way an articulator does, starting slowly, arriving without overshoot,\n * and staying smooth in velocity when the target moves mid-glide.\n *\n * The technique follows CHIMERA by Jameson Hodge\n * (crates/chimera/src/control/articulators.rs:24-147, at 1d3ea49).\n * Reimplemented here. CHIMERA moves each articulator by\n *\n * x'' = w^2 (target - x) - 2 w x'\n *\n * with w = 2 pi times a natural frequency of 6 to 13 Hz per articulator,\n * set, its comment says, against VocalTractLab's fitted time constants of\n * 5 to 40 ms, so that step targets turn into physiologically plausible\n * motion. It steps the equation with semi-implicit Euler, which its own\n * comment notes is stable only for w dt < 1.\n *\n * This file integrates the same equation exactly instead. With the target\n * held over a step of length h, the error e = x - target obeys\n * e'' + 2w e' + w^2 e = 0, whose critically damped solution is\n *\n * e(t) = (e0 + (v0 + w e0) t) exp(-w t)\n * v(t) = (v0 - w (v0 + w e0) t) exp(-w t)\n *\n * so one step is a few multiply-adds and a precomputed exp(-w h). The result\n * is the continuous solution sampled at the step times, whatever the step\n * rate: stable for any w h, with no overshoot from rest, and the same\n * trajectory at control rate as at audio rate (the tests measure both).\n * Changing the target keeps x and x' continuous, so a new phoneme bends a\n * formant glide rather than kinking it.\n *\n * The time constant: from rest, the fraction of a step still to go after t\n * is (1 + w t) exp(-w t). It reaches 2 percent at w t = 5.8339, so setTime(s)\n * sets w = 5.8339 / s and the value is 98 percent of the way there s seconds\n * later. CHIMERA's 10 Hz articulators take 93 ms.\n *\n * Setters ignore non-finite arguments and keep the last good setting, the\n * policy of dsp/filters.ts and dsp/envelopes.ts: a NaN in x or x' would\n * never leave. Finite values go through clamp() from ../types. The only\n * state is number fields (CritDamp) or Float64Arrays sized at construction\n * (CritDampBank), so step() allocates nothing.\n */\n\nimport { clamp } from 'bellowsjs';\n\n/** The root of (1 + u) exp(-u) = 0.02: w times the 98 percent settling time. */\nexport const CRITDAMP_SETTLE_98 = 5.83392170191739;\n/** Slowest w in rad/s (98 percent in about 97 minutes). Zero would let a moving value drift forever. */\nexport const CRITDAMP_MIN_OMEGA = 1e-3;\n/** Fastest w in rad/s. Far past any step rate, so it reads as \"arrive on the next step\". */\nexport const CRITDAMP_MAX_OMEGA = 1e9;\n/** CHIMERA's most common articulator speed, 10 Hz natural frequency, as w. */\nconst DEFAULT_OMEGA = 2 * Math.PI * 10;\n/*\n * Bounds that keep every intermediate of step() finite at every legal\n * setting: with |value| <= 1e15, w <= 1e9 and h <= 1e3, w e h stays below\n * 1e28. Nothing a voice tracks (Hz, levels, semitones) comes near them.\n */\nconst VALUE_LIMIT = 1e15;\nconst MIN_STEP_RATE = 1e-3;\nconst MAX_STEP_RATE = 1e9;\n\nfunction checkRate(stepRateHz: number): number {\n if (!(stepRateHz >= MIN_STEP_RATE && stepRateHz <= MAX_STEP_RATE)) {\n throw new RangeError(`step rate must be within [1e-3, 1e9] Hz, got ${stepRateHz}`);\n }\n return 1 / stepRateHz;\n}\n\nfunction omegaForTime(seconds: number): number {\n const t = clamp(seconds, 0, Number.MAX_VALUE);\n return t > 0 ? CRITDAMP_SETTLE_98 / t : CRITDAMP_MAX_OMEGA;\n}\n\n/** An error and a velocity both under this settle on the target exactly. */\nconst SETTLED = 1e-30;\n\nexport class CritDamp {\n /** Step length in seconds. */\n private readonly h: number;\n private omega = DEFAULT_OMEGA;\n private decay: number;\n private x = 0;\n private v = 0;\n private goal = 0;\n\n /**\n * stepRateHz is how many times per second step() will be called: a\n * sample rate, or a control rate. It throws outside [1e-3, 1e9] Hz,\n * because a step length that is not a finite positive number would turn\n * every value NaN.\n */\n constructor(stepRateHz: number) {\n this.h = checkRate(stepRateHz);\n this.decay = Math.exp(-this.omega * this.h);\n }\n\n /**\n * Natural angular frequency w in rad/s, clamped to [1e-3, 1e9]. Slowing\n * down scales the velocity by the same factor: kept whole, the speed built\n * at the faster rate carries the value past its target (a 40 ms glide\n * stretched to 300 ms mid-move went 6 semitones past it), and a move that\n * was not overshooting would start to.\n */\n setOmega(radPerSec: number): void {\n if (!Number.isFinite(radPerSec)) return;\n const w = clamp(radPerSec, CRITDAMP_MIN_OMEGA, CRITDAMP_MAX_OMEGA);\n if (w < this.omega) this.v *= w / this.omega;\n this.omega = w;\n this.decay = Math.exp(-w * this.h);\n }\n\n /** Seconds for a step from rest to cover 98 percent of the way. 0 means the next step arrives. */\n setTime(seconds: number): void {\n if (!Number.isFinite(seconds)) return;\n this.setOmega(omegaForTime(seconds));\n }\n\n /** Where the value heads next, clamped to +-1e15. */\n setTarget(target: number): void {\n if (!Number.isFinite(target)) return;\n this.goal = clamp(target, -VALUE_LIMIT, VALUE_LIMIT);\n }\n\n /** Jump to value and rest there: target and value both become value, velocity 0. */\n snap(value: number): void {\n if (!Number.isFinite(value)) return;\n this.x = this.goal = clamp(value, -VALUE_LIMIT, VALUE_LIMIT);\n this.v = 0;\n }\n\n /** Advance one step and return the new value. */\n step(): number {\n const w = this.omega;\n const e = this.x - this.goal;\n const ch = (this.v + w * e) * this.h;\n const ne = (e + ch) * this.decay;\n const nv = (this.v - w * ch) * this.decay;\n // settle exactly once the motion is far under anything audible, so no\n // subnormal stays in the state (x86 without flush-to-zero pays for those)\n if (ne < SETTLED && ne > -SETTLED && nv < SETTLED && nv > -SETTLED) {\n this.x = this.goal;\n this.v = 0;\n } else {\n this.x = this.goal + ne;\n this.v = nv;\n }\n return this.x;\n }\n\n get value(): number {\n return this.x;\n }\n\n /** Units per second. */\n get velocity(): number {\n return this.v;\n }\n\n get target(): number {\n return this.goal;\n }\n}\n\n/**\n * N independent CritDamp channels in Float64Arrays with one step() over all\n * of them, for an engine that tracks a dozen or more values (formant\n * frequencies and bandwidths, source levels) at the same rate. Each channel\n * steps exactly as a CritDamp with the same settings would, bit for bit.\n * step() returns nothing, so no double crosses a call boundary for V8 to\n * box when the call is not inlined; read the results from `values`.\n */\nexport class CritDampBank {\n readonly channels: number;\n /**\n * Current values, one per channel. Exposed so a caller can read many\n * channels without a call each. Treat as read only: writing a value here\n * moves it without touching its velocity; use snap() instead.\n */\n readonly values: Float64Array;\n private readonly h: number;\n private readonly v: Float64Array;\n private readonly goal: Float64Array;\n private readonly omega: Float64Array;\n private readonly decay: Float64Array;\n\n constructor(channels: number, stepRateHz: number) {\n if (!(Number.isInteger(channels) && channels > 0 && channels <= 1 << 20)) {\n throw new RangeError(`channel count must be an integer from 1 to 2^20, got ${channels}`);\n }\n this.channels = channels;\n this.h = checkRate(stepRateHz);\n this.values = new Float64Array(channels);\n this.v = new Float64Array(channels);\n this.goal = new Float64Array(channels);\n this.omega = new Float64Array(channels).fill(DEFAULT_OMEGA);\n this.decay = new Float64Array(channels).fill(Math.exp(-DEFAULT_OMEGA * this.h));\n }\n\n /** As CritDamp.setOmega, for channel i. */\n setOmega(i: number, radPerSec: number): void {\n if (!Number.isFinite(radPerSec)) return;\n const w = clamp(radPerSec, CRITDAMP_MIN_OMEGA, CRITDAMP_MAX_OMEGA);\n if (w < this.omega[i]) this.v[i] *= w / this.omega[i];\n this.omega[i] = w;\n this.decay[i] = Math.exp(-w * this.h);\n }\n\n /** As CritDamp.setTime, for channel i. */\n setTime(i: number, seconds: number): void {\n if (!Number.isFinite(seconds)) return;\n this.setOmega(i, omegaForTime(seconds));\n }\n\n /** As CritDamp.setTarget, for channel i. */\n setTarget(i: number, target: number): void {\n if (!Number.isFinite(target)) return;\n this.goal[i] = clamp(target, -VALUE_LIMIT, VALUE_LIMIT);\n }\n\n /** As CritDamp.snap, for channel i. */\n snap(i: number, value: number): void {\n if (!Number.isFinite(value)) return;\n this.values[i] = this.goal[i] = clamp(value, -VALUE_LIMIT, VALUE_LIMIT);\n this.v[i] = 0;\n }\n\n /**\n * Move channel i to `value` with velocity `velocity`, keeping its target:\n * for a constraint that pushes a value back (a tongue against the\n * palate) and removes only the part of its motion that went into it.\n */\n place(i: number, value: number, velocity: number): void {\n if (!Number.isFinite(value) || !Number.isFinite(velocity)) return;\n this.values[i] = clamp(value, -VALUE_LIMIT, VALUE_LIMIT);\n this.v[i] = clamp(velocity, -VALUE_LIMIT, VALUE_LIMIT);\n }\n\n /**\n * Channel i moved as place() would, to src[at] with velocity src[at + 1]:\n * no double crosses the call (V8 boxes doubles passed to a call it does\n * not inline).\n */\n placeFrom(i: number, src: Float64Array, at: number): void {\n const value = src[at];\n const velocity = src[at + 1];\n if (!(value - value === 0) || !(velocity - velocity === 0)) return;\n this.values[i] = value < -1e15 ? -1e15 : value > 1e15 ? 1e15 : value;\n this.v[i] = velocity < -1e15 ? -1e15 : velocity > 1e15 ? 1e15 : velocity;\n }\n\n /** Current velocities, one per channel (read only, like values). */\n get velocities(): Float64Array {\n return this.v;\n }\n\n value(i: number): number {\n return this.values[i];\n }\n\n velocity(i: number): number {\n return this.v[i];\n }\n\n target(i: number): number {\n return this.goal[i];\n }\n\n /**\n * Every channel's target from targets[i] and natural frequency from\n * omegas[i] (rad/s), as setTarget and setOmega would set them one by one;\n * one call with arrays passes no doubles for V8 to box.\n */\n setAll(targets: Float64Array, omegas: Float64Array): void {\n for (let i = 0; i < this.channels; i++) {\n const t = targets[i];\n // the limits are literals here: a module constant merged with a double in a conditional made V8\n // box the double (MEASURED: 7 bytes a sample of the vocal engine's control path)\n if (t === t && t - t === 0) this.goal[i] = t < -1e15 ? -1e15 : t > 1e15 ? 1e15 : t;\n const r = omegas[i];\n if (!(r === r && r - r === 0)) continue;\n const w = r < 1e-3 ? 1e-3 : r > 1e9 ? 1e9 : r;\n if (w !== this.omega[i]) {\n if (w < this.omega[i]) this.v[i] *= w / this.omega[i];\n this.omega[i] = w;\n this.decay[i] = Math.exp(-w * this.h);\n }\n }\n }\n\n /** Advance every channel one step. */\n step(): void {\n const x = this.values;\n const v = this.v;\n const goal = this.goal;\n const omega = this.omega;\n const decay = this.decay;\n const h = this.h;\n for (let i = 0; i < this.channels; i++) {\n const w = omega[i];\n const e = x[i] - goal[i];\n const ch = (v[i] + w * e) * h;\n const ne = (e + ch) * decay[i];\n const nv = (v[i] - w * ch) * decay[i];\n if (ne < SETTLED && ne > -SETTLED && nv < SETTLED && nv > -SETTLED) {\n x[i] = goal[i];\n v[i] = 0;\n } else {\n x[i] = goal[i] + ne;\n v[i] = nv;\n }\n }\n }\n}\n", "/*\n * The vocal engine's timing, apart from its DSP: how far ahead sing() posts each sound and each\n * bend. The facade needs these on the main thread to plan a sung line, and importing them from\n * engines/vocal.ts pulled the whole voice (airway, geometry, planner, tables) into every page that\n * sings, beside the copy the AudioWorklet already carries. Only the glide filter comes along here.\n */\n\nimport { clamp } from 'bellowsjs';\nimport { CRITDAMP_SETTLE_98 } from '../dsp/critdamp';\nimport { PitchGlide } from '../dsp/pitchglide';\n\n/** How far ahead src/sing.ts posts each sound as `nextPhoneme`, seconds. */\nexport const VOCAL_PLAN_LEAD = 0.3;\n\n/** The glide, overshoot and preparation defaults of the vocal engine's params. */\nexport const VOCAL_GLIDE_DEFAULTS = { glide: 0.17, overshoot: 0.095, preparation: 0.25 } as const;\n\n/** Damping for an overshoot fraction of a step without preparation: the inverse of exp(-pi zeta / sqrt(1 - zeta^2)). */\nexport function vocalDamping(overshoot: number): number {\n const os = overshoot > 0 ? (overshoot < 0.6 ? overshoot : 0.6) : 0;\n if (!(os > 1e-6)) return 1;\n const l = Math.log(os);\n return -l / Math.sqrt(Math.PI * Math.PI + l * l);\n}\n\n/** The glide's natural frequency for a `glide` time, Hz. */\nexport function vocalGlideSpeed(glide: number): number {\n const g = clamp(glide, 0.005, 0.5);\n return CRITDAMP_SETTLE_98 / (2 * Math.PI * g);\n}\n\n/**\n * Seconds a pitch change takes to be half way, for a channel's glide,\n * overshoot and preparation (the engine's defaults where undefined): post a\n * bend this much early and the glide crosses the middle on the note.\n */\nexport function vocalGlideLead(glide?: number, overshoot?: number, preparation?: number): number {\n const d = VOCAL_GLIDE_DEFAULTS;\n const g = new PitchGlide(1000);\n g.setSpeed(vocalGlideSpeed(Number.isFinite(glide) ? (glide as number) : d.glide));\n g.setDamping(vocalDamping(Number.isFinite(overshoot) ? (overshoot as number) : d.overshoot));\n g.setPreparation(clamp(Number.isFinite(preparation) ? (preparation as number) : d.preparation, 0, 1));\n return g.leadTime();\n}\n", "/*\n * A sung note change: pitch that prepares, glides, overshoots and settles,\n * as a singer's does, from one second-order system stepped exactly.\n *\n * Saitou, Unoki and Akagi model sung F0 as the score's step melody plus\n * components a singer adds: preparation (a small move opposite to a note\n * change, just before it), overshoot (passing the new note just after it),\n * vibrato and fine fluctuation. They make overshoot and preparation with\n * second-order systems, and in their listening tests every component\n * affected perceived quality and overshoot affected it most (Speech\n * Communication 47, 2005). A critically damped glide, which the first vocal\n * engine and CHIMERA both use, has neither.\n *\n * Here both come from one transfer function,\n *\n * H(s) = w^2 (1 - s/z) / (s^2 + 2 zeta w s + w^2),\n *\n * whose damping below 1 overshoots and whose right-half-plane zero at z\n * makes a step start out the wrong way: the preparation. Written as\n * x'' + 2 zeta w x' + w^2 x = w^2 u - (w^2 / z) u', a step of size d in the\n * target u is an impulse in u', so it adds -(w^2 / z) d = -w p d to the\n * velocity at that instant, with p = w / z the preparation amount. Between\n * steps the error e = x - u decays exactly:\n *\n * e(t) = exp(-zeta w t) (e0 cos(wd t) + (v0 + zeta w e0) / wd sin(wd t))\n * v(t) = exp(-zeta w t) (v0 cos(wd t) - (zeta w v0 + w^2 e0) / wd sin(wd t))\n *\n * with wd = w sqrt(1 - zeta^2), and at zeta = 1 the critically damped limit\n * of src/dsp/critdamp.ts. So one step is a few multiply-adds and a\n * precomputed exp, cos and sin, the trajectory is the continuous one\n * sampled at the step times whatever the step rate, and a preparation that\n * should land before the note means posting the target early by\n * leadTime().\n *\n * The defaults are INFERRED, not Saitou's fitted values: about 5.5 Hz\n * natural frequency and damping 0.6 (an overshoot of 9.5 percent of the\n * interval), and no preparation.\n */\n\nimport { clamp } from 'bellowsjs';\n\nconst MIN_DAMPING = 0.2;\nconst MAX_PREPARATION = 1;\n\nexport class PitchGlide {\n private readonly h: number;\n private x = 0;\n private v = 0;\n private goal = 0;\n private w = 2 * Math.PI * 5.5;\n private zeta = 0.6;\n private prep = 0;\n // the step's coefficients: [e', v'] = [[a, b], [c, d]] [e, v]\n private a = 1;\n private b = 0;\n private c = 0;\n private d = 1;\n\n /** stepRateHz: how often step() runs, a sample rate or a control rate. Throws outside [10, 1e7] Hz. */\n constructor(stepRateHz: number) {\n if (!(stepRateHz >= 10 && stepRateHz <= 1e7)) throw new RangeError(`PitchGlide step rate ${stepRateHz} Hz is outside [10, 1e7]`);\n this.h = 1 / stepRateHz;\n this.update();\n }\n\n /** Natural frequency in Hz: how fast a glide moves, about 3 to 10 for a voice. */\n setSpeed(hz: number): void {\n if (!Number.isFinite(hz)) return;\n this.w = 2 * Math.PI * clamp(hz, 0.1, 200);\n this.update();\n }\n\n /** Damping, [0.2, 1]: 1 glides without overshoot, 0.5 overshoots by 16 percent of the interval. */\n setDamping(zeta: number): void {\n if (!Number.isFinite(zeta)) return;\n this.zeta = clamp(zeta, MIN_DAMPING, 1);\n this.update();\n }\n\n /** Preparation, [0, 1]: how far a note change first moves the wrong way. 0 is none. */\n setPreparation(amount: number): void {\n if (!Number.isFinite(amount)) return;\n this.prep = clamp(amount, 0, MAX_PREPARATION);\n }\n\n /** Move toward a new target from wherever the glide is, with preparation and overshoot. */\n setTarget(target: number): void {\n if (!Number.isFinite(target)) return;\n const jump = target - this.goal;\n this.goal = target;\n if (jump !== 0 && this.prep > 0) this.v -= this.w * this.prep * jump;\n }\n\n /** Jump straight to a value, at rest. */\n snap(value: number): void {\n if (!Number.isFinite(value)) return;\n this.x = this.goal = value;\n this.v = 0;\n }\n\n /** Advance one step; returns the value. */\n step(): number {\n this.advance();\n return this.x;\n }\n\n /** Advance one step and leave the value in `value`: no double crosses the call. */\n advance(): void {\n const e = this.x - this.goal;\n const v = this.v;\n this.x = this.goal + this.a * e + this.b * v;\n this.v = this.c * e + this.d * v;\n }\n\n get value(): number {\n return this.x;\n }\n\n get velocity(): number {\n return this.v;\n }\n\n get target(): number {\n return this.goal;\n }\n\n /**\n * Seconds a step from rest takes to cover half the interval: post a note\n * change this much early and its glide is half way at the note's time,\n * with the preparation before it and the overshoot after.\n */\n leadTime(): number {\n // the step response is monotone in the first half, so bisect on it in closed form\n let lo = 0;\n let hi = 10 / this.w;\n for (let i = 0; i < 60; i++) {\n const t = 0.5 * (lo + hi);\n if (this.stepResponse(t) < 0.5) lo = t;\n else hi = t;\n }\n return 0.5 * (lo + hi);\n }\n\n /** The unit step response at time t (from rest at 0, target 1), closed form. */\n stepResponse(t: number): number {\n const w = this.w;\n const zeta = this.zeta;\n const e0 = -1;\n const v0 = -w * this.prep;\n const k = Math.exp(-zeta * w * t);\n if (zeta >= 1 - 1e-9) return 1 + k * (e0 + (v0 + w * e0) * t);\n const wd = w * Math.sqrt(1 - zeta * zeta);\n return 1 + k * (e0 * Math.cos(wd * t) + ((v0 + zeta * w * e0) / wd) * Math.sin(wd * t));\n }\n\n private update(): void {\n const w = this.w;\n const zeta = this.zeta;\n const h = this.h;\n const k = Math.exp(-zeta * w * h);\n if (zeta >= 1 - 1e-9) {\n // e(h) = (e0 + (v0 + w e0) h) k, v(h) = (v0 - w (v0 + w e0) h) k\n this.a = (1 + w * h) * k;\n this.b = h * k;\n this.c = -w * w * h * k;\n this.d = (1 - w * h) * k;\n return;\n }\n const wd = w * Math.sqrt(1 - zeta * zeta);\n const cs = Math.cos(wd * h);\n const sn = Math.sin(wd * h);\n this.a = k * (cs + ((zeta * w) / wd) * sn);\n this.b = (k * sn) / wd;\n this.c = (-k * w * w * sn) / wd;\n this.d = k * (cs - ((zeta * w) / wd) * sn);\n }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NDS", "VOCAL_ACOUSTICS", "s", "VOCAL_UNASPIRATED_VOT", "S_INDEX", "RELEASE_INTO", "IS_STOP", "row", "inTable", "vocalReleaseAspirated", "stop", "prev", "vocalReleaseVot", "next", "into", "vot", "clamp", "CRITDAMP_SETTLE_98", "CRITDAMP_MIN_OMEGA", "CRITDAMP_MAX_OMEGA", "DEFAULT_OMEGA", "VALUE_LIMIT", "MIN_STEP_RATE", "MAX_STEP_RATE", "checkRate", "stepRateHz", "omegaForTime", "seconds", "t", "SETTLED", "CritDamp", "radPerSec", "w", "target", "value", "e", "ch", "ne", "nv", "CritDampBank", "channels", "i", "velocity", "src", "at", "targets", "omegas", "r", "x", "v", "goal", "omega", "decay", "h", "clamp", "clamp", "MIN_DAMPING", "MAX_PREPARATION", "PitchGlide", "stepRateHz", "hz", "zeta", "amount", "target", "jump", "value", "v", "lo", "hi", "t", "w", "e0", "v0", "k", "wd", "h", "cs", "sn", "VOCAL_PLAN_LEAD", "VOCAL_GLIDE_DEFAULTS", "vocalDamping", "overshoot", "os", "l", "vocalGlideSpeed", "glide", "g", "clamp", "CRITDAMP_SETTLE_98", "vocalGlideLead", "preparation", "d", "PitchGlide"]
7
+ }
@@ -0,0 +1,6 @@
1
+ /*! bellows-voice | MIT, Copyright (c) 2026 Moheeb Zara | includes code from CHIMERA, https://github.com/jamesondh/chimera-vocal-synth, Copyright (c) 2026 Jameson Hodge, MIT License | notices in THIRD_PARTY_NOTICES.md */
2
+ var ee="iy\u0268\u0289\u026Fu\u026A\u028F\u028Ae\xF8\u0258\u0275\u0264o\u0259\u025B\u0153\u025C\u025E\u028C\u0254\xE6\u0250a\u0276\u0251\u0252\u025D\u025A",Ce="pbtd\u0288\u0256c\u025Fkgq\u0262\u0294m\u0271n\u0273\u0272\u014B\u0274\u0278\u03B2fv\u03B8\xF0sz\u0283\u0292\u0282\u0290\xE7\u029Dx\u0263\u03C7\u0281\u0127\u0295h\u0266\u026C\u026E\u0255\u0291w\u028B\u0279\u027Bj\u0265\u0270l\u026B\u026D\u028E\u027E\u027Dr\u0280\u0299",ne=["t\u0283","d\u0292","a\u026A","a\u028A","\u0254\u026A","e\u026A","o\u028A"],Ne=new Map([["\u0261","g"],["\u02A7","t\u0283"],["\u02A4","d\u0292"],["\u03B5","\u025B"],["\u03B1","\u0251"],["\u1D7B","\u026A"],["\u1D7F","\u028A"],["\u0269","\u026A"],["\u0277","\u028A"],["\u02A6","ts"],["\u02A3","dz"],["\u02A8","t\u0255"],["\u02A5","d\u0291"]]),Le=/^(?=[\p{Ll}\p{Lo}])[\p{Script=Latin}\p{Script=Greek}]$/u,xe=new Set(Array.from(ee)),v=new Set([...ee,...Ce,...ne]),H="_",Ie=.16,Pe=.15,Ue=.09,De=1.7,We="\u0329",Fe="\u030D",ve=/[\u035C\u0361]/g,N=0,M=1,L=2;function p(e){let n=e.codePointAt(0);return n!==void 0&&xe.has(String.fromCodePoint(n))}function Me(e){return k(e).segments}function k(e){let n=Array.from(Ye(e)),r=[],t=[],o=0,s=0;for(;s<n.length;){let i=n[s];if(i==="\u02C8"||i==="'"){o=1,s++;continue}if(i==="\u02CC"){o=2,s++;continue}if(i==="."){F(t,M),s++;continue}if(i===","||i==="|"||i==="\u2016"){F(t,L),r.push({ipa:H,dur:Ie}),t.push(N),s++;continue}if(/\s/.test(i)){F(t,L),s++;continue}if(i==="\u02D0"||i===":"){let f=r[r.length-1];if(f){let u=p(f.ipa)?Pe:Ue;f.dur=(f.dur??u)*De}s++;continue}let a=i;for(let f of ne)ke(n,s,f)&&(a=f);s+=a===i?1:Array.from(a).length;let l=!1;for(;s<n.length&&ze(n[s]);)(n[s]===We||n[s]===Fe)&&(l=!0),s++;if(!(!v.has(a)&&!Le.test(a))){if(p(a)){r.push({ipa:a,stress:o}),t.push(N),o=0;continue}l&&(r.push({ipa:"\u0259",stress:o}),t.push(N),o=0),r.push({ipa:a}),t.push(N)}}return{segments:r,breaks:t}}function F(e,n){let r=e.length-1;r>=0&&e[r]<n&&(e[r]=n)}function ke(e,n,r){let t=n;for(let o of r){if(e[t]!==o)return!1;t++}return!0}function ze(e){return e>="\u0300"&&e<="\u036F"}function Ye(e){let n="";for(let r of e.normalize("NFC")){if(v.has(r)){n+=r;continue}let t=Ne.get(r);if(t!==void 0){n+=t;continue}let o=Array.from(r.normalize("NFD"));if(o.length>1){let s=(o[0]+o[1]).normalize("NFC");if(v.has(s)){n+=s+o.slice(2).join("");continue}}n+=o.join("")}return n.replace(ve,"")}var Ge=new Map([["AA","\u0251"],["AE","\xE6"],["AH","\u028C"],["AO","\u0254"],["AW","a\u028A"],["AY","a\u026A"],["EH","\u025B"],["ER","\u025D"],["EY","e\u026A"],["IH","\u026A"],["IY","i"],["OW","o\u028A"],["OY","\u0254\u026A"],["UH","\u028A"],["UW","u"],["B","b"],["CH","t\u0283"],["D","d"],["DH","\xF0"],["F","f"],["G","g"],["HH","h"],["JH","d\u0292"],["K","k"],["L","l"],["M","m"],["N","n"],["NG","\u014B"],["P","p"],["R","\u0279"],["S","s"],["SH","\u0283"],["T","t"],["TH","\u03B8"],["V","v"],["W","w"],["Y","j"],["Z","z"],["ZH","\u0292"]]),Ve=/^([A-Z]+)([012])?$/;function z(e){let n=[];for(let r of e.trim().split(/\s+/)){let t=Ve.exec(r);if(!t)continue;let o=t[1],s=t[2]==="1"?1:t[2]==="2"?2:0,i=Ge.get(o);i!==void 0&&(s===0&&o==="AH"&&(i="\u0259"),s===0&&o==="ER"&&(i="\u025A"),n.push(p(i)?{ipa:i,stress:s}:{ipa:i}))}return n}var Y=[["#C","ed","#","\u025B d"],["#CC","ed","#","\u025B d"],["#CCC","ed","#","\u025B d"],["#C","es","#","\u025B s"],["#CC","es","#","\u025B s"],["#y","es","#","\u025B s"],["t","ed","#","\u026A d"],["d","ed","#","\u026A d"],["k","ed","#","t"],["p","ed","#","t"],["s","ed","#","t"],["f","ed","#","t"],["x","ed","#","t"],["h","ed","#","t"],["c","ed","#","t"],["s","es","#","\u026A z"],["z","es","#","\u026A z"],["x","es","#","\u026A z"],["h","es","#","\u026A z"],["c","es","#","\u026A z"],["g","es","#","\u026A z"],["r","s","#","z"],["l","s","#","z"],["m","s","#","z"],["n","s","#","z"],["d","s","#","z"],["g","s","#","z"],["b","s","#","z"],["v","s","#","z"],["w","s","#","z"],["u","s","#","s"],["","ng","s#","\u014B"],["","ng","ing","\u014B"],["","ng","ly","\u014B"],["","ng","ed#","\u014B"],["","n","k","\u014B"],["","iew","","j u"],["f","ew","","j u"],["p","ew","","j u"],["m","ew","","j u"],["h","ew","","j u"],["","ew","","u"],["","cious","","\u0283 \u0259 s"],["","tious","","\u0283 \u0259 s"],["","ous","#","\u0259 s"],["#h","ow","","a\u028A"],["#n","ow","","a\u028A"],["#c","ow","","a\u028A"],["#w","ow","","a\u028A"],["#v","ow","","a\u028A"],["#all","ow","","a\u028A"],["","ow","s#","o\u028A"],["","ow","ing","o\u028A"],["","ow","ly","o\u028A"],["","ow","ed#","o\u028A"],["#","ow","n","o\u028A"],["l","ow","n","o\u028A"],["h","ow","n","o\u028A"],["n","ow","n","o\u028A"],["gr","ow","n","o\u028A"],["thr","ow","n","o\u028A"],["","o","#","o\u028A"],["","o","ld","o\u028A"],["","o","lt","o\u028A"],["","i","nd#","a\u026A"],["","i","nds#","a\u026A"],["","i","nding","a\u026A"],["","i","ndly","a\u026A"],["","i","ndness","a\u026A"],["","i","ld#","a\u026A"],["","i","ldly","a\u026A"],["","all","#","\u0254 l"],["","all","s#","\u0254 l"],["","all","ing","\u0254 l"],["","all","ed#","\u0254 l"],["","alk","","\u0254 k"],["w","ar","","\u0254 \u0279"],["w","a","CC","\u0251"],["w","a","C#","\u0251"],["","ea","d#","\u025B"],["","ea","dy","\u025B"],["","ea","lth","\u025B"],["","ea","th#","\u025B"],["","ea","ther","\u025B"],["","ea","vy","\u025B"],["","ea","ven","\u025B"],["","ea","sant","\u025B"],["","ea","sure","\u025B"],["","ea","dow","\u025B"],["","oo","k","\u028A"],["g","oo","d","\u028A"],["w","oo","d","\u028A"],["h","oo","d","\u028A"],["t","oo","d","\u028A"],["f","oo","t","\u028A"],["d","oo","r","\u0254"],["fl","oo","r","\u0254"],["l","o","ve","\u028C"],["l","o","vi","\u028C"],["b","o","ve#","\u028C"],["c","o","ver","\u028C"],["s","o","me","\u028C"],["c","o","me","\u028C"],["w","o","n","\u028C"],["","o","ney","\u028C"],["","o","nth","\u028C"],["","o","ther","\u028C"],["","o","thing","\u028C"],["","th","er","\xF0"],["","th","e#","\xF0"],["","ear","l","\u025D"],["","ear","n","\u025D"],["","ear","ch","\u025D"],["","ear","th","\u025D"],["h","ear","d#","\u025D"],["h","ear","t","\u0251 \u0279"],["C","are","#","\u025B \u0279"],["","a","rr","\xE6"],["C","a","rV","\u025B"],["","i","re#","a\u026A"],["V","sure","","\u0292 \u025A"],["#","s","ure","\u0283"],["","ure","#","\u028A \u0279"],["","i","ty#","\u026A"],["t","i","ve#","\u026A"],["C","i","ly#","\u0259"],["","i","ver","\u026A"],["","i","ven","\u026A"],["#","a","Ce#","e\u026A"],["#","a","wa","\u0259"],["#","a","CV","\u0259"],["#","u","CV","j u"],["m","u","CV","j u"],["f","u","CV","j u"],["p","u","CV","j u"],["b","u","CV","j u"],["c","u","CV","j u"],["h","u","CV","j u"],["","ough","t","\u0254"],["","ou","l","o\u028A"],["","ou","ng","\u028C"],["","ou","ble","\u028C"],["","ou","ntry","\u028C"],["f","our","","\u0254 \u0279"],["p","our","","\u0254 \u0279"],["c","our","","\u0254 \u0279"],["s","our","","\u0254 \u0279"],["#","g","i","g"],["w","or","n","\u0254 \u0279"],["w","or","C","\u025D"],["","er","r","\u025B"],["VC","er","y#","\u025A"],["VC","or","y#","\u025A"],["VC","or","ies#","\u025A"],["","a","nge#","e\u026A"],["","a","nges#","e\u026A"],["","a","nged#","e\u026A"],["","a","ngel","e\u026A"],["","n","ge#","n"],["","n","ges#","n"],["","n","ged#","n"],["","n","gel","n"],["m","n","#",""],["#gu","y","#","a\u026A"],["#","gu","V","g"],["","eau","t","j u"],["#","al","so","\u0254 l"],["#","al","w","\u0254 l"],["#","al","r","\u0254 l"],["#","al","mo","\u0254 l"],["#","al","th","\u0254 l"],["Co","s","e#","z"],["Ci","s","e#","z"],["au","s","e#","z"],["ai","s","e#","z"],["oi","s","e#","z"],["ea","s","on","z"],["#h","ere","#","\u026A \u0279"],["h","ere","#","\u025B \u0279"],["","ere","#","\u026A \u0279"],["m","o","st","o\u028A"],["p","o","st","o\u028A"],["h","o","st","o\u028A"],["#","o","nly","o\u028A"],["VC","e","ly#",""],["VC","e","ful",""],["VC","e","ness",""],["VC","e","ment",""],["VC","e","less",""],["w","a","ter","\u0254"],["f","a","ther","\u0251"],["","a","Cow","\xE6"],["","i","Cow","\u026A"],["","i","rV","\u026A"],["#f","or","ev","\u025A"],["#f","or","g","\u025A"],["#","o","h#","o\u028A"],["V","h","#",""],["","aa","","\u0251"],["#y","e","#","i"],["#h","ey","#","e\u026A"],["","eah","#","\xE6"],["","tion","","\u0283 \u0259 n"],["","sion","","\u0292 \u0259 n"],["","ture","","t\u0283 \u025A"],["","ough","#","o\u028A"],["","augh","","\u0254"],["","igh","","a\u026A"],["","eigh","","e\u026A"],["","tch","","t\u0283"],["","dge","","d\u0292"],["","sch","","s k"],["","ch","","t\u0283"],["","sh","","\u0283"],["","th","","\u03B8"],["","ph","","f"],["","wh","","w"],["","ck","","k"],["","ng","#","\u014B"],["","ng","","\u014B g"],["","qu","","k w"],["#","kn","","n"],["#","wr","","\u0279"],["","gh","",""],["","ee","","i"],["","ea","","i"],["","oo","","u"],["","ou","","a\u028A"],["","ow","#","o\u028A"],["","ow","","a\u028A"],["","oi","","\u0254\u026A"],["","oy","","\u0254\u026A"],["","ai","","e\u026A"],["","ay","","e\u026A"],["","au","","\u0254"],["","aw","","\u0254"],["","ie","#","a\u026A"],["","ie","","i"],["","ei","","e\u026A"],["","ey","#","i"],["","oa","","o\u028A"],["","ue","#","u"],["","er","#","\u025A"],["","er","C","\u025D"],["","ir","","\u025D"],["","ur","","\u025D"],["","or","","\u0254 \u0279"],["","ar","","\u0251 \u0279"],["C","le","#","\u0259 \u026B"],["","ed","#","d"],["","es","#","z"],["C","s","#","s"],["V","s","#","z"],["#C","y","#","a\u026A"],["#CC","y","#","a\u026A"],["#CCC","y","#","a\u026A"],["","y","#","i"],["#","y","","j"],["C","y","","a\u026A"],["#C","e","#","i"],["#CC","e","#","i"],["","e","#",""],["#C","a","#","\u0251"],["#CC","a","#","\u0251"],["","a","CV","e\u026A"],["","a","","\xE6"],["","e","","\u025B"],["","i","CV","a\u026A"],["","i","","\u026A"],["","o","CV","o\u028A"],["","o","","\u0251"],["","u","CV","u"],["","u","","\u028C"],["","y","","\u026A"],["","c","e","s"],["","c","i","s"],["","c","y","s"],["","c","","k"],["","g","e","d\u0292"],["","g","i","d\u0292"],["","g","","g"],["","x","","k s"],["","j","","d\u0292"],["","q","","k"],["","b","","b"],["","d","","d"],["","f","","f"],["","h","","h"],["","k","","k"],["","l","","l"],["","m","","m"],["","n","","n"],["","p","","p"],["","r","","\u0279"],["","s","","s"],["","t","","t"],["","v","","v"],["","w","","w"],["","z","","z"]],_e=Y.map(e=>e[3]?e[3].split(" "):[]);function re(e){let n=[],r=0;for(;r<e.length;){let s=!1;for(let i=0;i<Y.length;i++){let[a,l,f]=Y[i];if(e.startsWith(l,r)&&oe(e,r-1,a,-1)&&oe(e,r+l.length,f,1)){for(let u of _e[i])!p(u)&&u===n[n.length-1]||n.push(u);r+=l.length,s=!0;break}}s||r++}let t=[],o=n.findIndex(s=>p(s)&&s!=="\u0259"&&s!=="\u025A");o<0&&(o=n.findIndex(s=>p(s)));for(let s=0;s<n.length;s++){let i=n[s];p(i)?t.push({ipa:i,stress:s===o?1:0}):t.push({ipa:i})}return t}function te(e){return e==="a"||e==="e"||e==="i"||e==="o"||e==="u"||e==="y"}function oe(e,n,r,t){let o=n;for(let s=0;s<r.length;s++){let i=t===1?r[s]:r[r.length-1-s],a=o>=0&&o<e.length?e[o]:void 0;if(i==="#"){if(a!==void 0)return!1}else if(i==="V"){if(!te(a))return!1}else if(i==="C"){if(a===void 0||te(a))return!1}else if(a!==i)return!1;o+=t}return!0}var je=new Set(["p","b","t","d","k","g","f","v","\u03B8","\xF0","s","z","\u0283","\u0292","h","m","n","l","\u0279","w","j","t\u0283","d\u0292","pl","bl","kl","gl","fl","sl","p\u0279","b\u0279","t\u0279","d\u0279","k\u0279","g\u0279","f\u0279","\u03B8\u0279","\u0283\u0279","sp","st","sk","sm","sn","sw","sf","tw","kw","dw","gw","\u03B8w","pj","bj","kj","gj","mj","nj","fj","vj","hj","lj","spl","sp\u0279","st\u0279","sk\u0279","skw","skj","spj"]),Be=new Map([["r","\u0279"],["\u026B","l"]]),Ze=new Set(Array.from("m\u0271n\u0273\u0272\u014B\u0274l\u026B\u026D\u028E\u0279\u027Br\u0280\u0299\u027E\u027Djw\u028B\u0265\u0270")),Ke=new Set(Array.from("\u0278\u03B2fv\u03B8\xF0sz\u0283\u0292\u0282\u0290\xE7\u029Dx\u0263\u03C7\u0281\u0127\u0295h\u0266\u026C\u026E\u0255\u0291"));function se(e){return Ze.has(e)?2:Ke.has(e)?1:0}function I(e){if(e.length===0)return;let n=0;for(let r=1;r<e.length;r++)se(e[r].ipa)>se(e[n].ipa)&&(n=r);return{onset:e.slice(0,n),nucleus:e[n],coda:e.slice(n+1)}}var Qe=3;function R(e){let n=[];for(let o=0;o<e.length;o++)p(e[o].ipa)&&n.push(o);let r=[],t=0;for(let o=0;o<n.length;o++){let s=n[o],i=e.length;if(o+1<n.length){let a=n[o+1],l=a-(s+1),f=0;for(let u=Math.min(Qe,l);u>=1;u--)if($e(e,a-u,a)){f=u;break}i=a-f}r.push({onset:e.slice(t,s),nucleus:e[s],coda:e.slice(s+1,i)}),t=i}return r}function $e(e,n,r){if(r-n===1){let o=e[n].ipa;return o!=="\u014B"&&o!==H}let t="";for(let o=n;o<r;o++)t+=Be.get(e[o].ipa)??e[o].ipa;return je.has(t)}var qe=new Set(["th","sh","ch","ph","wh","ck","gh"]);function ie(e,n){let r=Math.floor(n);if(!(r>1)||!Number.isFinite(r))return[e];let t=Array.from(e),o=t.length,s=[];for(let d=0;d<o;){if(!x(t[d])){d++;continue}let g=d;do d++;while(d<o&&x(t[d])&&!Xe(t[d]));s.push([g,d])}let i=o>=2&&(t[o-1]==="e"||t[o-1]==="E"),a=i&&!x(t[o-2]),l=i&&o>=3&&(t[o-2]==="l"||t[o-2]==="L")&&!x(t[o-3])&&t[o-3]!=="l"&&t[o-3]!=="L";if(s.length>1&&a&&!l&&s[s.length-1][0]+1===o&&s.pop(),s.length<r){let d=[e];for(let g=1;g<r;g++)d.push("~");return d}for(;s.length>r;){let d=s.pop();s[s.length-1][1]=d[1]}let f=[0];for(let d=0;d<s.length-1;d++){let g=s[d][1],c=s[d+1][0],h=c-g,S=h>=2&&qe.has((t[c-2]+t[c-1]).toLowerCase());f.push(S?c-2:g+(h<=1?0:Math.floor(h/2)))}f.push(o);let u=[];for(let d=0;d<f.length-1;d++)u.push(t.slice(f[d],f[d+1]).join(""));return u}function x(e){switch(e.length===1&&e<"\x80"?e:e.normalize("NFD")[0]){case"a":case"e":case"i":case"o":case"u":case"y":case"A":case"E":case"I":case"O":case"U":case"Y":return!0;default:return!1}}function Xe(e){return e.length===1&&e<"\xC0"?!1:e.normalize("NFD").includes("\u0308")}var Je=["KIT","DRESS","TRAP","LOT","STRUT","FOOT","BATH","CLOTH","NURSE","FLEECE","FACE","PALM","THOUGHT","GOAT","GOOSE","PRICE","CHOICE","MOUTH","NEAR","SQUARE","START","NORTH","FORCE","CURE","happY","lettER","commA"],en=new Set(["dance","dancer","dancing","chance","glance","lance","prance","trance","france","advance","enhance","plant","grant","slant","chant","aunt","can't","shan't","branch","answer","example","sample","demand","command","commander","remand","rather","father","half","calf","laugh","laughter","banana","drama"]),nn=new Set(["after","nasty","master","disaster","plaster","pastor","rafter","castle","fasten"]),tn=/au|aw|al[lkt]|ough|augh|oa|wa/;function G(e,n){let r=e.toLowerCase(),t=[];for(let o=0;o<n.length;o++)p(n[o].ipa)&&t.push(o);for(let o=0;o<t.length;o++){let s=t[o],i=n[s],a=n[s+1]?.ipa,l=n[s+2]?.ipa,u=a==="\u0279"&&(l===void 0||!p(l)),d=i.stress!==void 0&&i.stress>0,g=o===t.length-1;i.set=on(i.ipa,{w:r,next:a,after:l,rCoda:u,stressed:d,last:g})}}function on(e,n){switch(e){case"i":return n.rCoda?"NEAR":!n.stressed&&n.last?"happY":"FLEECE";case"\u026A":return n.rCoda?"NEAR":"KIT";case"\u025B":return n.rCoda?"SQUARE":"DRESS";case"e\u026A":return n.rCoda?"SQUARE":"FACE";case"\xE6":return en.has(n.w)||nn.has(n.w)||(n.next==="f"||n.next==="\u03B8"||n.next==="s")&&(n.after===void 0||!p(n.after))?"BATH":"TRAP";case"\u0251":return n.rCoda?"START":/(w|qu)a/.test(n.w)||n.w.includes("o")&&!/a(?!u|w)/.test(n.w)?"LOT":n.w.includes("a")&&!n.w.includes("o")?"PALM":"LOT";case"\u0254":return n.rCoda?"NORTH":tn.test(n.w)?"THOUGHT":"CLOTH";case"o\u028A":return n.rCoda?"FORCE":"GOAT";case"\u028C":return"STRUT";case"\u028A":return n.rCoda?"CURE":"FOOT";case"u":return n.rCoda?"CURE":"GOOSE";case"\u025D":case"\u025A":return n.stressed?"NURSE":"lettER";case"\u0259":return n.last&&n.next===void 0?"commA":void 0;case"a\u026A":return"PRICE";case"a\u028A":return"MOUTH";case"\u0254\u026A":return"CHOICE";default:return}}var rn=new Map([["wind","W IH1 N D"],["read","R IY1 D"],["live","L IH1 V"],["lead","L IY1 D"],["close","K L OW1 Z"],["wound","W UW1 N D"]]),ae=new Map([["a","AH0"],["an","AE1 N"],["the","DH AH0"],["of","AH1 V"],["to","T UW1"],["in","IH0 N"],["on","AA1 N"],["at","AE1 T"],["by","B AY1"],["for","F AO1 R"],["from","F R AH1 M"],["with","W IH1 DH"],["as","AE1 Z"],["and","AH0 N D"],["or","AO1 R"],["but","B AH1 T"],["nor","N AO1 R"],["so","S OW1"],["if","IH1 F"],["is","IH1 Z"],["am","AE1 M"],["are","AA1 R"],["was","W AA1 Z"],["were","W ER1"],["be","B IY1"],["been","B IH1 N"],["do","D UW1"],["does","D AH1 Z"],["did","D IH1 D"],["has","HH AE1 Z"],["have","HH AE1 V"],["had","HH AE1 D"],["will","W IH1 L"],["would","W UH1 D"],["can","K AE1 N"],["could","K UH1 D"],["should","SH UH1 D"],["shall","SH AE1 L"],["may","M EY1"],["might","M AY1 T"],["must","M AH1 S T"],["it","IH1 T"],["its","IH1 T S"],["i","AY1"],["you","Y UW1"],["he","HH IY1"],["she","SH IY1"],["we","W IY1"],["they","DH EY1"],["me","M IY1"],["him","HH IH1 M"],["her","HH ER1"],["us","AH1 S"],["them","DH EH1 M"],["my","M AY1"],["your","Y AO1 R"],["his","HH IH1 Z"],["our","AW1 ER0"],["their","DH EH1 R"],["this","DH IH1 S"],["that","DH AE1 T"],["than","DH AE1 N"],["then","DH EH1 N"],["there","DH EH1 R"],["not","N AA1 T"],["no","N OW1"]]),sn=new Map([["one","W AH1 N"],["once","W AH1 N S"],["what","W AH1 T"],["who","HH UW1"],["two","T UW1"],["into","IH1 N T UW0"],["through","TH R UW1"],["where","W EH1 R"],["these","DH IY1 Z"],["those","DH OW1 Z"],["thee","DH IY1"],["thou","DH AW1"],["thy","DH AY1"],["thine","DH AY1 N"],["though","DH OW1"],["people","P IY1 P AH0 L"],["eye","AY1"],["eyes","AY1 Z"],["said","S EH1 D"],["any","EH1 N IY0"],["many","M EH1 N IY0"],["anywhere","EH1 N IY0 W EH2 R"],["anything","EH1 N IY0 TH IH2 NG"],["anyone","EH1 N IY0 W AH2 N"],["everything","EH1 V R IY0 TH IH2 NG"],["everywhere","EH1 V R IY0 W EH2 R"],["everyone","EH1 V R IY0 W AH2 N"],["great","G R EY1 T"],["friend","F R EH1 N D"],["hour","AW1 R"],["whole","HH OW1 L"],["woman","W UH1 M AH0 N"],["women","W IH1 M AH0 N"],["touch","T AH1 CH"],["ocean","OW1 SH AH0 N"],["together","T AH0 G EH1 DH ER0"],["get","G EH1 T"],["forget","F ER0 G EH1 T"],["give","G IH1 V"],["again","AH0 G EH1 N"],["against","AH0 G EH1 N S T"],["because","B IH0 K AO1 Z"],["even","IY1 V IH0 N"],["busy","B IH1 Z IY0"],["sure","SH UH1 R"],["sugar","SH UH1 G ER0"],["enough","IH0 N AH1 F"],["young","Y AH1 NG"],["done","D AH1 N"],["gone","G AO1 N"],["none","N AH1 N"],["bear","B EH1 R"],["wear","W EH1 R"],["break","B R EY1 K"],["guy","G AY1"],["buy","B AY1"],["lose","L UW1 Z"],["move","M UW1 V"],["goes","G OW1 Z"],["door","D AO1 R"],["fire","F AY1 R"],["desire","D IH0 Z AY1 R"],["i'm","AY1 M"],["i'll","AY1 L"],["i've","AY1 V"],["i'd","AY1 D"],["you're","Y UH1 R"],["you'll","Y UW1 L"],["you've","Y UW1 V"],["we're","W IY1 R"],["we'll","W IY1 L"],["they're","DH EH1 R"],["don't","D OW1 N T"],["won't","W OW1 N T"],["can't","K AE1 N T"],["isn't","IH1 Z AH0 N T"],["it's","IH1 T S"],["that's","DH AE1 T S"],["there's","DH EH1 R Z"],["let's","L EH1 T S"],["ain't","EY1 N T"],["didn't","D IH1 D AH0 N T"],["doesn't","D AH1 Z AH0 N T"],["wasn't","W AA1 Z AH0 N T"],["couldn't","K UH1 D AH0 N T"],["wouldn't","W UH1 D AH0 N T"],["shouldn't","SH UH1 D AH0 N T"],["he's","HH IY1 Z"],["she's","SH IY1 Z"],["what's","W AH1 T S"],["o'er","OW1 R"],["ne'er","N EH1 R"],["e'er","EH1 R"]]),an=new Set(["\u028C","\xE6","\u0251","\u025B","\u0254","u","\u028A"]),ln=new Set(["you","do","to","who","not","no"]),cn=/[\u0300-\u036F]/g,un=/^'+|'+$/g;function ce(e,n={}){let r=e.toLowerCase().replace(un,""),t=r.normalize("NFD").replace(cn,""),o=rn.get(t)??dn(n.dictionary,r,t)??ae.get(t)??sn.get(t);if(o){let s=z(o);return n.reduce&&ae.has(t)&&fn(s,t),s}if(r.includes("-")){let s=[];for(let i of r.split("-"))s.push(...ce(i,n));return s}return re(t)}function dn(e,n,r){if(e)return e.get(n)||(r!==n?e.get(r):void 0)}function fn(e,n){let r=0;for(let t of e)p(t.ipa)&&r++;for(let t of e)p(t.ipa)&&(t.stress=0,r===1&&an.has(t.ipa)&&!ln.has(n)&&(t.ipa="\u0259"))}function V(e={}){return{starts:le,continues:n=>n==="-"||le(n)||n>="\u0300"&&n<="\u036F",word:n=>pn(n,e)}}function pn(e,n){let r=e.split("-").filter(o=>o!==""),t=[];for(let o of r){let s=ce(o,n);G(o,s);let i=R(s);if(i.length===0){let l=I(s);l&&i.push(l)}let a=r.length>1?[o]:ie(o,i.length);for(let l=0;l<i.length;l++){let{onset:f,nucleus:u,coda:d}=i[l];t.push({text:a[l]??"~",onset:f,nucleus:u,coda:d,wordEnd:!1,phraseEnd:!1})}}return t}function le(e){if(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="'")return!0;if(e<"\xC0")return!1;let n=e.normalize("NFD");if(n.length<2)return!1;let r=n[0];if(!(r>="a"&&r<="z"||r>="A"&&r<="Z"))return!1;for(let t=1;t<n.length;t++)if(n[t]<"\u0300"||n[t]>"\u036F")return!1;return!0}var P="/",_={starts:e=>e===P,continues:e=>e!==P&&e!==`
3
+ `&&e!=="\r",word:e=>hn(En(e))};function hn(e){let{segments:n,breaks:r}=k(e),t=[],o=[[]];for(let s=0;s<n.length;s++){let i=n[s];if(i.ipa===H){t.length>0&&(t[t.length-1].phraseEnd=!0);continue}o[o.length-1].push(i),r[s]===L||s===n.length-1?(gn(o,t),o=[[]]):r[s]===M&&o.push([])}return t}function gn(e,n){let r=e.length>1?mn(e):R(e[0]);if(r.length===0){let t=I(e.flat());if(!t)return;r.push(t)}for(let t=0;t<r.length;t++){let{onset:o,nucleus:s,coda:i}=r[t];n.push({text:Sn(r[t]),onset:o,nucleus:s,coda:i,wordEnd:t===r.length-1,phraseEnd:!1})}}function mn(e){let n=[],r=[];for(let t of e){let o=R(t);if(o.length===0){n.length>0?n[n.length-1].coda.push(...t):r.push(...t);continue}r.length>0&&(o[0].onset.unshift(...r),r=[]),n.push(...o)}return n}function Sn(e){let n=e.nucleus.stress===1?"\u02C8":e.nucleus.stress===2?"\u02CC":"";for(let r of e.onset)n+=r.ipa;n+=e.nucleus.ipa;for(let r of e.coda)n+=r.ipa;return n}function En(e){let n=e.startsWith(P)?1:0,r=e.length>n&&e.endsWith(P)?e.length-1:e.length;return e.slice(n,r)}function ue(e,n,r={}){let t=r.t??"flap",o=r.l??"dark-coda",s=[],i=()=>{s.length>0&&An(s,t,o),s=[]};for(let a of e){if(!n(a)||a.melisma){i();continue}let l=[...a.onset,a.nucleus,...a.coda];l.forEach((f,u)=>s.push({seg:f,wordEnd:a.wordEnd&&u===l.length-1})),a.phraseEnd&&i()}i()}function An(e,n,r){if(n==="flap")for(let t=1;t+1<e.length;t++){let o=e[t-1],s=e[t+1],i=e[t].seg;(i.ipa==="t"||i.ipa==="d")&&(p(o.seg.ipa)||o.seg.ipa==="\u0279")&&p(s.seg.ipa)&&!(s.seg.stress!==void 0&&s.seg.stress!==0)&&!o.wordEnd&&(i.ipa="\u027E")}else if(n==="glottal"||n==="glottal-coda")for(let t=1;t<e.length;t++){let o=e[t].seg,s=e[t-1].seg.ipa;if(o.ipa!=="t"||!(p(s)||s==="n"||s==="l"))continue;let i=e[t+1]?.seg,a=i===void 0?n==="glottal":!p(i.ipa)&&!yn.has(i.ipa),l=n==="glottal"&&i!==void 0&&p(i.ipa)&&!(i.stress!==void 0&&i.stress!==0)&&!e[t-1].wordEnd&&p(e[t-1].seg.ipa);(a||l)&&(o.ipa="\u0294")}if(r!=="clear")for(let t=0;t<e.length;t++){if(e[t].seg.ipa!=="l")continue;let s=!(t+1<e.length&&p(e[t+1].seg.ipa))||e[t].wordEnd;r==="dark"?e[t].seg.ipa="\u026B":s&&(e[t].seg.ipa=r==="vocalized"?"w":"\u026B")}}var yn=new Set(["\u0279","w","j"]);var B={tune:"fall",range:4,declination:2,rate:1},O={id:"general-american",name:"General American",rhotic:!0,sets:{},t:"flap",l:"dark-coda",th:"fricative",r:"approximant"},de={id:"southern-british",name:"Southern British",rhotic:!1,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",LOT:"\u0252",STRUT:"\u0250",FOOT:"\u028A",BATH:"\u0251\u02D0",CLOTH:"\u0252",NURSE:"\u025C\u02D0",FLEECE:"i\u02D0",FACE:"e\u026A",PALM:"\u0251\u02D0",THOUGHT:"o\u02D0",GOAT:"\u0259\u028A",GOOSE:"\u0289\u02D0",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"\u026A\u0259",SQUARE:"\u025B\u02D0",START:"\u0251\u02D0",NORTH:"o\u02D0",FORCE:"o\u02D0",CURE:"o\u02D0",happY:"i",lettER:"\u0259",commA:"\u0259"},hold:.55,t:"glottal-coda",l:"dark-coda",th:"fricative",r:"approximant",prosody:{tune:"fall",range:6,declination:3,rate:1}},fe={id:"london",name:"London",rhotic:!1,sets:{KIT:"\u026A",DRESS:"e",TRAP:"\xE6",LOT:"\u0252",STRUT:"\u0250",FOOT:"\u028A",BATH:"\u0251\u02D0",CLOTH:"\u0252",NURSE:"\u025C\u02D0",FLEECE:"\u0259i",FACE:"\xE6\u026A",PALM:"\u0251\u02D0",THOUGHT:"o\u02D0",GOAT:"\u028C\u028A",GOOSE:"\u0289\u02D0",PRICE:"\u0251\u026A",CHOICE:"o\u026A",MOUTH:"\xE6\u028A",NEAR:"\u026A\u0259",SQUARE:"e\u02D0",START:"\u0251\u02D0",NORTH:"o\u02D0",FORCE:"o\u02D0",CURE:"o\u02D0",happY:"i",lettER:"\u0259",commA:"\u0259"},hold:.5,t:"glottal",l:"vocalized",th:"front",r:"approximant",hDrop:!0,prosody:{tune:"fall",range:5,declination:2,rate:1.05}},pe={id:"australian",name:"Australian",rhotic:!1,sets:{KIT:"\u026A",DRESS:"e",TRAP:"\xE6",LOT:"\u0254",STRUT:"\u0250",FOOT:"\u028A",BATH:"\u0250\u02D0",CLOTH:"\u0254",NURSE:"\u0275\u02D0",FLEECE:"\u026Ai",FACE:"\xE6\u026A",PALM:"\u0250\u02D0",THOUGHT:"o\u02D0",GOAT:"\u0250\u0289",GOOSE:"\u0289\u02D0",PRICE:"\u0252e",CHOICE:"o\u026A",MOUTH:"\xE6\u0254",NEAR:"\u026A\u0259",SQUARE:"e\u02D0",START:"\u0250\u02D0",NORTH:"o\u02D0",FORCE:"o\u02D0",CURE:"o\u02D0",happY:"i",lettER:"\u0259",commA:"\u0259"},hold:.45,t:"flap",l:"dark-coda",th:"fricative",r:"approximant",prosody:{tune:"rise",range:4,declination:1.5,rate:1}},he={id:"new-zealand",name:"New Zealand",rhotic:!1,sets:{KIT:"\u0258",DRESS:"e",TRAP:"\u025B",LOT:"\u0252",STRUT:"\u0250",FOOT:"\u028A",BATH:"\u0250\u02D0",CLOTH:"\u0252",NURSE:"\xF8\u02D0",FLEECE:"\u026Ai",FACE:"\xE6\u026A",PALM:"\u0250\u02D0",THOUGHT:"o\u02D0",GOAT:"\u0250\u0289",GOOSE:"\u0289\u02D0",PRICE:"\u0252e",CHOICE:"oe",MOUTH:"\xE6\u028A",NEAR:"i\u0259",SQUARE:"i\u0259",START:"\u0250\u02D0",NORTH:"o\u02D0",FORCE:"o\u02D0",CURE:"\u0289\u0259",happY:"i",lettER:"\u0258",commA:"\u0258"},hold:.45,t:"flap",l:"dark",th:"fricative",r:"approximant",prosody:{tune:"rise",range:3.5,declination:1.5,rate:1.05}},ge={id:"irish",name:"Irish",rhotic:!0,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",LOT:"\u0251",STRUT:"\u0250",FOOT:"\u028A",BATH:"a\u02D0",CLOTH:"\u0252",FLEECE:"i\u02D0",FACE:"e\u02D0",PALM:"a\u02D0",THOUGHT:"\u0252\u02D0",GOAT:"o\u02D0",GOOSE:"u\u02D0",PRICE:"\u0251\u026A",CHOICE:"\u0252\u026A",MOUTH:"\u0250\u028A",NEAR:"i",SQUARE:"e",START:"a",NORTH:"\u0252",FORCE:"o",CURE:"u",happY:"i"},hold:.6,t:"released",l:"clear",th:"stop",r:"approximant",prosody:{tune:"fall",range:5,declination:2,rate:1.05}},me={id:"scottish",name:"Scottish",rhotic:!0,sets:{KIT:"\u0258",DRESS:"\u025B",TRAP:"a",LOT:"\u0254",STRUT:"\u028C",FOOT:"\u0289",BATH:"a",CLOTH:"\u0254",NURSE:"\u028C\u027E",FLEECE:"i",FACE:"e",PALM:"a",THOUGHT:"\u0254",GOAT:"o",GOOSE:"\u0289",PRICE:"\u028C\u026A",CHOICE:"\u0254\u026A",MOUTH:"\u028C\u0289",NEAR:"i\u027E",SQUARE:"e\u027E",START:"a\u027E",NORTH:"\u0254\u027E",FORCE:"o\u027E",CURE:"\u0289\u027E",happY:"e",lettER:"\u0259\u027E",commA:"\u028C"},hold:.5,t:"glottal-coda",l:"dark",th:"fricative",r:"tap",prosody:{tune:"fall",range:4,declination:2,rate:1}},Se={id:"southern-us",name:"Southern US",rhotic:!0,sets:{DRESS:"\u025B",TRAP:"\xE6",BATH:"\xE6",FACE:"\u025B\u026A",THOUGHT:"\u0252\u0254",CLOTH:"\u0252\u0254",GOAT:"\u025C\u0289",GOOSE:"\u0289",PRICE:"a\u02D0",MOUTH:"\xE6\u028A",CHOICE:"o\u026A"},hold:.5,t:"flap",l:"dark",th:"fricative",r:"approximant",prosody:{tune:"fall",range:5,declination:2,rate:.85}},j=Object.freeze(Object.fromEntries([O,de,fe,pe,he,ge,me,Se].map(e=>[e.id,e])));function Z(e){if(e===void 0)return O;if(typeof e!="string")return e;let n=j[e];if(!n)throw new Error(`unknown accent "${e}"; built in: ${Object.keys(j).join(", ")}`);return n}var Tn=/[ːˑ:]/g;function Hn(e){let n=Array.from(e.replace(Tn,"")),r,t=n[n.length-1];(t==="\u0279"||t==="\u027E"||t==="r")&&(r=t==="r"?"\u0279":t,n.pop());let o=n.filter(s=>p(s));if(o.length===0||o.length>2||o.length!==n.length)throw new Error(`accent realization "${e}" is not one or two vowels and an optional r`);return{vowels:o,r}}var Ee=new Set(["\u0279","\u027E","r"]);function K(e,n,r){for(let t=0;t<e.length;t++){let o=e[t];if(!n(o)||o.melisma)continue;let s=e[t+1],i=!o.phraseEnd&&s!==void 0&&n(s)&&!s.melisma&&s.onset.length===0;Rn(o,r,i),bn(o,r,t===0||e[t-1].wordEnd)}}function Rn(e,n,r){let t=e.nucleus,o=t.set,s=o===void 0?void 0:n.sets[o],i=t.ipa==="\u025D"||t.ipa==="\u025A";if(s!==void 0){let a=Hn(s);if(t.ipa=a.vowels.join(""),a.r!==void 0){let l=n.r==="tap"?"\u027E":a.r;e.coda.length>0&&Ee.has(e.coda[0].ipa)?e.coda[0].ipa=l:e.coda.unshift({ipa:l})}else i&&!n.rhotic&&r&&e.coda.unshift({ipa:"\u0279"})}if(n.rhotic||On(e,r),Array.from(t.ipa).length===2&&o!==void 0){let a=n.holds?.[o]??n.hold;a!==void 0&&(t.hold=Math.max(0,Math.min(1,a)))}}function On(e,n){for(let r=e.coda.length-1;r>=0;r--)!Ee.has(e.coda[r].ipa)||r===e.coda.length-1&&n||e.coda.splice(r,1)}function bn(e,n,r){let t=[e.onset,e.coda];for(let o of t)for(let s=0;s<o.length;s++){let i=o[s],a=r&&o===e.onset&&s===0;n.th==="stop"?i.ipa==="\u03B8"?i.ipa="t":i.ipa==="\xF0"&&(i.ipa="d"):n.th==="front"&&(i.ipa==="\u03B8"?i.ipa="f":i.ipa==="\xF0"&&(i.ipa=a?"d":"v")),n.r==="tap"&&i.ipa==="\u0279"&&(i.ipa="\u027E")}n.hDrop&&r&&e.onset.length>0&&e.onset[0].ipa==="h"&&e.onset.shift()}var U=/\s/,wn=/[\p{L}\p{M}\p{N}]/u;function Cn(e){return e==="."||e===","||e===";"||e===":"||e==="!"||e==="?"||e===`
4
+ `}function Ae(e,n){let r=Array.from(e.normalize("NFC").replace(/’/g,"'")),t=[],o=0;for(;o<r.length;){let s=r[o],i=n.find(a=>a.starts(s));if(i){let a=i.continues(s)?Ln(r,o,i):xn(r,o,i);if(a>o){Nn(t,i.word(r.slice(o,a).join(""))),o=a;continue}}if(Cn(s))t.length>0&&(t[t.length-1].phraseEnd=!0);else if(In(r,o)){let a=t[t.length-1];a&&t.push({text:"~",onset:[],nucleus:{...a.nucleus},coda:[],melisma:!0,wordEnd:a.wordEnd,phraseEnd:!1})}o++}return t}function Q(e,n={}){let r=V({dictionary:n.dictionary,reduce:n.reduce}),t=new WeakSet,o={starts:r.starts,continues:r.continues,word:l=>{let f=r.word(l);for(let u of f)t.add(u);return f}},s=Ae(e,[o,_]),i=Z(n.accent),a=l=>t.has(l);return i!==O&&K(s,a,i),n.allophones!==!1&&ue(s,a,{t:i.t,l:i.l}),s}function Nn(e,n){if(n.length!==0){n[n.length-1].wordEnd=!0;for(let r of n)e.push(r)}}function Ln(e,n,r){let t=n+1;for(;t<e.length&&r.continues(e[t]);)t++;return t}function xn(e,n,r){let t=e[n];if(n>0&&wn.test(e[n-1])||n+1>=e.length||e[n+1]===t||U.test(e[n+1]))return n;let o=n+1;for(;o<e.length&&e[o]!==t&&r.continues(e[o]);)o++;return o>=e.length||e[o]!==t||U.test(e[o-1])?n:o+1}function In(e,n){let r=e[n];if(r!=="-"&&r!=="~")return!1;let t=n===0||U.test(e[n-1]),o=n+1===e.length||U.test(e[n+1]);return t&&o}var Pn=/^(\S+)\s+(.+)$/,Un=/\(\d+\)$/;function Dn(e){let n=new Map;for(let r of e.split(`
5
+ `)){let t=r.trim();if(t===""||t.startsWith(";;;"))continue;let o=Pn.exec(t);if(!o)continue;let s=o[1];if(Un.test(s))continue;let i=o[2].indexOf("#"),a=(i<0?o[2]:o[2].slice(0,i)).trim().split(/\s+/).join(" ");if(a==="")continue;let l=s.toLowerCase();n.has(l)||n.set(l,a)}return n}import{clamp as W}from"bellowsjs";var Wn=Object.freeze({p:.085,b:.07,t:.075,d:.06,\u0288:.075,\u0256:.065,c:.08,\u025F:.07,k:.08,g:.07,q:.085,\u0262:.075,\u0294:.06,m:.075,\u0271:.075,n:.07,\u0273:.07,\u0272:.075,\u014B:.08,\u0274:.08,\u0278:.11,\u03B2:.09,f:.11,v:.08,\u03B8:.11,\u00F0:.07,s:.12,z:.09,\u0283:.12,\u0292:.09,\u0282:.12,\u0290:.09,\u00E7:.12,\u029D:.09,x:.12,\u0263:.09,\u03C7:.12,\u0281:.09,\u0127:.12,\u0295:.09,h:.09,\u0266:.08,\u026C:.12,\u026E:.09,ts:.14,dz:.12,t\u0283:.15,d\u0292:.13,\u0255:.12,\u0291:.09,t\u0255:.14,d\u0291:.12,t\u0282:.14,d\u0290:.12,pf:.14,w:.06,\u028B:.06,\u0279:.065,\u027B:.065,j:.055,\u0265:.055,\u0270:.06,l:.065,\u026B:.075,\u026D:.065,\u028E:.07,\u027E:.025,\u027D:.03,r:.11,\u0280:.11,\u0299:.12}),Fn=.07,He=.8;var ye=new Map(Object.entries(Wn)),vn=new Map([["\u0261","g"],["\u02A3","dz"],["\u02A4","d\u0292"],["\u02A5","d\u0291"],["\u02A6","ts"],["\u02A7","t\u0283"],["\u02A8","t\u0255"]]),Mn=/[ʰ-˿̀-ͯ]/g;function Te(e){let n=ye.get(e);if(n!==void 0)return n;let r=vn.get(e);return r===void 0?void 0:ye.get(r)}function T(e){return Te(e)??Te(e.replace(Mn,""))??Fn}var kn=.05,zn=.012,Yn=.02,Gn=.12,Vn=.3,_n=.8,jn=.001,Bn=.8,Zn=4,Kn=86400,Qn=10,$n=new Map([["a\u026A",["a","\u026A"]],["a\u028A",["a","\u028A"]],["e\u026A",["e","i"]],["o\u028A",["o","u"]],["\u0254\u026A",["\u0254","\u026A"]]]);function qn(e){let n=$n.get(e);if(n!==void 0||e.length!==2)return n;let r=e[0],t=e[1];return p(r)&&p(t)?[r,t]:void 0}var Xn={text:"ah",onset:[],nucleus:{ipa:"\u0251",stress:1},coda:[],wordEnd:!0,phraseEnd:!1};function Jn(e,n,r={}){let t=W(r.consonantScale??He,0,Zn),o=et(e,n),s=o.length;if(s===0)return{phrases:[],leadIn:0};let i=new Array(s);for(let c=0;c<s;c++){let h=o[c];i[c]=c===s-1||h.syl.phraseEnd||o[c+1].time-(h.time+h.len)>jn}let a=new Array(s),l=new Array(s),f=0;for(let c=0;c<s;c++){c>0&&i[c-1]&&(f=c),a[c]=o[c].syl.melisma===!0?[]:Re(o[c].syl.onset,t);let h=!i[c]&&o[c+1].syl.melisma===!0;l[c]=h?[]:Re(nt(o,c,f).coda,t)}let u=new Array(s);for(let c=0;c<s;c++){let h=o[c];if(i[c])if(c+1<s){let S=o[c+1].time,E=S-h.time,m=Math.min(h.len,E),A=h.syl.phraseEnd?Math.min(Gn,Vn*m):0;D(l[c].concat(a[c+1]),E-A),D(l[c],m),u[c]=Math.max(h.time,Math.min(h.time+m,S-b(a[c+1])-A))}else D(l[c],h.len),u[c]=h.time+h.len;else{let S=o[c+1].time;D(l[c].concat(a[c+1]),S-h.time),u[c]=Math.max(h.time,S-b(a[c+1]))}}let d=[],g=0;for(let c=0;c<s;){let h=c;for(;!i[h];)h++;let S=tt(o,a,l,u,c,h);S!==void 0&&(d.push(S),g=Math.max(g,o[c].time-S.start)),c=h+1}return{phrases:d,leadIn:g}}function et(e,n){let r=[];for(let o of e)Number.isFinite(o.time)&&Number.isFinite(o.hz)&&o.hz>0&&r.push(o);r.sort((o,s)=>o.time-s.time);let t=n.length>0?n:[Xn];return r.map((o,s)=>({time:o.time,len:W(o.dur,0,Kn),hz:o.hz,vel:W(o.vel??Bn,0,1),syl:t[s%t.length]}))}function nt(e,n,r){let t=n;for(;t>r&&e[t].syl.melisma===!0;)t--;return e[t].syl}function Re(e,n){let r=[];for(let t of e){let o=t.dur,s=typeof o=="number"&&Number.isFinite(o)?W(o,0,Qn):T(t.ipa)*n;r.push({ipa:t.ipa,dur:s})}return r}function b(e){let n=0;for(let r of e)n+=r.dur;return n}function D(e,n){let r=b(e),t=n-kn;if(r<=t||r<=0)return;let o=Math.max(0,t)/r,s=0;for(let a of e)a.dur=Math.max(Math.min(a.dur,zn),a.dur*o),s+=a.dur;let i=s+Yn;if(i>n){let a=Math.max(0,n)/i;for(let l of e)l.dur*=a}}function tt(e,n,r,t,o,s){let i=[],a=e[o].time,l=a-b(n[o]),f=[{time:l,hz:e[o].hz}];$(i,n[o],l,a,"onset");for(let u=o;u<=s;u++){let d=e[u],g=t[u],c=Math.max(d.time,g-b(r[u])),h=u===s||e[u+1].syl.melisma!==!0,S=u>o&&d.syl.melisma===!0;ot(i,d.syl.nucleus,d.time,c,h,S),$(i,r[u],c,g,"coda"),u<s&&(f.push({time:g,hz:e[u+1].hz}),$(i,n[u+1],g,e[u+1].time,"onset"))}if(i.length!==0)return{start:i[0].start,end:i[i.length-1].end,vel:e[o].vel,spans:i,pitches:f}}function $(e,n,r,t,o){let s=r;for(let i=0;i<n.length;i++){let a=i===n.length-1?t:Math.min(t,s+n[i].dur);a>s&&e.push({ipa:n[i].ipa,start:s,end:a,kind:o}),s=a}}function ot(e,n,r,t,o,s){let i=n.ipa,a=qn(i);if(a!==void 0&&o){let l=r+(n.hold??_n)*(t-r);q(e,a[0],r,l,s),q(e,a[1],l,t,!1)}else q(e,a===void 0?i:a[0],r,t,s)}function q(e,n,r,t,o){if(!(t>r))return;let s=e[e.length-1],i=s!==void 0&&s.kind==="nucleus"&&s.ipa===n;if(o&&i&&s.end===r){s.end=t;return}e.push({ipa:n,start:r,end:t,kind:"nucleus"})}function be(e,n={}){let r=Q(e,n),t=[],o=[],s=[];for(let i of r){if(o.push(i),!i.wordEnd)continue;let a=Oe(o);t.push(a),s.push(a.ipa,i.phraseEnd?" | ":" "),o=[]}if(o.length>0){let i=Oe(o);t.push(i),s.push(i.ipa)}return{words:t,ipa:s.join("").replace(/ \| $/,"").trim(),syllables:r}}function rt(e,n={}){return be(e,n).ipa}function Oe(e){let n=e.filter(t=>!t.melisma).length>1,r=e.filter(t=>!t.melisma).map(t=>{let o=n&&t.nucleus.stress===1?"\u02C8":n&&t.nucleus.stress===2?"\u02CC":"",s=[...t.onset,t.nucleus,...t.coda].map(i=>i.ipa).join("");return o+s}).join(".");return{text:e.map(t=>t.text).join("-"),ipa:r,syllables:e,sets:e.map(t=>t.nucleus.set)}}var st=.18,it=.09,at=1.5,lt=.28;function ct(e,n={},r=[]){let t=n.prosody??B,o=n.hz!==void 0&&n.hz>0?n.hz:110,s=Math.max(.1,(n.rate??1)*t.rate),i=[],a=[],l=0,f=0;for(let u=0;u<e.length;){let d=u;for(;d<e.length-1&&!e[d].phraseEnd;)d++;let g=e.slice(u,d+1),c=r[f]??t.tune==="rise",{pitches:h,endTone:S}=ut(g,t,c);for(let E=0;E<g.length;E++){let m=g[E],A=E===g.length-1,we=m.nucleus.stress!==void 0&&m.nucleus.stress>0,w=m.nucleus.dur??(we?st:it);A&&(w*=at);let C=0;for(let y of m.coda)C+=y.dur??T(y.ipa);if(!A)for(let y of g[E+1].onset)C+=y.dur??T(y.ipa);if(A&&S!==void 0){let y=.45*w/s,J=(.55*w+C)/s;a.push({...m,coda:[],phraseEnd:!1,wordEnd:!1}),a.push({text:"~",onset:[],nucleus:{...m.nucleus},coda:m.coda,melisma:!0,wordEnd:m.wordEnd,phraseEnd:m.phraseEnd}),i.push({time:l,dur:y,hz:o*2**(h[E]/12)}),i.push({time:l+y,dur:J,hz:o*2**(S/12)}),l+=y+J;continue}let X=(w+C)/s;a.push(m),i.push({time:l,dur:X,hz:o*2**(h[E]/12)}),l+=X}if(d<e.length-1){let E=0;for(let A of e[d+1].onset)E+=A.dur??T(A.ipa);let m=lt/s+E;i.push({time:l,dur:m,hz:0,rest:!0}),l+=m}f++,u=d+1}return{syllables:a,notes:i}}function ut(e,n,r){let t=e.length,o=-1;for(let i=t-1;i>=0;i--){let a=e[i].nucleus.stress;if(a!==void 0&&a>0){o=i;break}}o<0&&(o=t-1);let s=[];for(let i=0;i<t;i++){let a=t>1?-n.declination*(i/(t-1)):0,l=e[i].nucleus.stress??0,f=a;if(i<o)l===1?f+=n.range*(i===dt(e)?1:.7):l===2&&(f+=n.range*.35);else if(i===o)f+=r?-.25*n.range:n.range;else{let u=(i-o)/(t-1-o);f+=r?n.range*(.4+.8*u):-.6*n.range*u-.2*n.range}s.push(f)}return o<t-1?{pitches:s}:{pitches:s,endTone:r?-n.declination+n.range:-n.declination-.4*n.range}}function dt(e){for(let n=0;n<e.length;n++)if(e[n].nucleus.stress===1)return n;return-1}export{Me as a,z as b,Je as c,G as d,V as e,_ as f,B as g,O as h,de as i,fe as j,pe as k,he as l,ge as m,me as n,Se as o,j as p,Z as q,K as r,Ae as s,Q as t,ct as u,Jn as v,Dn as w,be as x,rt as y};
6
+ //# sourceMappingURL=chunk-QJYKYLE2.js.map