bellows-voice 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +3 -3
  2. package/THIRD_PARTY_NOTICES.md +13 -13
  3. package/dist/chunk-OIFBP6WA.js +3 -0
  4. package/dist/chunk-OIFBP6WA.js.map +7 -0
  5. package/dist/chunk-XR5GDH27.js +6 -0
  6. package/dist/chunk-XR5GDH27.js.map +7 -0
  7. package/dist/dict/cmudict-data.gen.d.ts +3 -2
  8. package/dist/dict/cmudict-data.gen.d.ts.map +1 -1
  9. package/dist/dict/cmudict.d.ts +6 -1
  10. package/dist/dict/cmudict.d.ts.map +1 -1
  11. package/dist/dict.js +41 -104
  12. package/dist/dict.js.map +2 -2
  13. package/dist/dsp/junction-airway.d.ts +13 -3
  14. package/dist/dsp/junction-airway.d.ts.map +1 -1
  15. package/dist/dsp/side-branch.d.ts +9 -5
  16. package/dist/dsp/side-branch.d.ts.map +1 -1
  17. package/dist/engine.js +1 -1
  18. package/dist/engine.js.map +3 -3
  19. package/dist/engines/vocal-beat-scores.d.ts.map +1 -1
  20. package/dist/engines/vocal-planner.d.ts +0 -1
  21. package/dist/engines/vocal-planner.d.ts.map +1 -1
  22. package/dist/engines/vocal-settings.d.ts +2 -0
  23. package/dist/engines/vocal-settings.d.ts.map +1 -1
  24. package/dist/engines/vocal.d.ts.map +1 -1
  25. package/dist/explain.d.ts.map +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/index.js.map +3 -3
  28. package/dist/lyrics/accents.d.ts +1 -1
  29. package/dist/lyrics/accents.d.ts.map +1 -1
  30. package/dist/lyrics/beat.d.ts.map +1 -1
  31. package/dist/lyrics/english.d.ts +5 -0
  32. package/dist/lyrics/english.d.ts.map +1 -1
  33. package/dist/lyrics/numbers.d.ts +9 -3
  34. package/dist/lyrics/numbers.d.ts.map +1 -1
  35. package/dist/lyrics/pronounce.d.ts +2 -0
  36. package/dist/lyrics/pronounce.d.ts.map +1 -1
  37. package/dist/lyrics/read.d.ts +1 -1
  38. package/dist/lyrics/speech.d.ts.map +1 -1
  39. package/dist/singer.d.ts +11 -6
  40. package/dist/singer.d.ts.map +1 -1
  41. package/dist/text.js +1 -1
  42. package/dist/view.js +1 -1
  43. package/dist/view.js.map +1 -1
  44. package/dist/worklet-code.gen.d.ts.map +1 -1
  45. package/dist/worklet.js +1 -1
  46. package/package.json +1 -1
  47. package/dist/chunk-4PNDIKDG.js +0 -3
  48. package/dist/chunk-4PNDIKDG.js.map +0 -7
  49. package/dist/chunk-5JCPPIX7.js +0 -6
  50. package/dist/chunk-5JCPPIX7.js.map +0 -7
  51. package/dist/chunk-BUKRW4C6.js +0 -3
  52. package/dist/chunk-BUKRW4C6.js.map +0 -7
  53. package/dist/chunk-E5BOE5OO.js +0 -6
  54. package/dist/chunk-E5BOE5OO.js.map +0 -7
  55. package/dist/chunk-FCBNIGIO.js +0 -3
  56. package/dist/chunk-FCBNIGIO.js.map +0 -7
  57. package/dist/chunk-J4ODV4QR.js +0 -6
  58. package/dist/chunk-J4ODV4QR.js.map +0 -7
  59. package/dist/chunk-MCZRKZS7.js +0 -3
  60. package/dist/chunk-MCZRKZS7.js.map +0 -7
  61. package/dist/chunk-MW7UO3SL.js +0 -6
  62. package/dist/chunk-MW7UO3SL.js.map +0 -7
  63. package/dist/chunk-OIBHJK7R.js +0 -6
  64. package/dist/chunk-OIBHJK7R.js.map +0 -7
  65. package/dist/chunk-RXULDSHA.js +0 -6
  66. package/dist/chunk-RXULDSHA.js.map +0 -7
  67. package/dist/chunk-RZMXXTHL.js +0 -3
  68. package/dist/chunk-RZMXXTHL.js.map +0 -7
  69. package/dist/chunk-WA623NKS.js +0 -6
  70. package/dist/chunk-WA623NKS.js.map +0 -7
  71. package/dist/chunk-WBPNYYUW.js +0 -3
  72. package/dist/chunk-WBPNYYUW.js.map +0 -7
  73. package/dist/chunk-ZIDRAL5Z.js +0 -3
  74. package/dist/chunk-ZIDRAL5Z.js.map +0 -7
package/README.md CHANGED
@@ -35,7 +35,7 @@ bellows-voice imports `bellowsjs` by name, so a page without a bundler maps that
35
35
  </script>
36
36
  <script type="module">
37
37
  import { Bellows } from 'bellowsjs';
38
- import { voice, singer } from 'https://cdn.jsdelivr.net/npm/bellows-voice@0.4/dist/index.js';
38
+ import { voice, singer } from 'https://cdn.jsdelivr.net/npm/bellows-voice@0.7/dist/index.js';
39
39
 
40
40
  document.querySelector('button').onclick = async () => {
41
41
  const b = await Bellows.boot({ plugins: [voice] });
@@ -45,7 +45,7 @@ bellows-voice imports `bellowsjs` by name, so a page without a bundler maps that
45
45
  <button>Speak</button>
46
46
  ```
47
47
 
48
- The other entries load the same way: `.../dist/text.js`, `.../dist/view.js`, `.../dist/engine.js`. unpkg serves the same files (`https://unpkg.com/bellows-voice@0.4/dist/index.js`).
48
+ The other entries load the same way: `.../dist/text.js`, `.../dist/view.js`, `.../dist/engine.js`, `.../dist/dict.js`. unpkg serves the same files (`https://unpkg.com/bellows-voice@0.7/dist/index.js`).
49
49
 
50
50
  ## Starter voices
51
51
 
@@ -184,7 +184,7 @@ registerVoice();
184
184
  ## Pronunciations
185
185
 
186
186
  Words go through English letter-to-sound rules (about 77 percent of common words exact) unless you give
187
- a pronouncing dictionary. One ships as its own entry, loaded only if you import it (about 590 KB gzipped):
187
+ a pronouncing dictionary. One ships as its own entry, loaded only if you import it (about 570 KB gzipped):
188
188
 
189
189
  ```js
190
190
  import { cmudict } from 'bellows-voice/dict';
@@ -4,9 +4,10 @@ bellows-voice is licensed under MIT (see LICENSE). Parts of it are ported from,
4
4
  from, the software below, which is distributed under its own license. The notice for each is
5
5
  reproduced here because the build strips source comments from the executable bundles, so the
6
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.
7
+ `dist/text.js`, `dist/engine.js`, `dist/view.js`, `dist/dict.js`, `dist/worklet.js` and the
8
+ chunks they share) opens instead with a one-line banner naming bellows-voice's license and
9
+ CHIMERA's copyright and MIT license and pointing here, and the bundle that holds the CMU
10
+ dictionary's data carries Carnegie Mellon's copyright line beside it; the shipped source maps quote the sources whole, headers included.
10
11
 
11
12
  This code lived in bellowsjs until 0.4.0 and moved here with its history; the paths below are
12
13
  this repository's.
@@ -37,8 +38,10 @@ CHIMERA file it came from and what was changed.
37
38
  | `src/lyrics/read.ts` | `crates/chimera/src/phonetics/syllables.rs` (`phonetics/syllables.ts`) |
38
39
  | `src/lyrics/durations.ts` | the consonant durations of `crates/chimera/src/phonetics/inventory.rs` (`phonetics/inventory.ts`) |
39
40
  | `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`) |
41
+ | `src/view/drawing.ts` | `crates/chimera/src/anatomy/human.rs:1228-1262`, the drawing parts of the geometry: the whole tongue, the lips with their outer faces, the incisors, the jaw bone, the soft palate and the epiglottis |
42
+ | `src/view/head.ts` | `src/ui/render/profile.ts`, `buildProfile` and its helpers: the head around the tract: skin, skull, eye, vertebrae, nasal cavity and turbinates, hard palate, jaw, hyoid, thyroid, trachea, folds |
40
43
  | `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 |
44
+ | `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, the drawing outputs kept for `src/view/drawing.ts` |
42
45
 
43
46
  In the repository only, `test/lyrics/chimera-golden.test.ts` carries cases converted from
44
47
  CHIMERA's golden fixtures (`crates/chimera/tests/golden/phonetics-*.json`), and the lyric
@@ -62,8 +65,6 @@ in CHIMERA, written again in bellows' own idiom, and they say so in their header
62
65
  | `src/dsp/airway-tube.ts` | the fixed tubes' wall and viscous elements (`airway/network.rs:860-1010`), lumped onto a few nodes here |
63
66
  | `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
67
  | `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/view/drawing.ts` | the drawing parts of the geometry: the whole tongue, the lips with their outer faces, the incisors, the jaw bone, the soft palate and the epiglottis (`anatomy/human.rs:1228-1262`) |
66
- | `src/view/head.ts` | the head around the tract: skin, skull, eye, vertebrae, nasal cavity and turbinates, hard palate, jaw, hyoid, thyroid, trachea, folds (`src/ui/render/profile.ts`, `buildProfile`) |
67
68
  | `src/engines/vocal-beats.ts`, `src/engines/vocal-beat-scores.ts`, `src/lyrics/beat.ts` | the beatbox sounds, their airstreams, Standard Beatbox Notation symbols and gestural scores (ready posture, ejective piston, breath, snap and release-fricative timing), the pattern text format, the beat presets and the swing rule (`phonetics/beatbox.rs`, `control/beat_player.rs`), reimplemented on the online planner; the breath key, the ejective's push through the release, the kick's raised tongue body, the 'ch' and 'Psh' sounds, the close microphone and the retriggering on the phoneme parameter are bellows' own |
68
69
  | `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`) |
69
70
 
@@ -94,20 +95,19 @@ Birkholz, Kroger and Neuschaefer-Rube (2011) for the self-oscillating two-mass f
94
95
  (`src/dsp/fold-oscillator.ts`); Shadle (1991) for keeping the obstacle source broadband while the
95
96
  free-jet, wall and labiodental sources fall through a second pole, and the critical Reynolds number
96
97
  of a turbulent jet (Flanagan, Speech Analysis, Synthesis and Perception) for the threshold under
97
- which a constriction makes no noise (`src/dsp/junction-airway.ts`); Klatt (1980) and Gold and
98
- Rabiner (1968) behind the resonators and the higher-pole correction in `src/dsp/resonator.ts`;
99
- Lisker and Abramson (1964) for voice onset times; Birkholz, Kroger and Neuschaefer-Rube (2011) and
98
+ which a constriction makes no noise (`src/dsp/junction-airway.ts`); Lisker and Abramson (1964) for voice onset times; Birkholz, Kroger and Neuschaefer-Rube (2011) and
100
99
  Birkholz and Hoole (2012) for the six-stage articulator cascade (`src/dsp/cascade.ts`), the
101
100
  VocalTractLab 2.4 manual (Birkholz 2025) for return gestures and Lofqvist and Gracco (1997) for
102
101
  the virtual lip target (`src/engines/vocal-planner.ts`), all implemented from the publications. The consonant
103
102
  durations are CHIMERA's own values, not a published table; `src/lyrics/durations.ts` says how
104
103
  they compare with Klatt's.
105
104
 
106
- ### No dictionary data
105
+ ### Dictionary data
107
106
 
108
- bellows ships no pronouncing dictionary: no CMUdict and no copy of CHIMERA's. `parseCmudict()`
109
- reads a dictionary the caller loads, and `Bellows.dictionary` or the `dictionary` option of
110
- `sing()` takes the resulting map. Without one, words go through letter-to-sound rules.
107
+ No copy of CHIMERA's dictionary ships. The CMU Pronouncing Dictionary does, in `dist/dict.js`
108
+ (`bellows-voice/dict`), under its notice below. `parseCmudict()` still reads a dictionary the
109
+ caller loads, set as `singer.dictionary` or the `dictionary` option; without one, words go
110
+ through letter-to-sound rules.
111
111
 
112
112
  ### License
113
113
 
@@ -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 u=["_","\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"],w={\u025A:"\u025D",\u0261:"g",r:"\u0279",\u02A7:"t\u0283",\u02A4:"d\u0292"},d=new Map(u.map((e,a)=>[e,a]));function O(e){let a=d.get(e);if(a!==void 0)return a;let n=w[e];return n===void 0?-1:d.get(n)??-1}var j=1,t={cls:"vowel",voiced:!0},x={_:{cls:"silence",voiced:!1},\u0251:t,\u00E6:t,\u028C:t,\u0254:t,\u025B:t,\u025D:t,\u026A:t,i:t,\u028A:t,u:t,e:t,o:t,a:t,\u0259:t,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:t,\u0250:t,\u025C:t,\u0289:t,\u0268:t,\u0258:t,\u0275:t,y:t,\u00F8:t,\u0153:t,\u026F:t,\u0264:t},l=u.map(e=>{let a=x[e];return{ipa:e,cls:a.cls,voiced:a.voiced,aspiration:a.aspiration??0,vot:a.vot??0}}),f=.012,y=d.get("s")??-1,b=new Uint8Array(l.length),m=new Uint8Array(l.length);l.forEach((e,a)=>{b[a]=e.cls==="vowel"||e.cls==="silence"?1:e.cls==="approximant"?2:0,m[a]=e.cls==="stop"?1:0});function p(e){return e>=0&&e<l.length&&e===Math.floor(e)}function S(e,a){return p(e)&&m[e]===1&&l[e].aspiration>0&&a!==y}function V(e,a,n){if(!p(e)||m[e]!==1||!p(n))return 0;let r=b[n];if(r===0)return 0;let s=l[e].vot;return r===1&&S(e,a)||s<f?s:f}var h=[{id:".",name:"Rest",role:"rest",airstream:"none",hint:"Ready posture: jaw nearly closed, lips just apart",sustained:!1},{id:"B",name:"Kick",role:"kick",airstream:"ejective",hint:"Lips burst on air the rising larynx compresses",sustained:!1},{id:"t",name:"Hi-hat",role:"hat",airstream:"pulmonic",hint:"Tongue-tip release into a short hiss",sustained:!1},{id:"tss",name:"Open hat",role:"hat",airstream:"pulmonic",hint:"The hi-hat left ringing as a long hiss",sustained:!0},{id:"Pf",name:"Snare",role:"snare",airstream:"pulmonic",hint:"Lips burst, then the lower lip hisses against the teeth",sustained:!1},{id:"K",name:"Rimshot",role:"snare",airstream:"ejective",hint:"Back of the tongue bursts on larynx-compressed air",sustained:!1},{id:"^K",name:"Inward snare",role:"snare",airstream:"ingressive",hint:"A sharp breath in past the back of the tongue",sustained:!1},{id:"!",name:"Tongue click",role:"perc",airstream:"click",hint:"Tongue seals a pocket, hollows it and pops",sustained:!1},{id:"P!",name:"Lip pop",role:"perc",airstream:"click",hint:"Sealed lips, the jaw drops, the lips pop open",sustained:!1},{id:"kch",name:"Crash",role:"hat",airstream:"pulmonic",hint:"Back-of-tongue release into a long rounded hiss",sustained:!0},{id:"m",name:"Hum",role:"bass",airstream:"voiced",hint:"Hummed bass note through the nose",sustained:!0},{id:"ch",name:"Closed hat",role:"hat",airstream:"pulmonic",hint:"Tongue-blade release into a short hush",sustained:!1},{id:"Psh",name:"Psh snare",role:"snare",airstream:"pulmonic",hint:"Lips burst into a rounded hush",sustained:!1},{id:"in",name:"Breath in",role:"rest",airstream:"ingressive",hint:"A quick breath in through an open mouth, as between phrases",sustained:!0}],g=u.length,A=h.length*2,k=g+A;function T(e){for(let n=0;n<h.length;n++)if(h[n].id===e)return n;let a=e.toLowerCase();for(let n=0;n<h.length;n++)if(h[n].id.toLowerCase()===a)return n;return-1}function E(e,a=!1){let n=T(e);return n<0?-1:g+2*n+(a?1:0)}function F(e){return e>=g&&e<k}var v="beat:";function _(e){if(!e.startsWith(v))return-1;let a=e.slice(v.length),n=a.endsWith(">")&&a.length>1;return n&&(a=a.slice(0,-1)),E(a,n)}var o={jaw:0,tbX:1,tbY:2,ttX:3,ttY:4,ttCurl:5,root:6,lipAp:7,lipProt:8,lipWidth:9,labiodental:10,velum:11,larynx:12,epilarynx:13,ventricular:14,lateral:15,dorsum:16},c=17,H=c,N=c+1,B=c+2,I=c+3;var R=[{subject:"head",param:"size",name:"Head size",low:"smaller",high:"bigger",min:.8,max:1.25,anatomy:!0,neutral:1,plain:"A bigger or smaller head and throat: bigger sounds deeper and larger, like a bigger person.",acoustics:"Scales the whole tube, so every resonance moves as 1 / size (Fitch and Giedd 1999)."},{subject:"throat",param:"pharynx",name:"Throat length",low:"shorter",high:"longer",min:.8,max:1.25,anatomy:!0,neutral:1,plain:"A longer or shorter throat behind the mouth. A long throat is much of what makes a man's voice sound like one.",acoustics:"Lengthens the back cavity: lowers F1 and pulls F2 down in front vowels."},{subject:"throat pockets",param:"piriform",name:"Throat pockets",low:"off",high:"on",min:0,max:1,anatomy:!0,strong:["off","on"],plain:"Two small pockets beside the voice box that every throat has. On, the voice loses a little of its hard top edge.",acoustics:"The piriform fossae as a side branch: a dip at 4 to 6 kHz (Dang and Honda 1997). Off by default until the vowels are re-solved with them, since they also lower F1."},{subject:"jaw",param:"jawSet",name:"Jaw",low:"held close",high:"hanging open",min:-1,max:1,strong:["clenched","hanging wide open"],plain:"How far the jaw hangs open over everything. Open sounds loud and open; close sounds tight and mumbled.",acoustics:"Opening widens the front of the mouth: raises F1 in every vowel."},{subject:"tongue",param:"tongueFront",name:"Tongue forward",low:"pulled back",high:"pushed forward",min:-1,max:1,strong:["pulled far back","pushed far forward"],plain:"Where the tongue rests. Forward sounds bright and young; back sounds dark, as if swallowed.",acoustics:"Fronting raises F2; backing lowers it (a velarized setting)."},{subject:"tongue",param:"tongueHigh",name:"Tongue height",low:"low",high:"high",min:-1,max:1,plain:"How high the tongue sits in the mouth. High sounds tight and close; low sounds open.",acoustics:"Raising lowers F1 (and raises F2 when the tongue is forward)."},{subject:"lips",param:"lipRound",name:"Lips",low:"smiling",high:"pouting",min:-1,max:1,plain:"A smile in the voice, or a pout. You can hear a smile: it brightens everything.",acoustics:"Rounding and protruding lengthen the tube and narrow its end, so the formants fall (MEASURED on /\u025B/ at 1: F1 -9, F2 -4, F3 -1 percent). Spreading does the opposite, less."},{subject:"lips",param:"lipOpen",name:"Lip opening",low:"nearly closed",high:"wide",min:-1,max:1,strong:["almost shut","very wide"],plain:"How far apart the lips stay. Nearly closed sounds muffled, as when talking through a smile you are hiding.",acoustics:"A narrower lip opening lowers every formant and the level of the highs."},{subject:"voice box",param:"larynxSet",name:"Voice box",low:"lowered",high:"raised",min:-1,max:1,plain:"Where the voice box sits in the neck. Lowered sounds big, dark and operatic; raised sounds small, bright and tense, like a cartoon.",acoustics:"Moving the larynx changes the tube's length: raising it shortens the tract and lifts every formant."},{subject:"voice",param:"nasal",name:"Nasal",low:"clear",high:"through the nose",min:0,max:1,strong:["clear","right through the nose"],plain:"Lets sound leak through the nose, as with a blocked-up or whiny voice.",acoustics:"Lowers the velum: the nasal branch adds anti-resonances and raises and widens F1 (MEASURED: /\u0259/ F1 466 to 558 Hz at 1)."},{subject:"twang",param:"twang",name:"Twang",low:"none",high:"brassy",min:0,max:1,strong:["none","very brassy"],plain:"A slight brassy edge, toward a belt or a country singer.",acoustics:"Narrows the tube just above the folds (the epilarynx), toward more energy near 2 to 4 kHz (Yanagisawa et al. 1989); in this geometry only about 1 dB (MEASURED), since the epilarynx is not yet a resonator of its own."},{subject:"throat",param:"throat",name:"Throat",low:"squeezed",high:"open",min:-1,max:1,plain:"An open throat, as singers are taught, sounds round and full; a squeezed one sounds strained.",acoustics:"Moves the tongue root forward (and the larynx down) or back into the pharynx: an open throat lowers F1 a little and evens the low formants."},{subject:"cheeks",param:"cheeks",name:"Cheeks",low:"firm",high:"slack",min:0,max:1,plain:'How soft the cheeks are. Slack cheeks puff out as air builds up, so "b", "d" and "g" keep their hum longer.',acoustics:"Softens the oral walls toward Ishizaka et al.'s (1975) relaxed cheek: more compliance behind a closure, a longer voice bar."}];function i(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function M(e){return R.find(a=>a.param===e)}function D(e,a){if(a.fill(0),a.length<c)return;let n=i(e.jawSet);a[o.jaw]=.6*n,a[o.tbX]=.6*i(e.tongueFront),a[o.tbY]=.5*i(e.tongueHigh)-.5*n;let r=i(e.lipRound);r>0?(a[o.lipProt]=.6*r,a[o.lipWidth]=-.5*r,a[o.lipAp]=-.15*r):(a[o.lipWidth]=-.6*r,a[o.lipProt]=.15*r,a[o.lipAp]=-.1*r),a[o.lipAp]+=.4*i(e.lipOpen)+.3*n;let s=i(e.throat);a[o.larynx]=.9*i(e.larynxSet)+.3*i(e.twang)-.4*(s>0?s:0),a[o.epilarynx]=.8*i(e.twang),a[o.root]=.6*s,a[o.velum]=.7*i(e.nasal)}var Y=[{id:"neutral",name:"Neutral",plain:"The voice as it is.",values:{}},{id:"smile",name:"Smile",plain:"Talking while smiling: brighter and friendlier.",values:{lipRound:-.8,tongueFront:.3,larynxSet:.15}},{id:"pout",name:"Pout",plain:"Lips pushed forward: darker and softer.",values:{lipRound:.8}},{id:"operatic",name:"Operatic",plain:"A lowered larynx and open throat: big, round and dark.",values:{larynxSet:-.7,throat:.7,lipRound:.25,jawSet:.3}},{id:"belt",name:"Brassy belt",plain:"Twang and a high larynx: cutting and bright.",values:{twang:.8,larynxSet:.35,jawSet:.3,lipRound:-.3}},{id:"nasal",name:"Nasal",plain:"Through the nose, whiny.",values:{nasal:.6,larynxSet:.2}},{id:"muffled",name:"Muffled",plain:"Jaw and lips nearly shut, tongue back: hard to hear.",values:{jawSet:-.7,lipOpen:-.6,tongueFront:-.4}},{id:"tense",name:"Tense",plain:"A squeezed throat and raised larynx: strained.",values:{throat:-.7,larynxSet:.6,tongueHigh:.3}},{id:"giant",name:"Giant",plain:"A much bigger head and longer throat: deep and huge.",values:{size:1.22,pharynx:1.15,larynxSet:-.5}},{id:"tiny",name:"Tiny",plain:"A small head and short throat: small and bright, like a cartoon.",values:{size:.82,pharynx:.85,larynxSet:.6}}];export{u as a,O as b,j as c,l as d,S as e,V as f,h as g,g as h,k as i,T as j,E as k,F as l,v as m,_ as n,o,c as p,H as q,N as r,B as s,I as t,R as u,M as v,D as w,Y as x};
3
+ //# sourceMappingURL=chunk-OIFBP6WA.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/engines/vocal-phonemes.ts", "../src/engines/vocal-beats.ts", "../src/engines/vocal-articulators.ts", "../src/engines/vocal-settings.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 * The beatbox sounds: drum sounds made on the voice's own tract with the airstreams beatboxers use.\n *\n * pulmonic breath from the lungs (snares, hats, crash)\n * ejective the glottis sealed and the larynx rising like a piston, compressing the air behind\n * an oral closure (kick, rimshot): punchy and dry, no breath noise\n * click the tongue seals a pocket and hollows it; the release pops inward (velaric)\n * ingressive breath drawn in past a constriction (inward K snare)\n * voiced a hummed bass through the nose\n *\n * The sounds, their airstreams and Standard Beatbox Notation symbols follow CHIMERA by Jameson Hodge\n * (MIT, https://github.com/jamesondh/chimera-vocal-synth, crates/chimera/src/phonetics/beatbox.rs),\n * which builds each as a short gestural score. Reimplemented on bellows' planner\n * (`writeBeatScore` in engines/vocal-beat-scores.ts); 'ch' and 'Psh' are bellows' own. See THIRD_PARTY_NOTICES.md.\n *\n * On the engine's `phoneme` parameter a beat sits after the table phonemes, two indices a sound:\n * plain, then accented (louder breath, a higher larynx). '.' is the ready posture, silent, which\n * holds a pattern's rests inside one breath group.\n */\n\nimport { VOCAL_PHONEMES } from './vocal-phonemes';\n\nexport type BeatRole = 'kick' | 'snare' | 'hat' | 'perc' | 'bass' | 'rest';\nexport type Airstream = 'pulmonic' | 'ejective' | 'click' | 'ingressive' | 'voiced' | 'none';\n\nexport interface VocalBeat {\n /** Pattern symbol (Standard Beatbox Notation where it has one). */\n id: string;\n name: string;\n role: BeatRole;\n airstream: Airstream;\n /** What the mouth does, in a line. */\n hint: string;\n /** Whether the sound lasts as long as its step allows (open hat, crash, hum). */\n sustained: boolean;\n}\n\nexport const VOCAL_BEATS: readonly VocalBeat[] = [\n { id: '.', name: 'Rest', role: 'rest', airstream: 'none', hint: 'Ready posture: jaw nearly closed, lips just apart', sustained: false },\n { id: 'B', name: 'Kick', role: 'kick', airstream: 'ejective', hint: 'Lips burst on air the rising larynx compresses', sustained: false },\n { id: 't', name: 'Hi-hat', role: 'hat', airstream: 'pulmonic', hint: 'Tongue-tip release into a short hiss', sustained: false },\n { id: 'tss', name: 'Open hat', role: 'hat', airstream: 'pulmonic', hint: 'The hi-hat left ringing as a long hiss', sustained: true },\n { id: 'Pf', name: 'Snare', role: 'snare', airstream: 'pulmonic', hint: 'Lips burst, then the lower lip hisses against the teeth', sustained: false },\n { id: 'K', name: 'Rimshot', role: 'snare', airstream: 'ejective', hint: 'Back of the tongue bursts on larynx-compressed air', sustained: false },\n { id: '^K', name: 'Inward snare', role: 'snare', airstream: 'ingressive', hint: 'A sharp breath in past the back of the tongue', sustained: false },\n { id: '!', name: 'Tongue click', role: 'perc', airstream: 'click', hint: 'Tongue seals a pocket, hollows it and pops', sustained: false },\n { id: 'P!', name: 'Lip pop', role: 'perc', airstream: 'click', hint: 'Sealed lips, the jaw drops, the lips pop open', sustained: false },\n { id: 'kch', name: 'Crash', role: 'hat', airstream: 'pulmonic', hint: 'Back-of-tongue release into a long rounded hiss', sustained: true },\n { id: 'm', name: 'Hum', role: 'bass', airstream: 'voiced', hint: 'Hummed bass note through the nose', sustained: true },\n { id: 'ch', name: 'Closed hat', role: 'hat', airstream: 'pulmonic', hint: 'Tongue-blade release into a short hush', sustained: false },\n { id: 'Psh', name: 'Psh snare', role: 'snare', airstream: 'pulmonic', hint: 'Lips burst into a rounded hush', sustained: false },\n { id: 'in', name: 'Breath in', role: 'rest', airstream: 'ingressive', hint: 'A quick breath in through an open mouth, as between phrases', sustained: true },\n];\n\n/** Where the beats start on the `phoneme` parameter: after the table phonemes. */\nexport const VOCAL_BEAT_BASE = VOCAL_PHONEMES.length;\n/** How many `phoneme` indices the beats take (each plain and accented). */\nexport const VOCAL_BEAT_SLOTS = VOCAL_BEATS.length * 2;\n/** Every sound on the `phoneme` parameter: the phonemes, then the beats. */\nexport const VOCAL_SOUND_COUNT = VOCAL_BEAT_BASE + VOCAL_BEAT_SLOTS;\n\n/** The beat's position in VOCAL_BEATS for an id (exact, then ignoring case), or -1. */\nexport function vocalBeatNumber(id: string): number {\n for (let i = 0; i < VOCAL_BEATS.length; i++) if (VOCAL_BEATS[i].id === id) return i;\n const lower = id.toLowerCase();\n for (let i = 0; i < VOCAL_BEATS.length; i++) if (VOCAL_BEATS[i].id.toLowerCase() === lower) return i;\n return -1;\n}\n\n/** The `phoneme` index of a beat, plain or accented, or -1 for an unknown id. */\nexport function vocalBeatIndex(id: string, accent = false): number {\n const n = vocalBeatNumber(id);\n return n < 0 ? -1 : VOCAL_BEAT_BASE + 2 * n + (accent ? 1 : 0);\n}\n\n/** Whether a `phoneme` index is a beat. */\nexport function vocalIsBeat(idx: number): boolean {\n return idx >= VOCAL_BEAT_BASE && idx < VOCAL_SOUND_COUNT;\n}\n\n/** The prefix a sung span's IPA carries to name a beat (\"beat:B\", \"beat:Pf>\" accented). */\nexport const BEAT_PREFIX = 'beat:';\n\n/** The `phoneme` index a span's sound names: a beat token or an IPA phoneme's index from `ipaIndex`. */\nexport function beatTokenIndex(token: string): number {\n if (!token.startsWith(BEAT_PREFIX)) return -1;\n let id = token.slice(BEAT_PREFIX.length);\n const accent = id.endsWith('>') && id.length > 1;\n if (accent) id = id.slice(0, -1);\n return vocalBeatIndex(id, accent);\n}\n", "/*\n * CHIMERA's 17 articulators (Jameson Hodge, MIT,\n * https://github.com/jamesondh/chimera-vocal-synth at 1d3ea49,\n * control/articulators.rs:23), in the order of VOCAL_ARTICULATOR_NAMES\n * (vocal-tables.gen.ts) and of the geometry's input (vocal-geometry.ts).\n */\n\n/** Articulator indices. */\nexport const ART = {\n jaw: 0,\n tbX: 1,\n tbY: 2,\n ttX: 3,\n ttY: 4,\n ttCurl: 5,\n root: 6,\n lipAp: 7,\n lipProt: 8,\n lipWidth: 9,\n labiodental: 10,\n velum: 11,\n larynx: 12,\n epilarynx: 13,\n ventricular: 14,\n lateral: 15,\n dorsum: 16,\n} as const;\n\nexport const ARTICULATORS = 17;\n\n/** Control keys: the 17 articulators, then the glottis: abduction, closure, fold stiffness (cricothyroid). */\nexport const KEY_ABDUCTION = ARTICULATORS;\nexport const KEY_CLOSURE = ARTICULATORS + 1;\nexport const KEY_STIFFNESS = ARTICULATORS + 2;\n/** The breath: a factor on the note's lung pressure, negative to draw air in (beats only; speech holds 1). */\nexport const KEY_BREATH = ARTICULATORS + 3;\n", "/*\n * Voice settings and anatomy: the shape of a voice's mouth beyond the sounds it makes.\n *\n * A setting is a long-term posture laid over every sound, Laver's articulatory setting (J. Laver,\n * The Phonetic Description of Voice Quality, 1980; summarized by Esling): the jaw held open or close,\n * the tongue fronted or backed, the lips rounded or spread, the larynx raised or lowered, the velum\n * lowered (nasal), the epilarynx narrowed (twang), the throat opened or constricted. An accent and a\n * singing style are partly settings: Liverpool's backed tongue, a pop singer's raised larynx, an\n * opera singer's lowered larynx and open throat.\n *\n * The anatomy is the tract's size: `size` scales the whole tube, so every formant goes as 1 / size\n * (a uniform tube's resonances are (2n - 1) c / 4L; formant spacing tracks vocal tract length, Fitch\n * 1997, and the length grows with body size, Fitch and Giedd 1999), and `pharynx` scales the throat\n * alone, which is most of what separates adult men's formant pattern from women's (Fitch and Giedd 1999).\n *\n * The engine (engines/vocal.ts), the mouth view (view/tract.ts) and the helpers read this one table,\n * so a setting means the same posture everywhere. Pure data and arithmetic: no audio, no allocation\n * in settingOffsets().\n */\n\nimport { ART, ARTICULATORS } from './vocal-articulators';\n\nexport interface VoiceSetting {\n /** The engine param. */\n param: string;\n /** What to call it. */\n name: string;\n /** The ends of its range, in words. */\n low: string;\n high: string;\n min: number;\n max: number;\n /** What it does, for anyone. */\n plain: string;\n /** What it does to the sound, in acoustic terms. */\n acoustics: string;\n /** Anatomy (set before a line) rather than a posture. */\n anatomy?: boolean;\n /** The value that leaves the voice as it is (0 unless given). */\n neutral?: number;\n /** What it describes, for a sentence (\"tongue\", \"voice box\"). */\n subject: string;\n /** The ends said strongly, where \"very\" does not fit (\"pushed far forward\"); left out, the helpers build them. */\n strong?: [low: string, high: string];\n}\n\nexport const VOICE_SETTINGS: readonly VoiceSetting[] = [\n {\n subject: 'head', param: 'size', name: 'Head size', low: 'smaller', high: 'bigger', min: 0.8, max: 1.25, anatomy: true, neutral: 1,\n plain: 'A bigger or smaller head and throat: bigger sounds deeper and larger, like a bigger person.',\n acoustics: 'Scales the whole tube, so every resonance moves as 1 / size (Fitch and Giedd 1999).',\n },\n {\n subject: 'throat', param: 'pharynx', name: 'Throat length', low: 'shorter', high: 'longer', min: 0.8, max: 1.25, anatomy: true, neutral: 1,\n plain: 'A longer or shorter throat behind the mouth. A long throat is much of what makes a man\\'s voice sound like one.',\n acoustics: 'Lengthens the back cavity: lowers F1 and pulls F2 down in front vowels.',\n },\n {\n subject: 'throat pockets', param: 'piriform', name: 'Throat pockets', low: 'off', high: 'on', min: 0, max: 1, anatomy: true, strong: ['off', 'on'],\n plain: 'Two small pockets beside the voice box that every throat has. On, the voice loses a little of its hard top edge.',\n acoustics: 'The piriform fossae as a side branch: a dip at 4 to 6 kHz (Dang and Honda 1997). Off by default until the vowels are re-solved with them, since they also lower F1.',\n },\n {\n subject: 'jaw', param: 'jawSet', name: 'Jaw', low: 'held close', high: 'hanging open', min: -1, max: 1, strong: ['clenched', 'hanging wide open'],\n plain: 'How far the jaw hangs open over everything. Open sounds loud and open; close sounds tight and mumbled.',\n acoustics: 'Opening widens the front of the mouth: raises F1 in every vowel.',\n },\n {\n subject: 'tongue', param: 'tongueFront', name: 'Tongue forward', low: 'pulled back', high: 'pushed forward', min: -1, max: 1, strong: ['pulled far back', 'pushed far forward'],\n plain: 'Where the tongue rests. Forward sounds bright and young; back sounds dark, as if swallowed.',\n acoustics: 'Fronting raises F2; backing lowers it (a velarized setting).',\n },\n {\n subject: 'tongue', param: 'tongueHigh', name: 'Tongue height', low: 'low', high: 'high', min: -1, max: 1,\n plain: 'How high the tongue sits in the mouth. High sounds tight and close; low sounds open.',\n acoustics: 'Raising lowers F1 (and raises F2 when the tongue is forward).',\n },\n {\n subject: 'lips', param: 'lipRound', name: 'Lips', low: 'smiling', high: 'pouting', min: -1, max: 1,\n plain: 'A smile in the voice, or a pout. You can hear a smile: it brightens everything.',\n acoustics: 'Rounding and protruding lengthen the tube and narrow its end, so the formants fall (MEASURED on /\u025B/ at 1: F1 -9, F2 -4, F3 -1 percent). Spreading does the opposite, less.',\n },\n {\n subject: 'lips', param: 'lipOpen', name: 'Lip opening', low: 'nearly closed', high: 'wide', min: -1, max: 1, strong: ['almost shut', 'very wide'],\n plain: 'How far apart the lips stay. Nearly closed sounds muffled, as when talking through a smile you are hiding.',\n acoustics: 'A narrower lip opening lowers every formant and the level of the highs.',\n },\n {\n subject: 'voice box', param: 'larynxSet', name: 'Voice box', low: 'lowered', high: 'raised', min: -1, max: 1,\n plain: 'Where the voice box sits in the neck. Lowered sounds big, dark and operatic; raised sounds small, bright and tense, like a cartoon.',\n acoustics: 'Moving the larynx changes the tube\\'s length: raising it shortens the tract and lifts every formant.',\n },\n {\n subject: 'voice', param: 'nasal', name: 'Nasal', low: 'clear', high: 'through the nose', min: 0, max: 1, strong: ['clear', 'right through the nose'],\n plain: 'Lets sound leak through the nose, as with a blocked-up or whiny voice.',\n acoustics: 'Lowers the velum: the nasal branch adds anti-resonances and raises and widens F1 (MEASURED: /\u0259/ F1 466 to 558 Hz at 1).',\n },\n {\n subject: 'twang', param: 'twang', name: 'Twang', low: 'none', high: 'brassy', min: 0, max: 1, strong: ['none', 'very brassy'],\n plain: 'A slight brassy edge, toward a belt or a country singer.',\n acoustics: 'Narrows the tube just above the folds (the epilarynx), toward more energy near 2 to 4 kHz (Yanagisawa et al. 1989); in this geometry only about 1 dB (MEASURED), since the epilarynx is not yet a resonator of its own.',\n },\n {\n subject: 'throat', param: 'throat', name: 'Throat', low: 'squeezed', high: 'open', min: -1, max: 1,\n plain: 'An open throat, as singers are taught, sounds round and full; a squeezed one sounds strained.',\n acoustics: 'Moves the tongue root forward (and the larynx down) or back into the pharynx: an open throat lowers F1 a little and evens the low formants.',\n },\n {\n subject: 'cheeks', param: 'cheeks', name: 'Cheeks', low: 'firm', high: 'slack', min: 0, max: 1,\n plain: 'How soft the cheeks are. Slack cheeks puff out as air builds up, so \"b\", \"d\" and \"g\" keep their hum longer.',\n acoustics: 'Softens the oral walls toward Ishizaka et al.\\'s (1975) relaxed cheek: more compliance behind a closure, a longer voice bar.',\n },\n];\n\n/** A setting's value, 0 when missing or not finite. */\nfunction v(x: number | undefined): number {\n return typeof x === 'number' && Number.isFinite(x) ? x : 0;\n}\n\n/** A setting by param name. */\nexport function voiceSetting(param: string): VoiceSetting | undefined {\n return VOICE_SETTINGS.find((s) => s.param === param);\n}\n\n/** The posture settings' values, 0 where left out. */\nexport interface SettingValues {\n jawSet?: number;\n tongueFront?: number;\n tongueHigh?: number;\n lipRound?: number;\n lipOpen?: number;\n larynxSet?: number;\n nasal?: number;\n twang?: number;\n throat?: number;\n}\n\n/**\n * The posture settings as offsets on the 17 articulators, into `out`. The scales are this voice's,\n * chosen so 1 is strong but plausible; the formant shift of each is measured against the direction\n * acoustic theory gives (test/engines-physical/anatomy.test.ts).\n */\nexport function settingOffsets(st: SettingValues, out: Float64Array): void {\n out.fill(0);\n if (out.length < ARTICULATORS) return;\n // the jaw carries the tongue and the lower lip with it (as the formant tuning in vocal.ts does):\n // opened alone, with the tongue body fixed in the head, it left F1 where it was (MEASURED)\n const jaw = v(st.jawSet);\n out[ART.jaw] = 0.6 * jaw;\n out[ART.tbX] = 0.6 * v(st.tongueFront);\n out[ART.tbY] = 0.5 * v(st.tongueHigh) - 0.5 * jaw;\n const r = v(st.lipRound);\n if (r > 0) {\n out[ART.lipProt] = 0.6 * r;\n out[ART.lipWidth] = -0.5 * r;\n out[ART.lipAp] = -0.15 * r;\n } else {\n out[ART.lipWidth] = -0.6 * r;\n out[ART.lipProt] = 0.15 * r;\n out[ART.lipAp] = -0.1 * r;\n }\n out[ART.lipAp] += 0.4 * v(st.lipOpen) + 0.3 * jaw;\n const throat = v(st.throat);\n out[ART.larynx] = 0.9 * v(st.larynxSet) + 0.3 * v(st.twang) - 0.4 * (throat > 0 ? throat : 0);\n out[ART.epilarynx] = 0.8 * v(st.twang);\n out[ART.root] = 0.6 * throat;\n out[ART.velum] = 0.7 * v(st.nasal);\n}\n\n/** A mouth shape anyone can pick: settings and anatomy together. */\nexport interface ShapePreset {\n id: string;\n name: string;\n /** What it sounds like, in a line. */\n plain: string;\n values: Record<string, number>;\n}\n\nexport const SHAPE_PRESETS: readonly ShapePreset[] = [\n { id: 'neutral', name: 'Neutral', plain: 'The voice as it is.', values: {} },\n { id: 'smile', name: 'Smile', plain: 'Talking while smiling: brighter and friendlier.', values: { lipRound: -0.8, tongueFront: 0.3, larynxSet: 0.15 } },\n { id: 'pout', name: 'Pout', plain: 'Lips pushed forward: darker and softer.', values: { lipRound: 0.8 } },\n { id: 'operatic', name: 'Operatic', plain: 'A lowered larynx and open throat: big, round and dark.', values: { larynxSet: -0.7, throat: 0.7, lipRound: 0.25, jawSet: 0.3 } },\n { id: 'belt', name: 'Brassy belt', plain: 'Twang and a high larynx: cutting and bright.', values: { twang: 0.8, larynxSet: 0.35, jawSet: 0.3, lipRound: -0.3 } },\n { id: 'nasal', name: 'Nasal', plain: 'Through the nose, whiny.', values: { nasal: 0.6, larynxSet: 0.2 } },\n { id: 'muffled', name: 'Muffled', plain: 'Jaw and lips nearly shut, tongue back: hard to hear.', values: { jawSet: -0.7, lipOpen: -0.6, tongueFront: -0.4 } },\n { id: 'tense', name: 'Tense', plain: 'A squeezed throat and raised larynx: strained.', values: { throat: -0.7, larynxSet: 0.6, tongueHigh: 0.3 } },\n { id: 'giant', name: 'Giant', plain: 'A much bigger head and longer throat: deep and huge.', values: { size: 1.22, pharynx: 1.15, larynxSet: -0.5 } },\n { id: 'tiny', name: 'Tiny', plain: 'A small head and short throat: small and bright, like a cartoon.', values: { size: 0.82, pharynx: 0.85, larynxSet: 0.6 } },\n];\n"],
5
+ "mappings": "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",
6
+ "names": ["VOCAL_PHONEMES", "ALIASES", "INDEX", "s", "i", "vocalPhonemeIndex", "ipa", "direct", "alias", "VOCAL_DEFAULT_PHONEME", "V", "SOUNDS", "VOCAL_ACOUSTICS", "VOCAL_UNASPIRATED_VOT", "S_INDEX", "RELEASE_INTO", "IS_STOP", "row", "inTable", "vocalReleaseAspirated", "stop", "prev", "vocalReleaseVot", "next", "into", "vot", "VOCAL_BEATS", "VOCAL_BEAT_BASE", "VOCAL_PHONEMES", "VOCAL_BEAT_SLOTS", "VOCAL_SOUND_COUNT", "vocalBeatNumber", "id", "i", "lower", "vocalBeatIndex", "accent", "vocalIsBeat", "idx", "BEAT_PREFIX", "beatTokenIndex", "token", "ART", "ARTICULATORS", "KEY_ABDUCTION", "KEY_CLOSURE", "KEY_STIFFNESS", "KEY_BREATH", "VOICE_SETTINGS", "v", "x", "voiceSetting", "param", "s", "settingOffsets", "st", "out", "ARTICULATORS", "jaw", "ART", "throat", "SHAPE_PRESETS"]
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
+ import{g as y,j as Ae,m as Se,u as j}from"./chunk-OIFBP6WA.js";var Re="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",xt="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",He=["t\u0283","d\u0292","a\u026A","a\u028A","\u0254\u026A","e\u026A","o\u028A"],vt=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"]]),Ft=/^(?=[\p{Ll}\p{Lo}])[\p{Script=Latin}\p{Script=Greek}]$/u,Dt=new Set(Array.from(Re)),$=new Set([...Re,...xt,...He]),I="_",Mt=.16,Bt=.15,Gt=.09,Yt=1.7,_t="\u0329",kt="\u030D",Wt=/[\u035C\u0361]/g,F=0,Z=1,D=2;function f(e){let t=e.codePointAt(0);return t!==void 0&&Dt.has(String.fromCodePoint(t))}function Vt(e){return Q(e).segments}function Q(e){let t=Array.from(Kt(e)),r=[],n=[],o=0,a=0;for(;a<t.length;){let i=t[a];if(i==="\u02C8"||i==="'"){o=1,a++;continue}if(i==="\u02CC"){o=2,a++;continue}if(i==="."){K(n,Z),a++;continue}if(i===","||i==="|"||i==="\u2016"){K(n,D),r.push({ipa:I,dur:Mt}),n.push(F),a++;continue}if(/\s/.test(i)){K(n,D),a++;continue}if(i==="\u02D0"||i===":"){let c=r[r.length-1];if(c){let u=f(c.ipa)?Bt:Gt;c.dur=(c.dur??u)*Yt}a++;continue}let s=i;for(let c of He)zt(t,a,c)&&(s=c);a+=s===i?1:Array.from(s).length;let l=!1;for(;a<t.length&&jt(t[a]);)(t[a]===_t||t[a]===kt)&&(l=!0),a++;if(!(!$.has(s)&&!Ft.test(s))){if(f(s)){r.push({ipa:s,stress:o}),n.push(F),o=0;continue}l&&(r.push({ipa:"\u0259",stress:o}),n.push(F),o=0),r.push({ipa:s}),n.push(F)}}return{segments:r,breaks:n}}function K(e,t){let r=e.length-1;r>=0&&e[r]<t&&(e[r]=t)}function zt(e,t,r){let n=t;for(let o of r){if(e[n]!==o)return!1;n++}return!0}function jt(e){return e>="\u0300"&&e<="\u036F"}function Kt(e){let t="";for(let r of e.normalize("NFC")){if($.has(r)){t+=r;continue}let n=vt.get(r);if(n!==void 0){t+=n;continue}let o=Array.from(r.normalize("NFD"));if(o.length>1){let a=(o[0]+o[1]).normalize("NFC");if($.has(a)){t+=a+o.slice(2).join("");continue}}t+=o.join("")}return t.replace(Wt,"")}var $t=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"]]),Zt=/^([A-Z]+)([012])?$/;function q(e){let t=[];for(let r of e.trim().split(/\s+/)){let n=Zt.exec(r);if(!n)continue;let o=n[1],a=n[2]==="1"?1:n[2]==="2"?2:0,i=$t.get(o);i!==void 0&&(a===0&&o==="AH"&&(i="\u0259"),a===0&&o==="ER"&&(i="\u025A"),t.push(f(i)?{ipa:i,stress:a}:{ipa:i}))}return t}var X=[["#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"]],Qt=X.map(e=>e[3]?e[3].split(" "):[]);function Ne(e){let t=[],r=0;for(;r<e.length;){let a=!1;for(let i=0;i<X.length;i++){let[s,l,c]=X[i];if(e.startsWith(l,r)&&be(e,r-1,s,-1)&&be(e,r+l.length,c,1)){for(let u of Qt[i])!f(u)&&u===t[t.length-1]||t.push(u);r+=l.length,a=!0;break}}a||r++}let n=[],o=t.findIndex(a=>f(a)&&a!=="\u0259"&&a!=="\u025A");o<0&&(o=t.findIndex(a=>f(a)));for(let a=0;a<t.length;a++){let i=t[a];f(i)?n.push({ipa:i,stress:a===o?1:0}):n.push({ipa:i})}return n}function Oe(e){return e==="a"||e==="e"||e==="i"||e==="o"||e==="u"||e==="y"}function be(e,t,r,n){let o=t;for(let a=0;a<r.length;a++){let i=n===1?r[a]:r[r.length-1-a],s=o>=0&&o<e.length?e[o]:void 0;if(i==="#"){if(s!==void 0)return!1}else if(i==="V"){if(!Oe(s))return!1}else if(i==="C"){if(s===void 0||Oe(s))return!1}else if(s!==i)return!1;o+=n}return!0}var qt=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"]),Xt=new Map([["r","\u0279"],["\u026B","l"]]),Jt=new Set(Array.from("m\u0271n\u0273\u0272\u014B\u0274l\u026B\u026D\u028E\u0279\u027Br\u0280\u0299\u027E\u027Djw\u028B\u0265\u0270")),en=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 Ce(e){return Jt.has(e)?2:en.has(e)?1:0}function B(e){if(e.length===0)return;let t=0;for(let r=1;r<e.length;r++)Ce(e[r].ipa)>Ce(e[t].ipa)&&(t=r);return{onset:e.slice(0,t),nucleus:e[t],coda:e.slice(t+1)}}var tn=3;function w(e){let t=[];for(let o=0;o<e.length;o++)f(e[o].ipa)&&t.push(o);let r=[],n=0;for(let o=0;o<t.length;o++){let a=t[o],i=e.length;if(o+1<t.length){let s=t[o+1],l=s-(a+1),c=0;for(let u=Math.min(tn,l);u>=1;u--)if(nn(e,s-u,s)){c=u;break}i=s-c}r.push({onset:e.slice(n,a),nucleus:e[a],coda:e.slice(a+1,i)}),n=i}return r}function nn(e,t,r){if(r-t===1){let o=e[t].ipa;return o!=="\u014B"&&o!==I}let n="";for(let o=t;o<r;o++)n+=Xt.get(e[o].ipa)??e[o].ipa;return qt.has(n)}var on=new Set(["th","sh","ch","ph","wh","ck","gh"]);function ye(e,t){let r=Math.floor(t);if(!(r>1)||!Number.isFinite(r))return[e];let n=Array.from(e),o=n.length,a=[];for(let d=0;d<o;){if(!M(n[d])){d++;continue}let E=d;do d++;while(d<o&&M(n[d])&&!rn(n[d]));a.push([E,d])}let i=o>=2&&(n[o-1]==="e"||n[o-1]==="E"),s=i&&!M(n[o-2]),l=i&&o>=3&&(n[o-2]==="l"||n[o-2]==="L")&&!M(n[o-3])&&n[o-3]!=="l"&&n[o-3]!=="L";if(a.length>1&&s&&!l&&a[a.length-1][0]+1===o&&a.pop(),a.length<r){let d=[e];for(let E=1;E<r;E++)d.push("~");return d}for(;a.length>r;){let d=a.pop();a[a.length-1][1]=d[1]}let c=[0];for(let d=0;d<a.length-1;d++){let E=a[d][1],h=a[d+1][0],p=h-E,g=p>=2&&on.has((n[h-2]+n[h-1]).toLowerCase());c.push(g?h-2:E+(p<=1?0:Math.floor(p/2)))}c.push(o);let u=[];for(let d=0;d<c.length-1;d++)u.push(n.slice(c[d],c[d+1]).join(""));return u}function M(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 rn(e){return e.length===1&&e<"\xC0"?!1:e.normalize("NFD").includes("\u0308")}var an=["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"],sn=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"]),ln=new Set(["after","nasty","master","disaster","plaster","pastor","rafter","castle","fasten"]),cn=/au|aw|al[lkt]|ough|augh|oa|wa/;function J(e,t){let r=e.toLowerCase(),n=[];for(let o=0;o<t.length;o++)f(t[o].ipa)&&n.push(o);for(let o=0;o<n.length;o++){let a=n[o],i=t[a],s=t[a+1]?.ipa,l=t[a+2]?.ipa,u=s==="\u0279"&&(l===void 0||!f(l)),d=i.stress!==void 0&&i.stress>0,E=o===n.length-1;i.set=un(i.ipa,{w:r,next:s,after:l,rCoda:u,stressed:d,last:E,single:n.length===1})}}function un(e,t){switch(e){case"i":return t.rCoda?"NEAR":!t.stressed&&t.last?"happY":"FLEECE";case"\u026A":return t.rCoda?"NEAR":"KIT";case"\u025B":return t.rCoda?"SQUARE":"DRESS";case"e\u026A":return t.rCoda?"SQUARE":"FACE";case"\xE6":return sn.has(t.w)||ln.has(t.w)||(t.next==="f"||t.next==="\u03B8"||t.next==="s")&&(t.after===void 0||!f(t.after))?"BATH":"TRAP";case"\u0251":return t.rCoda?"START":/(w|qu)a/.test(t.w)||t.w.includes("o")&&!/a(?!u|w)/.test(t.w)?"LOT":t.w.includes("a")&&!t.w.includes("o")?"PALM":"LOT";case"\u0254":return t.rCoda?"NORTH":cn.test(t.w)?"THOUGHT":"CLOTH";case"o\u028A":return t.rCoda?"FORCE":"GOAT";case"\u028C":return"STRUT";case"\u028A":return t.rCoda?"CURE":"FOOT";case"u":return t.rCoda?"CURE":"GOOSE";case"\u025D":case"\u025A":return t.stressed?"NURSE":"lettER";case"\u0259":return t.last&&t.next===void 0&&!t.single?"commA":void 0;case"a\u026A":return"PRICE";case"a\u028A":return"MOUTH";case"\u0254\u026A":return"CHOICE";default:return}}var dn=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"]]),Ie=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"]]),hn=[["billion","B IH1 L Y AH0 N"],["dollar","D AA1 L ER0"],["dollars","D AA1 L ER0 Z"],["eighteen","EY0 T IY1 N"],["eighteenth","EY0 T IY1 N TH"],["eighth","EY1 T TH"],["eightieth","EY1 T IY0 IH0 TH"],["eleven","IH0 L EH1 V AH0 N"],["eleventh","IH0 L EH1 V AH0 N TH"],["fifteen","F IH0 F T IY1 N"],["fifteenth","F IH0 F T IY1 N TH"],["fiftieth","F IH1 F T IY0 IH0 TH"],["fortieth","F AO1 R T IY0 IH0 TH"],["fourteen","F AO1 R T IY1 N"],["fourteenth","F AO1 R T IY1 N TH"],["hundred","HH AH1 N D R AH0 D"],["hundreds","HH AH1 N D R AH0 D Z"],["hundredth","HH AH1 N D R AH0 D TH"],["million","M IH1 L Y AH0 N"],["millions","M IH1 L Y AH0 N Z"],["millionth","M IH1 L Y AH0 N TH"],["minus","M AY1 N AH0 S"],["nineteen","N AY1 N T IY1 N"],["nineteenth","N AY1 N T IY1 N TH"],["nineties","N AY1 N T IY0 Z"],["ninetieth","N AY1 N T IY0 IH0 TH"],["ninety","N AY1 N T IY0"],["ninth","N AY1 N TH"],["o'clock","AH0 K L AA1 K"],["percent","P ER0 S EH1 N T"],["second","S EH1 K AH0 N D"],["seven","S EH1 V AH0 N"],["seventeen","S EH1 V AH0 N T IY1 N"],["seventeenth","S EH1 V AH0 N T IY1 N TH"],["seventh","S EH1 V AH0 N TH"],["seventies","S EH1 V AH0 N T IY0 Z"],["seventieth","S EH1 V AH0 N T IY0 IH0 TH"],["seventy","S EH1 V AH0 N T IY0"],["sixteen","S IH0 K S T IY1 N"],["sixteenth","S IH0 K S T IY1 N TH"],["sixtieth","S IH1 K S T IY0 IH0 TH"],["thirteen","TH ER1 T IY1 N"],["thirteenth","TH ER1 T IY1 N TH"],["thirtieth","TH ER1 T IY0 AH0 TH"],["thirty","TH ER1 T IY0"],["thousand","TH AW1 Z AH0 N D"],["thousands","TH AW1 Z AH0 N D Z"],["thousandth","TH AW1 Z AH0 N D TH"],["trillion","T R IH1 L Y AH0 N"],["twentieth","T W EH1 N T IY0 AH0 TH"],["zero","Z IH1 R OW0"]],pn=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"],["square","S K W EH1 R"],["squares","S K W EH1 R Z"],["squared","S K W EH1 R D"],...hn]);var fn=new Set(["\u028C","\xE6","\u0251","\u025B","\u0254","u","\u028A"]),En=new Set(["you","do","to","who","not","no"]),gn=/[\u0300-\u036F]/g,mn=/^'+|'+$/g;function Le(e,t={}){let r=e.toLowerCase().replace(mn,""),n=r.normalize("NFD").replace(gn,""),o=dn.get(n)??Tn(t.dictionary,r,n)??Ie.get(n)??pn.get(n);if(o){let a=q(o);return t.reduce&&Ie.has(n)&&An(a,n),a}if(r.includes("-")){let a=[];for(let i of r.split("-"))a.push(...Le(i,t));return a}return Ne(n)}function Tn(e,t,r){if(e)return e.get(t)||(r!==t?e.get(r):void 0)}function An(e,t){let r=0;for(let n of e)f(n.ipa)&&r++;for(let n of e)f(n.ipa)&&(n.stress=0,r===1&&fn.has(n.ipa)&&!En.has(t)&&(n.ipa="\u0259"))}function ee(e={}){return{starts:we,continues:t=>t==="-"||we(t)||t>="\u0300"&&t<="\u036F",word:t=>Sn(t,e)}}function Sn(e,t){let r=e.split("-").filter(o=>o!==""),n=[];for(let o of r){let a=Le(o,t);J(o,a);let i=w(a);if(i.length===0){let l=B(a);l&&i.push(l)}let s=r.length>1?[o]:ye(o,i.length);for(let l=0;l<i.length;l++){let{onset:c,nucleus:u,coda:d}=i[l];n.push({text:s[l]??"~",onset:c,nucleus:u,coda:d,wordEnd:!1,phraseEnd:!1})}}return n}function we(e){if(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="'")return!0;if(e<"\xC0")return!1;let t=e.normalize("NFD");if(t.length<2)return!1;let r=t[0];if(!(r>="a"&&r<="z"||r>="A"&&r<="Z"))return!1;for(let n=1;n<t.length;n++)if(t[n]<"\u0300"||t[n]>"\u036F")return!1;return!0}var G="/",te={starts:e=>e===G,continues:e=>e!==G&&e!==`
3
+ `&&e!=="\r",word:e=>Rn(Nn(e))};function Rn(e){let{segments:t,breaks:r}=Q(e),n=[],o=[[]];for(let a=0;a<t.length;a++){let i=t[a];if(i.ipa===I){n.length>0&&(n[n.length-1].phraseEnd=!0);continue}o[o.length-1].push(i),r[a]===D||a===t.length-1?(Hn(o,n),o=[[]]):r[a]===Z&&o.push([])}return n}function Hn(e,t){let r=e.length>1?On(e):w(e[0]);if(r.length===0){let n=B(e.flat());if(!n)return;r.push(n)}for(let n=0;n<r.length;n++){let{onset:o,nucleus:a,coda:i}=r[n];t.push({text:bn(r[n]),onset:o,nucleus:a,coda:i,wordEnd:n===r.length-1,phraseEnd:!1})}}function On(e){let t=[],r=[];for(let n of e){let o=w(n);if(o.length===0){t.length>0?t[t.length-1].coda.push(...n):r.push(...n);continue}r.length>0&&(o[0].onset.unshift(...r),r=[]),t.push(...o)}return t}function bn(e){let t=e.nucleus.stress===1?"\u02C8":e.nucleus.stress===2?"\u02CC":"";for(let r of e.onset)t+=r.ipa;t+=e.nucleus.ipa;for(let r of e.coda)t+=r.ipa;return t}function Nn(e){let t=e.startsWith(G)?1:0,r=e.length>t&&e.endsWith(G)?e.length-1:e.length;return e.slice(t,r)}function Ue(e,t,r={}){let n=r.t??"flap",o=r.l??"dark-coda",a=[],i=()=>{a.length>0&&Cn(a,n,o),a=[]};for(let s of e){if(!t(s)||s.melisma){i();continue}let l=[...s.onset,s.nucleus,...s.coda];l.forEach((c,u)=>a.push({seg:c,wordEnd:s.wordEnd&&u===l.length-1})),s.phraseEnd&&i()}i()}function Cn(e,t,r){if(t==="flap")for(let n=1;n+1<e.length;n++){let o=e[n-1],a=e[n+1],i=e[n].seg;(i.ipa==="t"||i.ipa==="d")&&(f(o.seg.ipa)||o.seg.ipa==="\u0279")&&f(a.seg.ipa)&&!(a.seg.stress!==void 0&&a.seg.stress!==0)&&!o.wordEnd&&(i.ipa="\u027E")}else if(t==="glottal"||t==="glottal-coda")for(let n=1;n<e.length;n++){let o=e[n].seg,a=e[n-1].seg.ipa;if(o.ipa!=="t"||!(f(a)||a==="n"||a==="l"))continue;let i=e[n+1]?.seg,s=i===void 0?t==="glottal":!f(i.ipa)&&!yn.has(i.ipa),l=t==="glottal"&&i!==void 0&&f(i.ipa)&&!(i.stress!==void 0&&i.stress!==0)&&!e[n-1].wordEnd&&f(e[n-1].seg.ipa);(s||l)&&(o.ipa="\u0294")}if(r!=="clear")for(let n=0;n<e.length;n++){if(e[n].seg.ipa!=="l")continue;let a=!(n+1<e.length&&f(e[n+1].seg.ipa))||e[n].wordEnd;r==="dark"?e[n].seg.ipa="\u026B":a&&(e[n].seg.ipa=r==="vocalized"?"w":"\u026B")}}var yn=new Set(["\u0279","w","j"]);var oe={tune:"fall",range:4,declination:2,rate:1},L={NEAR:"\u026A",SQUARE:"\u025B",FORCE:"\u0254",CURE:"\u028A"},re={id:"general-american",name:"General American",region:"North America",rhotic:!0,sets:{...L},t:"flap",l:"dark-coda",th:"fricative",r:"approximant"},Pe={id:"southern-british",name:"Southern British",region:"England",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}},xe={id:"london",name:"London",region:"England",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}},ve={id:"australian",name:"Australian",region:"Southern hemisphere",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}},Fe={id:"new-zealand",name:"New Zealand",region:"Southern hemisphere",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}},De={id:"irish",name:"Irish",region:"Scotland, Wales and Ireland",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",region:"Scotland, Wales and Ireland",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}},Be={id:"southern-us",name:"Southern US",region:"North America",rhotic:!0,sets:{...L,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}},Ge={id:"canadian",name:"Canadian",region:"North America",rhotic:!0,sets:{...L,TRAP:"a",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",THOUGHT:"\u0252",PALM:"\u0252",FACE:"e\u026A",GOAT:"o\u028A"},raised:{PRICE:"\u028C\u026A",MOUTH:"\u028C\u028A"},hold:.6,t:"flap",l:"dark-coda",th:"fricative",r:"approximant",prosody:{tune:"fall",range:4,declination:2,rate:1}},Ye={id:"californian",name:"Californian",region:"North America",rhotic:!0,sets:{...L,KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0251",CLOTH:"\u0251",THOUGHT:"\u0251",FOOT:"\u0275",GOOSE:"\u0289",GOAT:"\u0275\u028A",FACE:"e\u026A"},hold:.55,t:"flap",l:"dark-coda",th:"fricative",r:"approximant",prosody:{tune:"fall",range:4.5,declination:2,rate:1.05}},_e={id:"new-york",name:"New York",region:"North America",rhotic:!1,sets:{TRAP:"\xE6",BATH:"e\u0259",LOT:"\u0251",PALM:"\u0251",CLOTH:"o\u0259",THOUGHT:"o\u0259",NORTH:"o\u0259",FORCE:"o\u0259",START:"\u0251",NURSE:"\u025C",PRICE:"\u0251\u026A",MOUTH:"\xE6\u028A",GOAT:"o\u028A",NEAR:"\u026A\u0259",SQUARE:"e\u0259",CURE:"\u028A\u0259",lettER:"\u0259"},hold:.55,t:"flap",l:"dark-coda",th:"fricative",r:"approximant",prosody:{tune:"fall",range:5,declination:2,rate:1.1}},ke={id:"northern-english",name:"Northern English",region:"England",rhotic:!1,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u028A",FOOT:"\u028A",NURSE:"\u025C",FLEECE:"i",FACE:"e",PALM:"\u0251",THOUGHT:"o",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"\u026A\u0259",SQUARE:"\u025B",START:"a",NORTH:"o",FORCE:"o",CURE:"\u028A\u0259",happY:"\u026A",lettER:"\u0259",commA:"\u0259"},hold:.6,t:"glottal-coda",l:"dark-coda",th:"fricative",r:"approximant",hDrop:!0,prosody:{tune:"fall",range:4,declination:2,rate:1}},We={id:"geordie",name:"Geordie (Tyneside)",region:"England",rhotic:!1,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u028A",FOOT:"\u028A",NURSE:"\xF8",FLEECE:"i",FACE:"e\u0259",PALM:"\u0251",THOUGHT:"\u0252",GOAT:"\u0275",GOOSE:"\u0289",PRICE:"\u025B\u026A",CHOICE:"\u0254\u026A",MOUTH:"u",NEAR:"i\u0259",SQUARE:"\u025B",START:"\u0251",NORTH:"\u0252",FORCE:"\u0252",CURE:"\u0289\u0259",happY:"i",lettER:"\u0250",commA:"\u0250"},hold:.55,t:"glottal-coda",l:"clear",th:"fricative",r:"approximant",prosody:{tune:"rise",range:5,declination:1.5,rate:1.05}},Ve={id:"welsh",name:"Welsh",region:"Scotland, Wales and Ireland",rhotic:!1,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u0259",FOOT:"\u028A",NURSE:"\xF8",FLEECE:"i",FACE:"e",PALM:"a",THOUGHT:"o",GOAT:"o",GOOSE:"\u0289",PRICE:"\u0259\u026A",CHOICE:"\u0254\u026A",MOUTH:"\u0259\u028A",NEAR:"\u026A\u0259",SQUARE:"\u025B",START:"a",NORTH:"o",FORCE:"o",CURE:"\u028A\u0259",happY:"i",lettER:"\u0259",commA:"a"},hold:.55,t:"released",l:"clear",th:"fricative",r:"tap",prosody:{tune:"rise",range:6,declination:1,rate:1,stressRatio:1.5}},ze={id:"northern-irish",name:"Northern Irish (Belfast)",region:"Scotland, Wales and Ireland",rhotic:!0,sets:{KIT:"\u0258",DRESS:"\u025B",TRAP:"\u0251",BATH:"\u0251",LOT:"\u0254",CLOTH:"\u0254",STRUT:"\u0250",FOOT:"\u0289",FLEECE:"i",FACE:"e\u0259",PALM:"\u0251",THOUGHT:"\u0254",GOAT:"o",GOOSE:"\u0289",PRICE:"\u025B\u026A",CHOICE:"\u0254\u026A",MOUTH:"\u0258\u0289",NEAR:"i",SQUARE:"e",START:"\u0251",NORTH:"\u0254",FORCE:"o",CURE:"\u0289",happY:"e"},hold:.5,t:"flap",l:"clear",th:"fricative",r:"approximant",prosody:{tune:"rise",range:5,declination:1.5,rate:1.05}},je={id:"south-african",name:"South African",region:"Southern hemisphere",rhotic:!1,sets:{KIT:"\u026A",DRESS:"e",TRAP:"\u025B",BATH:"\u0251",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u0250",FOOT:"\u028A",NURSE:"\xF8",FLEECE:"i",FACE:"e\u026A",PALM:"\u0251",THOUGHT:"o",GOAT:"\u0153\u028A",GOOSE:"\u0289",PRICE:"\u0251\u026A",CHOICE:"\u0254\u026A",MOUTH:"\xE6\u028A",NEAR:"\u026A\u0259",SQUARE:"e",START:"\u0251",NORTH:"o",FORCE:"o",CURE:"\u028A\u0259",happY:"i",lettER:"\u0259",commA:"\u0259"},hold:.55,t:"released",l:"clear",th:"fricative",r:"approximant",prosody:{tune:"fall",range:4,declination:2,rate:1}},Ke={id:"nigerian",name:"Nigerian",region:"Africa",rhotic:!1,sets:{KIT:"i",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0254",CLOTH:"\u0254",STRUT:"\u0254",FOOT:"u",NURSE:"\u025B",FLEECE:"i",FACE:"e",PALM:"a",THOUGHT:"\u0254",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"ia",SQUARE:"\u025B",START:"a",NORTH:"\u0254",FORCE:"\u0254",CURE:"ua",happY:"i",lettER:"a",commA:"a"},hold:.5,t:"released",l:"clear",th:"stop",r:"tap",prosody:{tune:"fall",range:4,declination:1.5,rate:1,stressRatio:1.1}},$e={id:"jamaican",name:"Jamaican",region:"Caribbean",rhotic:!1,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"a",CLOTH:"a",STRUT:"\u0254",FOOT:"\u028A",NURSE:"\u0254",FLEECE:"i",FACE:"ie",PALM:"a",THOUGHT:"a",GOAT:"uo",GOOSE:"u",PRICE:"a\u026A",CHOICE:"a\u026A",MOUTH:"\u0254\u028A",NEAR:"i\u025B",SQUARE:"i\u025B",START:"a",NORTH:"a",FORCE:"uo",CURE:"uo",happY:"i",lettER:"a",commA:"a"},hold:.45,t:"released",l:"clear",th:"stop",r:"approximant",hDrop:!0,prosody:{tune:"fall",range:6,declination:1.5,rate:1.05,stressRatio:1.3}},Ze={id:"indian",name:"Indian",region:"Asia",rhotic:!0,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"\xE6",BATH:"\u0251",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u0259",FOOT:"\u028A",NURSE:"\u0259\u027E",FLEECE:"i",FACE:"e",PALM:"\u0251",THOUGHT:"\u0254",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"i\u0259",SQUARE:"e",START:"\u0251",NORTH:"\u0254",FORCE:"o",CURE:"u\u0259",happY:"i",lettER:"\u0259\u027E",commA:"\u0259"},hold:.5,t:"released",l:"clear",th:"stop",r:"tap",prosody:{tune:"fall",range:5,declination:1.5,rate:1.05,stressRatio:1.25}},Qe={id:"singaporean",name:"Singaporean",region:"Asia",rhotic:!1,sets:{KIT:"i",DRESS:"\u025B",TRAP:"\u025B",BATH:"\u0251",LOT:"\u0254",CLOTH:"\u0254",STRUT:"\u0250",FOOT:"u",NURSE:"\u0259",FLEECE:"i",FACE:"e",PALM:"\u0251",THOUGHT:"\u0254",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"\u026A\u0259",SQUARE:"\u025B",START:"\u0251",NORTH:"\u0254",FORCE:"\u0254",CURE:"\u028A\u0259",happY:"i",lettER:"\u0259",commA:"\u0259"},hold:.5,t:"glottal-coda",l:"clear",th:"stop",r:"approximant",prosody:{tune:"fall",range:3,declination:1,rate:1.1,stressRatio:1}},qe={id:"received-pronunciation",name:"Received Pronunciation (traditional)",region:"England",rhotic:!1,sets:{KIT:"\u026A",DRESS:"e",TRAP:"\xE6",LOT:"\u0252",STRUT:"\u028C",FOOT:"\u028A",BATH:"\u0251\u02D0",CLOTH:"\u0252",NURSE:"\u025C\u02D0",FLEECE:"i\u02D0",FACE:"e\u026A",PALM:"\u0251\u02D0",THOUGHT:"\u0254\u02D0",GOAT:"\u0259\u028A",GOOSE:"u\u02D0",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"\u026A\u0259",SQUARE:"\u025B\u0259",START:"\u0251\u02D0",NORTH:"\u0254\u02D0",FORCE:"\u0254\u02D0",CURE:"\u028A\u0259",happY:"\u026A",lettER:"\u0259",commA:"\u0259"},hold:.6,t:"released",l:"dark-coda",th:"fricative",r:"approximant",prosody:{tune:"fall",range:7,declination:3,rate:.95}},Xe={id:"scouse",name:"Scouse (Liverpool)",region:"England",rhotic:!1,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u028A",FOOT:"\u028A",NURSE:"\u025B\u02D0",FLEECE:"i\u02D0",FACE:"\u025B\u026A",PALM:"\u0251",THOUGHT:"\u0254",GOAT:"\u0259\u0289",GOOSE:"\u0289",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"i\u0259",SQUARE:"\u025B\u02D0",START:"\u0251",NORTH:"\u0254",FORCE:"\u0254",CURE:"\u0289\u0259",happY:"i",lettER:"\u0259",commA:"\u0259"},hold:.5,t:"released",l:"clear",th:"fricative",r:"tap",prosody:{tune:"rise",range:5,declination:1.5,rate:1.1}},Je={id:"brummie",name:"Brummie (Birmingham)",region:"England",rhotic:!1,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u028A",FOOT:"\u028A",NURSE:"\u025C",FLEECE:"\u0259i",FACE:"\u028C\u026A",PALM:"\u0251",THOUGHT:"\u0254",GOAT:"\u028C\u028A",GOOSE:"\u0259\u0289",PRICE:"\u0254\u026A",CHOICE:"o\u026A",MOUTH:"\xE6\u028A",NEAR:"i\u0259",SQUARE:"\u025B",START:"\u0251",NORTH:"\u0254",FORCE:"\u0254",CURE:"\u0289\u0259",happY:"i",lettER:"\u0259",commA:"\u0259"},hold:.5,t:"glottal-coda",l:"dark-coda",th:"fricative",r:"approximant",hDrop:!0,prosody:{tune:"fall",range:2.5,declination:1,rate:1}},et={id:"west-country",name:"West Country",region:"England",rhotic:!0,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u0250",FOOT:"\u028A",FLEECE:"i",FACE:"e",PALM:"a",THOUGHT:"\u0252",GOAT:"o",GOOSE:"\u0289",PRICE:"\u0250\u026A",CHOICE:"\u0254\u026A",MOUTH:"\u0250\u028A",NEAR:"i",SQUARE:"\u025B",START:"a",NORTH:"\u0252",FORCE:"o",CURE:"\u0289",happY:"i"},hold:.55,t:"glottal-coda",l:"dark",th:"fricative",r:"approximant",prosody:{tune:"fall",range:4.5,declination:2,rate:.95}},tt={id:"boston",name:"Boston",region:"North America",rhotic:!1,sets:{TRAP:"\xE6",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",THOUGHT:"\u0252",PALM:"a",START:"a",NURSE:"\u025C",NEAR:"\u026A\u0259",SQUARE:"\u025B\u0259",NORTH:"\u0254\u0259",FORCE:"\u0254\u0259",CURE:"\u028A\u0259",lettER:"\u0259",MOUTH:"a\u028A"},raised:{PRICE:"\u028C\u026A"},hold:.6,t:"flap",l:"dark-coda",th:"fricative",r:"approximant",prosody:{tune:"fall",range:4.5,declination:2,rate:1.1}},nt={id:"inland-north",name:"Inland North (Chicago, Detroit)",region:"North America",rhotic:!0,sets:{...L,TRAP:"e\u0259",BATH:"e\u0259",LOT:"a",PALM:"a",THOUGHT:"\u0251",CLOTH:"\u0251",DRESS:"\u025C",STRUT:"\u0254",KIT:"\u0258"},hold:.65,t:"flap",l:"dark-coda",th:"fricative",r:"approximant",prosody:{tune:"fall",range:4,declination:2,rate:1.05}},ot={id:"filipino",name:"Filipino",region:"Asia",rhotic:!0,sets:{KIT:"i",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0254",CLOTH:"\u0254",STRUT:"a",FOOT:"u",NURSE:"\u025B\u027E",FLEECE:"i",FACE:"e",PALM:"a",THOUGHT:"\u0254",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"i\u027E",SQUARE:"\u025B\u027E",START:"a\u027E",NORTH:"\u0254\u027E",FORCE:"o\u027E",CURE:"u\u027E",happY:"i",lettER:"\u025B\u027E",commA:"a"},hold:.5,t:"released",l:"clear",th:"stop",r:"tap",prosody:{tune:"fall",range:4.5,declination:1.5,rate:1.05,stressRatio:1.15}},rt={id:"ghanaian",name:"Ghanaian",region:"Africa",rhotic:!1,sets:{KIT:"i",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0254",CLOTH:"\u0254",STRUT:"a",FOOT:"u",NURSE:"\u025B",FLEECE:"i",FACE:"e",PALM:"a",THOUGHT:"\u0254",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"ia",SQUARE:"\u025B",START:"a",NORTH:"\u0254",FORCE:"\u0254",CURE:"ua",happY:"i",lettER:"a",commA:"a"},hold:.5,t:"released",l:"clear",th:"stop",r:"approximant",prosody:{tune:"fall",range:5,declination:1.5,rate:1,stressRatio:1.1}},at={id:"kenyan",name:"Kenyan",region:"Africa",rhotic:!1,sets:{KIT:"i",DRESS:"e",TRAP:"a",BATH:"a",LOT:"\u0254",CLOTH:"\u0254",STRUT:"a",FOOT:"u",NURSE:"e",FLEECE:"i",FACE:"e",PALM:"a",THOUGHT:"\u0254",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"ia",SQUARE:"ea",START:"a",NORTH:"\u0254",FORCE:"\u0254",CURE:"ua",happY:"i",lettER:"a",commA:"a"},hold:.5,t:"released",l:"clear",th:"fricative",r:"tap",prosody:{tune:"fall",range:4,declination:1.5,rate:1,stressRatio:1.15}},it={id:"trinidadian",name:"Trinidadian",region:"Caribbean",rhotic:!1,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u0254",FOOT:"\u028A",NURSE:"\u025C",FLEECE:"i",FACE:"e",PALM:"a",THOUGHT:"\u0252",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0252\u026A",MOUTH:"\u0254\u028A",NEAR:"i\u025B",SQUARE:"\u025B",START:"a",NORTH:"\u0252",FORCE:"o",CURE:"\u028A\u0259",happY:"i",lettER:"a",commA:"a"},hold:.5,t:"released",l:"clear",th:"stop",r:"approximant",prosody:{tune:"rise",range:7,declination:1.5,rate:1.1,stressRatio:1.3}},st={id:"russian",name:"Russian",region:"Europe",rhotic:!0,sets:{KIT:"i",DRESS:"\u025B",TRAP:"\u025B",BATH:"a",LOT:"\u0254",CLOTH:"\u0254",STRUT:"a",FOOT:"u",NURSE:"\u0275\u027E",FLEECE:"i",FACE:"ei",PALM:"a",THOUGHT:"\u0254",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"i",SQUARE:"\u025B",START:"a",NORTH:"\u0254",FORCE:"\u0254",CURE:"u",happY:"i",lettER:"\u025B\u027E",commA:"a"},hold:.5,t:"released",l:"dark",th:"sibilant",r:"tap",replace:{w:"v"},devoiceFinal:!0,prosody:{tune:"fall",range:6,declination:2.5,rate:.95,stressRatio:1.7}},In=["North America","England","Scotland, Wales and Ireland","Southern hemisphere","Africa","Caribbean","Asia","Europe"],ne=Object.freeze(Object.fromEntries([re,Ge,Ye,_e,tt,nt,Be,qe,Pe,xe,et,Je,Xe,ke,We,Me,Ve,De,ze,ve,Fe,je,Ke,rt,at,$e,it,Ze,Qe,ot,st].map(e=>[e.id,e])));function ae(e){if(e===void 0)return re;if(typeof e!="string")return e;let t=ne[e];if(!t)throw new Error(`unknown accent "${e}"; built in: ${Object.keys(ne).join(", ")}`);return t}var wn=/[ːˑ:]/g;function Ln(e){let t=Array.from(e.replace(wn,"")),r,n=t[t.length-1];(n==="\u0279"||n==="\u027E"||n==="r")&&(r=n==="r"?"\u0279":n,t.pop());let o=t.filter(a=>f(a));if(o.length===0||o.length>2||o.length!==t.length)throw new Error(`accent realization "${e}" is not one or two vowels and an optional r`);return{vowels:o,r}}var lt=new Set(["\u0279","\u027E","r"]);function ie(e,t,r){for(let n=0;n<e.length;n++){let o=e[n];if(!t(o)||o.melisma)continue;let a=e[n+1],i=!o.phraseEnd&&a!==void 0&&t(a)&&!a.melisma&&a.onset.length===0,s=o.coda[0]??(!o.wordEnd&&a!==void 0?a.onset[0]:void 0),l=s!==void 0&&Un.has(s.ipa);Pn(o,r,i,l),Fn(o,r,n===0||e[n-1].wordEnd)}}var Un=new Set(["p","t","k","f","\u03B8","s","\u0283","t\u0283","h"]);function Pn(e,t,r,n){let o=e.nucleus,a=o.set,s=(a!==void 0&&n?t.raised?.[a]:void 0)??(a===void 0?void 0:t.sets[a]),l=o.ipa==="\u025D"||o.ipa==="\u025A";if(s!==void 0){let c=Ln(s);if(o.ipa=c.vowels.join(""),c.r!==void 0){let u=t.r==="tap"?"\u027E":c.r;e.coda.length>0&&lt.has(e.coda[0].ipa)?e.coda[0].ipa=u:e.coda.unshift({ipa:u})}else l&&!t.rhotic&&r&&e.coda.unshift({ipa:"\u0279"})}if(t.rhotic||xn(e,r),Array.from(o.ipa).length===2&&a!==void 0){let c=t.holds?.[a]??t.hold;c!==void 0&&(o.hold=Math.max(0,Math.min(1,c)))}}function xn(e,t){for(let r=e.coda.length-1;r>=0;r--)!lt.has(e.coda[r].ipa)||r===e.coda.length-1&&t||e.coda.splice(r,1)}var vn={b:"p",d:"t",g:"k",v:"f",z:"s",\u00F0:"\u03B8",\u0292:"\u0283",d\u0292:"t\u0283"};function Fn(e,t,r){let n=[e.onset,e.coda];for(let o of n)for(let a=0;a<o.length;a++){let i=o[a],s=r&&o===e.onset&&a===0;t.th==="stop"?i.ipa==="\u03B8"?i.ipa="t":i.ipa==="\xF0"&&(i.ipa="d"):t.th==="front"?i.ipa==="\u03B8"?i.ipa="f":i.ipa==="\xF0"&&(i.ipa=s?"d":"v"):t.th==="sibilant"&&(i.ipa==="\u03B8"?i.ipa="s":i.ipa==="\xF0"&&(i.ipa="z")),t.r==="tap"&&i.ipa==="\u0279"&&(i.ipa="\u027E");let l=t.replace?.[i.ipa];l!==void 0&&(i.ipa=l)}if(t.devoiceFinal&&e.wordEnd)for(let o=e.coda.length-1;o>=0;o--){let a=vn[e.coda[o].ipa];if(a===void 0)break;e.coda[o].ipa=a}t.hDrop&&r&&e.onset.length>0&&e.onset[0].ipa==="h"&&e.onset.shift()}var N=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],Dn=["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"],se=["","thousand","million","billion","trillion","quadrillion"],Mn={one:"first",two:"second",three:"third",five:"fifth",eight:"eighth",nine:"ninth",twelve:"twelfth"};function Bn(e){let t=Math.floor(e/100),r=e%100,n=[];return t>0&&n.push(N[t],"hundred"),(r>0||t===0)&&n.push(r<20?N[r]:Dn[Math.floor(r/10)]+(r%10?" "+N[r%10]:"")),n.join(" ")}function A(e){if(!Number.isFinite(e))return"";if(e<0)return"minus "+A(-e);if(e=Math.floor(e),e===0)return"zero";if(e>Number.MAX_SAFE_INTEGER)return ce(String(e));let t=[];for(let r=0;e>0&&r<se.length;r++){let n=e%1e3;n>0&&t.unshift(Bn(n)+(se[r]?" "+se[r]:"")),e=Math.floor(e/1e3)}return t.join(" ")}function dt(e){let t=A(e),r=/([a-z]+)$/.exec(t);if(!r)return t;let n=r[1],o=Mn[n]??(n.endsWith("y")?n.slice(0,-1)+"ieth":n+"th");return t.slice(0,t.length-n.length)+o}function le(e){if(!Number.isInteger(e)||e<1e3||e>9999||e>=2e3&&e<=2009)return A(e);let t=Math.floor(e/100),r=e%100;return r===0?A(t)+" hundred":A(t)+" "+(r<10?"oh "+N[r]:A(r))}var Gn={a:"e\u026A",b:"bi",c:"si",d:"di",e:"i",f:"\u025Bf",g:"d\u0292i",h:"e\u026At\u0283",i:"a\u026A",j:"d\u0292e\u026A",k:"ke\u026A",l:"\u025Bl",m:"\u025Bm",n:"\u025Bn",o:"o\u028A",p:"pi",q:"kju",r:"\u0251\u0279",s:"\u025Bs",t:"ti",u:"ju",v:"vi",w:"d\u028C.b\u0259l.ju",x:"\u025Bks",y:"wa\u026A",z:"zi"},Yn=new Set(["USA","UK","EU","AI","ID","IOU","CEO","UFO","DIY","FAQ","ATM","URL","API","USB","GPU","CPU","BBQ","DJ","MC","TBA","ETA","EP","LP","OK","FBI","CIA","IRS","ICU","IQ","IT","PE","PA","RIP","MVP","VIP","RV","BA","MA","NY","NYC","NYU","NYPD","LA","DC"]),_n=/[AEIOUY]/;function Y(e,t=""){let r=Array.from(e.toLowerCase()).map(o=>Gn[o]).filter(o=>!!o);if(r.length===0)return e;let n=r.length-1;return"/"+r.map((o,a)=>a===n?"\u02C8"+o:o).join(".")+t+"/"}var kn=String.raw`(?<![\p{L}\p{M}\p{N}])\/(?![\s/])[^/\n\r]*(?<!\s)\/`,Wn=new RegExp("("+kn+")","u");function ue(e){return e.split(Wn).map((t,r)=>r%2===1?t:Vn(t)).join("")}function Vn(e){return e.replace(/&/g," and ").replace(/(^|[\s(])[-−](?=\d)/g,"$1minus ").replace(/(?<![\p{L}.])((?:[A-Z]\.){2,})(?=[^\p{L}]|$)/gu,t=>Y(t.replace(/\./g,""))).replace(/\$(\d{1,3}(?:,\d{3})+|\d+)(?:\.(\d{2}))?\b/g,(t,r,n)=>{let o=Number(r.replace(/,/g,"")),a=`${A(o)} ${o===1?"dollar":"dollars"}`,i=n?Number(n):0,s=`${A(i)} ${i===1?"cent":"cents"}`;return i?o===0?s:`${a} and ${s}`:a}).replace(/\b(\d{1,2})(?::(\d{2}))?\s?([ap])\.?m\b\.?/gi,(t,r,n,o)=>`${ct(r,n,!0)} ${Y(o.toUpperCase()+"M")}`).replace(/\b(\d{1,2}):(\d{2})\b/g,(t,r,n)=>ct(r,n,!1)).replace(/\b(\d+)(st|nd|rd|th)\b/gi,(t,r)=>dt(Number(r))).replace(/'?\b(\d{2}|\d{4})'?s\b/g,(t,r)=>zn(r.length===4?le(Number(r)):A(Number(r)))).replace(/\b(\d{1,3}(?:,\d{3})+|\d+(?:\.\d+)?)%/g,(t,r)=>`${ut(r)} percent`).replace(/(\p{L})(?=\d)/gu,"$1 ").replace(/(\d)(?=\p{L})/gu,"$1 ").replace(/\b\d{1,3}(?:,\d{3})+\b|\b\d+\.\d+\b|\b\d+\b/g,t=>/^\d{4}$/.test(t)&&Number(t)>=1100&&Number(t)<=2099?le(Number(t)):ut(t)).replace(/\b([A-Z]{2,6})('?s)?\b/g,(t,r,n)=>!_n.test(r)||Yn.has(r)?Y(r,n?"z":""):t)}function ct(e,t,r){let n=t===void 0?0:Number(t);return`${A(Number(e))}${n===0?r?"":" o'clock":" "+(n<10?"oh "+N[n]:A(n))}`}function zn(e){return e.endsWith("y")?e.slice(0,-1)+"ies":e+"s"}function ce(e){return Array.from(e.replace(/\D/g,""),t=>N[Number(t)]).join(" ")}function ut(e){let t=e.replace(/,/g,""),[r,n]=t.split("."),o=r.length>1&&r.startsWith("0")&&!e.includes(",")||r.length>15?ce(r):A(Number(r));return n?`${o} point ${ce(n)}`:o}var _=/\s/,jn=/[\p{L}\p{M}\p{N}]/u;function Kn(e){return e==="."||e===","||e===";"||e===":"||e==="!"||e==="?"||e===`
4
+ `}function ht(e,t){let r=Array.from(e.normalize("NFC").replace(/’/g,"'")),n=[],o=0;for(;o<r.length;){let a=r[o],i=t.find(s=>s.starts(a));if(i){let s=i.continues(a)?Zn(r,o,i):Qn(r,o,i);if(s>o){$n(n,i.word(r.slice(o,s).join(""))),o=s;continue}}if(Kn(a))n.length>0&&(n[n.length-1].phraseEnd=!0);else if(qn(r,o)){let s=n[n.length-1];s&&n.push({text:"~",onset:[],nucleus:{...s.nucleus},coda:[],melisma:!0,wordEnd:s.wordEnd,phraseEnd:!1})}o++}return n}function de(e,t={}){t.numbers!==!1&&(e=ue(e));let r=ee({dictionary:t.dictionary,reduce:t.reduce}),n=new WeakSet,o={starts:r.starts,continues:r.continues,word:l=>{let c=r.word(l);for(let u of c)n.add(u);return c}},a=ht(e,[o,te]),i=ae(t.accent),s=l=>n.has(l);return ie(a,s,i),t.allophones!==!1&&Ue(a,s,{t:i.t,l:i.l}),a}function $n(e,t){if(t.length!==0){t[t.length-1].wordEnd=!0;for(let r of t)e.push(r)}}function Zn(e,t,r){let n=t+1;for(;n<e.length&&r.continues(e[n]);)n++;return n}function Qn(e,t,r){let n=e[t];if(t>0&&jn.test(e[t-1])||t+1>=e.length||e[t+1]===n||_.test(e[t+1]))return t;let o=t+1;for(;o<e.length&&e[o]!==n&&r.continues(e[o]);)o++;return o>=e.length||e[o]!==n||_.test(e[o-1])?t:o+1}function qn(e,t){let r=e[t];if(r!=="-"&&r!=="~")return!1;let n=t===0||_.test(e[t-1]),o=t+1===e.length||_.test(e[t+1]);return n&&o}var Xn=/^(\S+)\s+(.+)$/,Jn=/\(\d+\)$/;function eo(e){let t=new Map;for(let r of e.split(`
5
+ `)){let n=r.trim();if(n===""||n.startsWith(";;;"))continue;let o=Xn.exec(n);if(!o)continue;let a=o[1];if(Jn.test(a))continue;let i=o[2].indexOf("#"),s=(i<0?o[2]:o[2].slice(0,i)).trim().split(/\s+/).join(" ");if(s==="")continue;let l=a.toLowerCase();t.has(l)||t.set(l,s)}return t}import{clamp as W}from"bellowsjs";var to=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}),no=.07,Et=.8;var pt=new Map(Object.entries(to)),oo=new Map([["\u0261","g"],["\u02A3","dz"],["\u02A4","d\u0292"],["\u02A5","d\u0291"],["\u02A6","ts"],["\u02A7","t\u0283"],["\u02A8","t\u0255"]]),ro=/[ʰ-˿̀-ͯ]/g;function ft(e){let t=pt.get(e);if(t!==void 0)return t;let r=oo.get(e);return r===void 0?void 0:pt.get(r)}function C(e){return ft(e)??ft(e.replace(ro,""))??no}var ao=.05,io=.012,so=.02,lo=.12,co=.3,uo=.8,ho=.001,po=.8,fo=4,Eo=86400,go=10,mo=new Map([["a\u026A",["a","\u026A"]],["a\u028A",["a","\u028A"]],["e\u026A",["e","i"]],["o\u028A",["o","u"]],["\u0254\u026A",["\u0254","\u026A"]]]);function To(e){let t=mo.get(e);if(t!==void 0||e.length!==2)return t;let r=e[0],n=e[1];return f(r)&&f(n)?[r,n]:void 0}var Ao={text:"ah",onset:[],nucleus:{ipa:"\u0251",stress:1},coda:[],wordEnd:!0,phraseEnd:!1};function So(e,t,r={}){let n=W(r.consonantScale??Et,0,fo),o=Ro(e,t),a=o.length;if(a===0)return{phrases:[],leadIn:0};let i=new Array(a);for(let h=0;h<a;h++){let p=o[h];i[h]=h===a-1||p.syl.phraseEnd||o[h+1].time-(p.time+p.len)>ho}let s=new Array(a),l=new Array(a),c=0;for(let h=0;h<a;h++){h>0&&i[h-1]&&(c=h),s[h]=o[h].syl.melisma===!0?[]:gt(o[h].syl.onset,n);let p=!i[h]&&o[h+1].syl.melisma===!0;l[h]=p?[]:gt(Ho(o,h,c).coda,n)}let u=new Array(a);for(let h=0;h<a;h++){let p=o[h];if(i[h])if(h+1<a){let g=o[h+1].time,O=g-p.time,S=Math.min(p.len,O),R=p.syl.phraseEnd?Math.min(lo,co*S):0;k(l[h].concat(s[h+1]),O-R),k(l[h],S),u[h]=Math.max(p.time,Math.min(p.time+S,g-U(s[h+1])-R))}else k(l[h],p.len),u[h]=p.time+p.len;else{let g=o[h+1].time;k(l[h].concat(s[h+1]),g-p.time),u[h]=Math.max(p.time,g-U(s[h+1]))}}let d=[],E=0;for(let h=0;h<a;){let p=h;for(;!i[p];)p++;let g=Oo(o,s,l,u,h,p);g!==void 0&&(d.push(g),E=Math.max(E,o[h].time-g.start)),h=p+1}return{phrases:d,leadIn:E}}function Ro(e,t){let r=[];for(let o of e)Number.isFinite(o.time)&&Number.isFinite(o.hz)&&o.hz>0&&r.push(o);r.sort((o,a)=>o.time-a.time);let n=t.length>0?t:[Ao];return r.map((o,a)=>({time:o.time,len:W(o.dur,0,Eo),hz:o.hz,vel:W(o.vel??po,0,1),syl:n[a%n.length]}))}function Ho(e,t,r){let n=t;for(;n>r&&e[n].syl.melisma===!0;)n--;return e[n].syl}function gt(e,t){let r=[];for(let n of e){let o=n.dur,a=typeof o=="number"&&Number.isFinite(o)?W(o,0,go):C(n.ipa)*t;r.push({ipa:n.ipa,dur:a})}return r}function U(e){let t=0;for(let r of e)t+=r.dur;return t}function k(e,t){let r=U(e),n=t-ao;if(r<=n||r<=0)return;let o=Math.max(0,n)/r,a=0;for(let s of e)s.dur=Math.max(Math.min(s.dur,io),s.dur*o),a+=s.dur;let i=a+so;if(i>t){let s=Math.max(0,t)/i;for(let l of e)l.dur*=s}}function Oo(e,t,r,n,o,a){let i=[],s=e[o].time,l=s-U(t[o]),c=[{time:l,hz:e[o].hz}];he(i,t[o],l,s,"onset");for(let u=o;u<=a;u++){let d=e[u],E=n[u],h=Math.max(d.time,E-U(r[u])),p=u===a||e[u+1].syl.melisma!==!0,g=u>o&&d.syl.melisma===!0;bo(i,d.syl.nucleus,d.time,h,p,g),he(i,r[u],h,E,"coda"),u<a&&(c.push({time:E,hz:e[u+1].hz}),he(i,t[u+1],E,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:c}}function he(e,t,r,n,o){let a=r;for(let i=0;i<t.length;i++){let s=i===t.length-1?n:Math.min(n,a+t[i].dur);s>a&&e.push({ipa:t[i].ipa,start:a,end:s,kind:o}),a=s}}function bo(e,t,r,n,o,a){let i=t.ipa,s=To(i);if(s!==void 0&&o){let l=r+(t.hold??uo)*(n-r);pe(e,s[0],r,l,a),pe(e,s[1],l,n,!1)}else pe(e,s===void 0?i:s[0],r,n,a)}function pe(e,t,r,n,o){if(!(n>r))return;let a=e[e.length-1],i=a!==void 0&&a.kind==="nucleus"&&a.ipa===t;if(o&&i&&a.end===r){a.end=n;return}e.push({ipa:t,start:r,end:n,kind:"nucleus"})}function Tt(e,t={}){let r=de(e,t),n=[],o=[],a=[];for(let i of r){if(o.push(i),!i.wordEnd)continue;let s=mt(o);n.push(s),a.push(s.ipa,i.phraseEnd?" | ":" "),o=[]}if(o.length>0){let i=mt(o);n.push(i),a.push(i.ipa)}return{words:n,ipa:a.join("").replace(/ \| $/,"").trim(),syllables:r}}function No(e,t={}){return Tt(e,t).ipa}function mt(e){let t=e.filter(n=>!n.melisma).length>1,r=e.filter(n=>!n.melisma).map(n=>{let o=t&&n.nucleus.stress===1?"\u02C8":t&&n.nucleus.stress===2?"\u02CC":"",a=[...n.onset,n.nucleus,...n.coda].map(i=>i.ipa).join("");return o+a}).join(".");return{text:e.map(n=>n.text).join("-"),ipa:r,syllables:e,sets:e.map(n=>n.nucleus.set)}}var Ot=.18,bt=.09,At=Ot+bt,V=2,Co=1.5,St={i:155,\u026A:135,e:190,e\u026A:190,\u025B:150,\u00E6:230,a:230,\u0251:240,\u0252:240,\u0254:240,o:220,o\u028A:220,\u028A:160,u:210,\u028C:140,\u0259:120,\u025A:180,\u025D:180,a\u026A:250,a\u028A:240,\u0254\u026A:280,\u0268:110},Rt=180,yo={KIT:"\u026A",DRESS:"\u025B",TRAP:"\xE6",LOT:"\u0251",STRUT:"\u028C",FOOT:"\u028A",BATH:"\xE6",CLOTH:"\u0254",NURSE:"\u025D",FLEECE:"i",FACE:"e\u026A",PALM:"\u0251",THOUGHT:"\u0254",GOAT:"o\u028A",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"\u026A",SQUARE:"\u025B",START:"\u0251",NORTH:"\u0254",FORCE:"\u0254",CURE:"\u028A",happY:"i",lettER:"\u025A",commA:"\u0259"},Io=.5,wo=new Set(["v","\xF0","z","\u0292"]),Lo=new Set(["b","d","g","d\u0292"]),Uo=new Set(["p","t","k","t\u0283","\u0294"]),Po=new Set(["m","n","\u014B"]);function xo(e){return e===void 0?1:wo.has(e)?1.6:Lo.has(e)?1.2:Uo.has(e)?.7:Po.has(e)?.85:1}function vo(e,t,r,n){let o=e[t],a=(o.nucleus.set&&yo[o.nucleus.set])??o.nucleus.ipa,i=St[a]??St[Array.from(a)[0]]??Rt,s=Math.max(.65,Math.min(1.45,i/Rt)),l=1,c=t;for(;c>0&&!e[c-1].wordEnd;)c--;let u=t;for(;u<e.length-1&&!e[u].wordEnd;)u++;u>c&&(l*=.8),!o.wordEnd&&t<u&&(l*=.85);let d=o.coda[0]?.ipa??(t<u?e[t+1].onset[0]?.ipa:void 0),E=xo(d);return l*=r?E:.7+.3*E,s*Math.max(Io,1+(l-1)*n)}var Fo=.28,Do=.32,Ht=.05;function Mo(e,t={},r=[]){let n=t.prosody??oe,o=t.hz!==void 0&&t.hz>0?t.hz:110,a=Math.max(.1,(t.rate??1)*n.rate),i=Math.max(.5,n.stressRatio??V),s=i===V?bt:At/(1+i),l=i===V?Ot:At*i/(1+i),c=.5+.5*Math.max(0,Math.min(1,(i-1)/(V-1))),u=[],d=[],E=t.breath??"between",h=Do/Math.sqrt(a),p=0,g=0;for(let O=0;O<e.length;){let S=O;for(;S<e.length-1&&!e[S].phraseEnd;)S++;let R=e.slice(O,S+1);if(E==="all"||E==="between"&&g>0){let m=R[0],T=g>0?"beat:in>":"beat:in";R[0]={...m,onset:[{ipa:T,dur:h},{ipa:"_",dur:Ht},...m.onset]}}let Ut=r[g]??n.tune==="rise",{pitches:Ee,endTone:ge}=Bo(R,n,Ut);for(let m=0;m<R.length;m++){let T=R[m],b=m===R.length-1,Pt=T.nucleus.stress!==void 0&&T.nucleus.stress>0,x=T.nucleus.dur??(Pt?l:s)*vo(R,m,b,c);b&&(x*=Co);let v=0;for(let H of T.coda)v+=H.dur??C(H.ipa);if(!b)for(let H of R[m+1].onset)v+=H.dur??C(H.ipa);if(b&&ge!==void 0){let H=.45*x/a,Te=(.55*x+v)/a;d.push({...T,phraseEnd:!1,wordEnd:!1}),d.push({text:"~",onset:[],nucleus:{...T.nucleus},coda:[],melisma:!0,wordEnd:T.wordEnd,phraseEnd:T.phraseEnd}),u.push({time:p,dur:H,hz:o*2**(Ee[m]/12)}),u.push({time:p+H,dur:Te,hz:o*2**(ge/12)}),p+=H+Te;continue}let me=(x+v)/a;d.push(T),u.push({time:p,dur:me,hz:o*2**(Ee[m]/12)}),p+=me}if(S<e.length-1){let m=0;for(let b of e[S+1].onset)m+=b.dur??C(b.ipa);E!=="none"&&(m+=h+Ht);let T=Fo/a+m;u.push({time:p,dur:T,hz:0,rest:!0}),p+=T}g++,O=S+1}return{syllables:d,notes:u}}function Bo(e,t,r){let n=e.length,o=-1;for(let i=n-1;i>=0;i--){let s=e[i].nucleus.stress;if(s!==void 0&&s>0){o=i;break}}o<0&&(o=n-1);let a=[];for(let i=0;i<n;i++){let s=n>1?-t.declination*(i/(n-1)):0,l=e[i].nucleus.stress??0,c=s;if(i<o)l===1?c+=t.range*(i===Go(e)?1:.7):l===2&&(c+=t.range*.35);else if(i===o)c+=r?-.25*t.range:t.range;else{let u=(i-o)/(n-1-o);c+=r?t.range*(.4+.8*u):-.6*t.range*u-.2*t.range}a.push(c)}return o<n-1?{pitches:a}:{pitches:a,endTone:r?-t.declination+t.range:-t.declination-.4*t.range}}function Go(e){for(let t=0;t<e.length;t++)if(e[t].nucleus.stress===1)return t;return-1}var Nt=256;function Ct(e){let t=[];for(let r of e.split(/[\s|]+/)){if(r==="")continue;if(t.length===Nt)break;if(r==="."||r==="-"){t.push(null);continue}let n=r,o=!1;n.length>1&&n.endsWith(">")&&(o=!0,n=n.slice(0,-1));let a,i=/^(.+?):(-?\d*)$/.exec(n);i&&(n=i[1],i[2]!==""&&i[2]!=="-"&&(a=Math.max(0,Math.min(127,Number(i[2])))));let s=Ae(n);if(s<=0){t.push(null);continue}let l={id:y[s].id};a!==void 0&&(l.note=a),o&&(l.accent=!0),t.push(l)}return t}function Yo(e){let t=e.map(n=>n===null?".":`${n.id}${n.note!==void 0?`:${n.note}`:""}${n.accent?">":""}`),r=[];for(let n=0;n<t.length;n+=4)r.push(t.slice(n,n+4).join(" "));return r.join(" | ")}var _o=[{id:"boots-and-cats",name:"Boots and cats",bpm:96,swing:0,text:"B . t . | Pf . t . | B . t . | Pf . t ."},{id:"four-on-the-floor",name:"Four on the floor",bpm:122,swing:0,text:"B . t . | B . tss . | B . t . | B . tss ."},{id:"breakbeat",name:"Breakbeat",bpm:94,swing:.18,text:"B . t . | Pf . t B | . B t . | Pf . t t"},{id:"rimshot-shuffle",name:"Rimshot shuffle",bpm:88,swing:.4,text:"B . t K | . t B . | t . K t | . B K t"},{id:"inward-snare",name:"Inward snare",bpm:100,swing:0,text:"B . t . | ^K . t . | B B t . | ^K . t ."},{id:"clicks-and-pops",name:"Clicks and pops",bpm:90,swing:.25,text:"B . ! . | P! . ! . | B ! . ! | P! . ! !"},{id:"hum-bass",name:"Hum bass",bpm:92,swing:.1,text:"B m . m:43 | Pf . m:45 . | B m:40 . m | Pf . t kch"},{id:"psh-groove",name:"Psh groove",bpm:98,swing:.12,text:"B . ch . | Psh . ch B | . B ch . | Psh . ch tss"}],yt=.15;function It(e){return 60/Math.max(20,Math.min(400,Number.isFinite(e)?e:96))/4}function ko(e,t={}){let r=typeof e=="string"?Ct(e):e,n=Math.max(1,Math.min(64,Math.floor(t.repeat??1))),o=It(t.bpm??96),a=t.swing??0,i=Math.max(0,Math.min(.6,Number.isFinite(a)?a:0))*.5*o,s=[null],l=[yt],c=0;for(let d=0;d<n;d++)for(let E=0;E<r.length;E++,c++)s.push(r[E]),l.push(o+(c%2===0?i:-i));return{syllables:s.map(d=>({text:d===null?".":d.id,onset:[],nucleus:{ipa:`${Se}${d===null?".":d.id}${d?.accent?">":""}`},coda:[],wordEnd:!0,phraseEnd:!1})),durs:l,steps:s}}var Wo={bilabial:"the two lips",labiodental:"the lower lip against the upper teeth",dental:"the tongue tip against the upper teeth",alveolar:"the tongue tip against the ridge behind the upper teeth",postalveolar:"the front of the tongue just behind the ridge behind the upper teeth, lips a little rounded",palatal:"the middle of the tongue against the hard roof of the mouth",velar:"the back of the tongue against the soft palate",glottal:"the vocal folds themselves"},Vo={p:["stop","bilabial",!1,"pin"],b:["stop","bilabial",!0,"bin"],t:["stop","alveolar",!1,"tin"],d:["stop","alveolar",!0,"din"],k:["stop","velar",!1,"kin"],g:["stop","velar",!0,"go"],f:["fricative","labiodental",!1,"fan"],v:["fricative","labiodental",!0,"van"],\u03B8:["fricative","dental",!1,"thin"],\u00F0:["fricative","dental",!0,"this"],s:["fricative","alveolar",!1,"sip"],z:["fricative","alveolar",!0,"zip"],\u0283:["fricative","postalveolar",!1,"ship"],\u0292:["fricative","postalveolar",!0,"measure"],h:["fricative","glottal",!1,"hat"],t\u0283:["affricate","postalveolar",!1,"chin"],d\u0292:["affricate","postalveolar",!0,"gin"],m:["nasal","bilabial",!0,"man"],n:["nasal","alveolar",!0,"no"],\u014B:["nasal","velar",!0,"sing"],l:["lateral","alveolar",!0,"let"],\u026B:["lateral","alveolar",!0,"tell"],\u0279:["approximant","alveolar",!0,"red"],w:["approximant","bilabial",!0,"wet"],j:["approximant","palatal",!0,"yes"],\u027E:["tap","alveolar",!0,"the t in American 'water'"],\u0294:["stop","glottal",!1,"the catch in 'uh-oh'"]},P={i:[0,0,!1,"heed"],\u026A:[.7,.2,!1,"hid"],e:[1,0,!1,"hay (its start)"],\u025B:[2,0,!1,"head"],\u00E6:[2.7,0,!1,"had"],a:[3,.5,!1,"high (its start)"],\u0251:[3,2,!1,"hod, father"],\u0252:[3,2,!0,"British 'hot'"],\u0254:[2,2,!0,"hawed"],o:[1,2,!0,"hoe (its start)"],\u028A:[.7,1.8,!0,"hood"],u:[0,2,!0,"who'd"],\u028C:[2,1.5,!1,"hud"],\u025A:[1.5,1,!1,"the er in 'butter'"],\u0259:[1.5,1,!1,"the a in 'about'"],\u025D:[1.5,1,!1,"heard"],\u0250:[2.5,1,!1,"Australian 'cut'"],\u025C:[2,1,!1,"British 'nurse'"],\u0289:[0,1,!0,"Australian 'goose'"],\u0268:[0,1,!1,"Russian '\u0442\u044B'"],\u0258:[1,1,!1,"a central 'e'"],\u0275:[1,1,!0,"New Zealand 'foot'"],y:[0,0,!0,"French 'tu'"],\u00F8:[1,0,!0,"French 'peu'"],\u0153:[2,0,!0,"French 'peur'"],\u026F:[0,2,!1,"Japanese 'u'"],\u0264:[1,2,!1,"an unrounded 'o'"]};function zo(e){if(e.startsWith("beat:")){let n=e.slice(5).replace(/>$/,""),o=y.find(a=>a.id===n);return o?`${o.name}: ${o.hint.charAt(0).toLowerCase()}${o.hint.slice(1)}.`:void 0}if(e==="_")return"Silence: the breath stops.";let t=Vo[e];if(t){let[n,o,a,i]=t,s=Wo[o],l=a?"The voice buzzes through it.":"The voice is off: only air.";return`${{stop:`Made with ${s}: they close completely, air builds up behind them, then they let go with a small pop.`,fricative:o==="glottal"?"The vocal folds stay apart and air rushes between them: a breathy hiss shaped by the vowel around it.":`Made with ${s}: they come close enough that the air hisses through the gap.`,affricate:`Made with ${s}: a full closure that opens into a hiss.`,nasal:`Made with ${s} closed while the soft palate drops, so the sound comes out through the nose.`,lateral:`Made with ${s}, while air flows around both sides of the tongue.`,approximant:e==="\u0279"?"The tongue bunches or curls back without touching anything, lips a little rounded: the sound of an American r.":`Made with ${s} coming close but not near enough to hiss: a gliding sound.`,tap:`Made with ${s} in one very quick touch.`}[n]??s} ${l} ${fe(i)}`}let r=Array.from(e.replace(/[ːˑ\u032F]/g,""));if(r.length===1&&P[r[0]]){let[n,o,a,i]=P[r[0]];return`A vowel with ${Ko(n,o,a)}. The voice buzzes and the mouth's shape colours it. ${fe(i)}`}if(r.length>=2&&r.every(n=>P[n])){let n=P[r[0]],o=P[r[r.length-1]],a=jo[e];return`A gliding vowel: it starts ${wt(n[0],n[1],n[2])} and glides toward ${wt(o[0],o[1],o[2])}.${a?" "+fe(a):""}`}}var jo={e\u026A:"hay",a\u026A:"high",\u0254\u026A:"boy",a\u028A:"how",o\u028A:"hoe",\u0259\u028A:"British 'go'",\u026A\u0259:"British 'near'",e\u0259:"British 'square'",\u028A\u0259:"British 'cure'",\u025B\u026A:"Southern US 'face'",\u00E6\u028A:"Southern US 'mouth'",\u028C\u026A:"Canadian 'price'",\u028C\u028A:"Canadian 'house'"};function fe(e){return e.startsWith("the ")?`It is ${e}.`:`As in "${e}".`}function wt(e,t,r){let n=e>=2.5?"wide open":e>=1.5?"half open":e>=.5?"nearly closed":"almost closed",o=t<=.3?"the tongue forward":t>=1.7?"the tongue back":"the tongue in the middle";return`${n} with ${o}${r?" and the lips rounded":""}`}function Ko(e,t,r){let n=e>=2.5?"the jaw dropped and the mouth wide open":e>=1.5?"the mouth half open":e>=.5?"the mouth nearly closed":"the mouth almost closed",o=t<=.3?"the tongue pushed forward and high":t>=1.7?"the tongue pulled back":"the tongue relaxed in the middle";return`${n}, ${o}, ${r?"lips rounded":"lips relaxed or spread"}`}var $o=[["i","heed",[[342,2322],[437,2761],[452,3081]]],["\u026A","hid",[[427,2034],[483,2365],[511,2552]]],["e","hayed",[[476,2089],[536,2530],[564,2656]]],["\u025B","head",[[580,1799],[731,2058],[749,2267]]],["\xE6","had",[[588,1952],[669,2349],[717,2501]]],["\u0251","hod",[[768,1333],[936,1551],[1002,1688]]],["\u0254","hawed",[[652,997],[781,1136],[803,1210]]],["o","hoed",[[497,910],[555,1035],[597,1137]]],["\u028A","hood",[[469,1122],[519,1225],[568,1490]]],["u","who'd",[[378,997],[459,1105],[494,1345]]],["\u028C","hud",[[623,1200],[753,1426],[749,1546]]],["\u025D","heard",[[474,1379],[523,1588],[586,1719]]]];function Zo(e,t,r=0){let n=i=>13*Math.atan(76e-5*i)+3.5*Math.atan((i/7500)**2),o=Math.max(0,Math.min(2,Math.round(r))),a={ipa:"\u0259",word:"about",distance:1/0};for(let[i,s,l]of $o){let[c,u]=l[o],d=Math.hypot(n(e)-n(c),.5*(n(t)-n(u)));d<a.distance&&(a={ipa:i,word:s,distance:d})}return a}function Qo(e){let t=[];for(let n of j){let o=e[n.param];if(typeof o!="number"||!Number.isFinite(o))continue;let a=n.neutral??0,i=o-a,s=n.neutral===1;if(Math.abs(i)<(s?.03:.1))continue;let l=Math.abs(i)>(s?.12:.6),c=i>0?n.high:n.low,u=l?n.strong?n.strong[i>0?1:0]:c.endsWith("er")?"much "+c:c.endsWith("ing")?c+" a lot":"very "+c:c;t.push(`${n.subject} ${u}`)}if(t.length===0)return"A neutral mouth.";let r=t.join(", ");return r.charAt(0).toUpperCase()+r.slice(1)+"."}var z=[115,199,240];function qo(e){let t=Math.max(0,Math.min(2,Number.isFinite(e)?e:0)),r=Math.min(1,Math.floor(t)),n=t-r;return z[r]+n*(z[r+1]-z[r])}var Lt=[{id:"narrator-male",name:"Narrator (male)",group:"male",description:"a steady, clear speaking voice at the male conversational mean",params:{body:0,vibratoDepth:0,drift:4,roughness:.02,breath:.12,tension:.5},speechHz:115,range:[43,64]},{id:"narrator-female",name:"Narrator (female)",group:"female",description:"a steady, clear speaking voice at the female conversational mean",params:{body:1,vibratoDepth:0,drift:4,roughness:.02,breath:.2,tension:.5},speechHz:199,range:[55,76]},{id:"child",name:"Child",group:"child",description:"a child of about ten: the smallest tract, a high light voice",params:{body:2,vibratoDepth:.1,drift:6,roughness:.02,breath:.2,tension:.5},speechHz:240,range:[57,81]},{id:"bass",name:"Bass",group:"male",description:"the lowest classical voice, E2 to E4, dark and slow to move",params:{body:0,tension:.6,breath:.1,vibratoRate:5.2,vibratoDepth:.5,glide:.2,ring:.5},speechHz:98,range:[40,64]},{id:"baritone",name:"Baritone",group:"male",description:"the middle male voice, A2 to A4",params:{body:0,tension:.58,breath:.12,vibratoRate:5.5,vibratoDepth:.45,ring:.4},speechHz:110,range:[45,69]},{id:"tenor",name:"Tenor",group:"male",description:"the high male voice, C3 to C5: a slightly shorter tract, brighter and pressed",params:{body:.15,tension:.65,breath:.1,vibratoRate:5.8,vibratoDepth:.45,ring:.6,tuning:.4},speechHz:130,range:[48,72]},{id:"contralto",name:"Contralto",group:"female",description:"the lowest female voice, F3 to F5, warm and dark",params:{body:.85,tension:.55,breath:.15,vibratoRate:5.4,vibratoDepth:.45,ring:.4},speechHz:180,range:[53,77]},{id:"mezzo",name:"Mezzo-soprano",group:"female",description:"the middle female voice, A3 to A5",params:{body:.95,tension:.58,breath:.15,vibratoRate:5.6,vibratoDepth:.5,ring:.5,tuning:.5},speechHz:195,range:[57,81]},{id:"soprano",name:"Soprano",group:"female",description:"the highest classical voice, C4 to C6, with the jaw opening on high notes as trained sopranos do",params:{body:1,tension:.62,breath:.12,vibratoRate:5.8,vibratoDepth:.55,ring:.6,tuning:1,overshoot:.12},speechHz:215,range:[60,84]},{id:"pop-female",name:"Pop (female)",group:"female",description:"light, breathy and close, little vibrato and that only on long notes",params:{body:1,tension:.45,breath:.32,vibratoRate:6,vibratoDepth:.15,vibratoDelay:.45,overshoot:.06,glide:.12},speechHz:205,range:[55,76]},{id:"pop-male",name:"Pop (male)",group:"male",description:"a light male pop voice, breathier than the classical ones, little vibrato",params:{body:.1,tension:.5,breath:.25,vibratoRate:6,vibratoDepth:.12,vibratoDelay:.45,overshoot:.06,glide:.12},speechHz:120,range:[48,69]},{id:"rock",name:"Rock (gravel)",group:"male",description:"pressed and rough, with creak at the bottom of the voice",params:{body:0,tension:.8,breath:.1,roughness:.18,fry:.35,vibratoDepth:.15,overshoot:.1},speechHz:115,range:[45,69]},{id:"elder",name:"Elder",group:"male",description:"an older man: more shimmer, a wandering pitch, a slow wide wobble",params:{body:0,tension:.4,breath:.25,roughness:.15,drift:12,vibratoRate:4.6,vibratoDepth:.5,vibratoDelay:.1},speechHz:125,range:[43,62]},{id:"beatboxer",name:"Beatboxer",group:"male",description:"a male voice on a close microphone, for beatbox(): the mic hears the air of each kick and snare",params:{body:0,mic:.8,level:.9},speechHz:115,range:[40,64]}];function Xo(e){return Lt.find(t=>t.id===e)}export{Vt as a,q as b,an as c,J as d,ee as e,te as f,oe as g,re as h,Pe as i,xe as j,ve as k,Fe as l,De as m,Me as n,Be as o,Ge as p,Ye as q,_e as r,ke as s,We as t,Ve as u,ze as v,je as w,Ke as x,$e as y,Ze as z,Qe as A,qe as B,Xe as C,Je as D,et as E,tt as F,nt as G,ot as H,rt as I,at as J,it as K,st as L,In as M,ne as N,ae as O,ie as P,A as Q,dt as R,le as S,Y as T,kn as U,ue as V,ht as W,de as X,Mo as Y,Nt as Z,Ct as _,Yo as $,_o as aa,yt as ba,It as ca,ko as da,So as ea,z as fa,qo as ga,Lt as ha,Xo as ia,eo as ja,Tt as ka,No as la,zo as ma,Zo as na,Qo as oa};
6
+ //# sourceMappingURL=chunk-XR5GDH27.js.map