bellows-voice 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine.js +1 -1
- package/dist/engine.js.map +3 -3
- package/dist/engines/vocal-planner.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/dist/worklet-code.gen.d.ts.map +1 -1
- package/dist/worklet.js +1 -1
- package/package.json +1 -1
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/worklet-code.gen.ts", "../src/catalog.gen.ts", "../src/plugin.ts", "../src/singer.ts", "../src/sing.ts"],
|
|
4
|
-
"sourcesContent": ["/* Generated by scripts/gen-plugin.mjs. Do not edit by hand. */\n// prettier-ignore\nexport const workletCode: string = \"/*! 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 */\\n\\\"use strict\\\";(()=>{function Gn(r){return 440*Math.pow(2,(r-69)/12)}function z(r,t,e){return r>=t?r<=e?r:e:t}function Un(r){let t=1779033703^r.length;for(let e=0;e<r.length;e++)t=Math.imul(t^r.charCodeAt(e),3432918353),t=t<<13|t>>>19;return function(){return t=Math.imul(t^t>>>16,2246822507),t=Math.imul(t^t>>>13,3266489909),(t^=t>>>16)>>>0}}function jn(r){return function(){r|=0,r=r+1831565813|0;let t=Math.imul(r^r>>>15,1|r);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}function Mi(r){let t=jn(Un(r)()),e=(()=>t());return e.label=r,e.fork=s=>Mi(r+\\\"::\\\"+s),e.int=s=>t()*s|0,e.pick=s=>s[t()*s.length|0],e.range=(s,a)=>s+t()*(a-s),e.chance=s=>t()<s,e.shuffle=s=>{let a=s.slice();for(let i=a.length-1;i>0;i--){let n=t()*(i+1)|0,o=a[i];a[i]=a[n],a[n]=o}return a},e.gauss=()=>(t()+t()+t()+t()-2)*Math.SQRT2*.875,e.weighted=s=>{let a=0;for(let n=0;n<s.length;n++)a+=s[n];let i=t()*a;for(let n=0;n<s.length;n++)if(i-=s[n],i<=0)return n;return s.length-1},e}var gi=class r{size;periodCents;refFreq;refIndex;degreeCents;constructor(t,e,s,a){if(t.length<1)throw new Error(\\\"Tuning: needs at least one degree\\\");if(!Number.isFinite(e)||e<=0)throw new Error(\\\"Tuning: period must span a positive number of cents\\\");if(!Number.isFinite(s)||s<=0)throw new Error(\\\"Tuning: reference frequency must be positive\\\");if(!Number.isInteger(a))throw new Error(\\\"Tuning: reference index must be an integer\\\");for(let i of t)if(!Number.isFinite(i)&&!Number.isNaN(i))throw new Error(\\\"Tuning: degree cents must be finite or NaN\\\");this.degreeCents=t.slice(),this.size=t.length,this.periodCents=e,this.refFreq=s,this.refIndex=a}static edo(t,e=440,s=69){if(!Number.isInteger(t)||t<1)throw new Error(\\\"Tuning.edo: n must be a positive integer\\\");let a=new Array(t);for(let i=0;i<t;i++)a[i]=1200*i/t;return new r(a,1200,e,s)}static ji(t,e=440,s=69,a=2){if(t.length<1)throw new Error(\\\"Tuning.ji: needs at least one ratio\\\");if(!(a>1))throw new Error(\\\"Tuning.ji: period ratio must be greater than 1\\\");let i=new Array(t.length);for(let n=0;n<t.length;n++){let o=t[n];if(!Number.isFinite(o)||o<=0)throw new Error(\\\"Tuning.ji: ratios must be positive\\\");i[n]=1200*Math.log2(o)}return new r(i,1200*Math.log2(a),e,s)}static fromCents(t,e=1200,s=440,a=69){return new r(t,e,s,a)}static default12=r.edo(12);centsOf(t){if(Number.isInteger(t))return this.centsAt(t);let e=Math.floor(t),s=t-e,a=this.centsAt(e);return a+s*(this.centsAt(e+1)-a)}freqOf(t){return this.refFreq*Math.pow(2,this.centsOf(t)/1200)}midiToFreq(t){return this.freqOf(t)}transposeCents(t){if(!Number.isFinite(t))throw new Error(\\\"Tuning.transposeCents: cents must be finite\\\");return new r(this.degreeCents,this.periodCents,this.refFreq*Math.pow(2,t/1200),this.refIndex)}transposeRatio(t){if(!Number.isFinite(t)||t<=0)throw new Error(\\\"Tuning.transposeRatio: ratio must be positive\\\");return new r(this.degreeCents,this.periodCents,this.refFreq*t,this.refIndex)}transposeSteps(t){if(!Number.isInteger(t))throw new Error(\\\"Tuning.transposeSteps: steps must be an integer\\\");return new r(this.degreeCents,this.periodCents,this.refFreq,this.refIndex-t)}centsAt(t){let e=t-this.refIndex,s=Math.floor(e/this.size),a=e-s*this.size;return s*this.periodCents+this.degreeCents[a]}};var xi=1.5,Xn=Math.log(3),yi=Math.log(100),wi=1e-4,Ps=class{sampleRate;stage=0;lvl=0;sus=1;aCoef=1;dCoef=1;rCoef=1;constructor(t){this.sampleRate=t,this.set(.01,.1,.7,.2)}coef(t,e){return t>0?1-Math.exp(-e/(t*this.sampleRate)):1}set(t,e,s,a){!Number.isFinite(t)||!Number.isFinite(e)||!Number.isFinite(s)||!Number.isFinite(a)||(this.aCoef=this.coef(t,Xn),this.dCoef=this.coef(e,yi),this.rCoef=this.coef(a,yi),this.sus=z(s,0,1))}trigger(){this.stage=1}release(){this.stage!==0&&(this.stage=4)}next(){switch(this.stage){case 0:return 0;case 1:return this.lvl+=this.aCoef*(xi-this.lvl),this.lvl>=1&&(this.lvl=1,this.stage=2),this.lvl;case 2:return this.lvl+=this.dCoef*(this.sus-this.lvl),Math.abs(this.lvl-this.sus)<1e-4&&(this.lvl=this.sus,this.stage=3),this.lvl;case 3:return this.lvl=this.sus,this.lvl;case 4:return this.lvl-=this.rCoef*this.lvl,this.lvl<wi&&(this.lvl=0,this.stage=0),this.lvl}}fill(t,e,s){let a=this.lvl,i=this.stage;for(let n=e;n<s;n++)i===1?(a+=this.aCoef*(xi-a),a>=1&&(a=1,i=2)):i===2?(a+=this.dCoef*(this.sus-a),Math.abs(a-this.sus)<1e-4&&(a=this.sus,i=3)):i===3?a=this.sus:i===4?(a-=this.rCoef*a,a<wi&&(a=0,i=0)):a=0,t[n]=a;this.lvl=a,this.stage=i}get active(){return this.stage!==0}get level(){return this.lvl}reset(){this.stage=0,this.lvl=0}};var Wh=Math.PI/2;var Kh=Math.PI*2,Yn=16,Wn=64;var $h=2*Yn*Wn+1;var Kn=6;var $n=[1,.6,.5,.4,.4,.3];function Zn(){let r=[{name:\\\"ops\\\",min:2,max:6,default:4},{name:\\\"algorithm\\\",min:1,max:8,default:1},{name:\\\"feedback\\\",min:0,max:1,default:0},{name:\\\"brightness\\\",min:0,max:2,default:.5},{name:\\\"attack\\\",min:0,max:10,default:.003,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"decay\\\",min:0,max:10,default:.3,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"sustain\\\",min:0,max:1,default:.7},{name:\\\"release\\\",min:0,max:10,default:.3,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"mAttack\\\",min:0,max:10,default:.002,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"mDecay\\\",min:0,max:10,default:.4,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"mSustain\\\",min:0,max:1,default:.5},{name:\\\"mRelease\\\",min:0,max:10,default:.2,curve:\\\"exp\\\",unit:\\\"s\\\"}];for(let t=1;t<=Kn;t++)r.push({name:\\\"ratio\\\"+t,min:0,max:16,default:1}),r.push({name:\\\"level\\\"+t,min:0,max:1,default:$n[t-1]}),r.push({name:\\\"fixed\\\"+t,min:0,max:1e4,default:0,unit:\\\"Hz\\\"});return r}var Zh=Zn();var Qn=32,Qh=Math.PI*2;function Jn(){let r=[{name:\\\"morph\\\",min:0,max:1,default:0},{name:\\\"inharm\\\",min:0,max:.02,default:0},{name:\\\"decay\\\",min:.01,max:20,default:2,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"rolloff\\\",min:.3,max:1,default:.8},{name:\\\"attack\\\",min:0,max:10,default:.002,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"release\\\",min:0,max:10,default:.3,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"gain\\\",min:0,max:2,default:1}];for(let t=1;t<=Qn;t++)r.push({name:\\\"partial\\\"+t,min:0,max:1,default:1/t}),r.push({name:\\\"target\\\"+t,min:0,max:1,default:t===1?1:0}),r.push({name:\\\"detune\\\"+t,min:-100,max:100,default:0,unit:\\\"cents\\\"});return r}var Jh=Jn();var tl=Math.PI*2;var el=Math.PI*2,sl=Math.log(1e3);var al=2**30-4;var il=Math.PI*2;var nl=Math.PI*2;var tr=7;var Ve=17,rl=tr+Ve,er=new Float64Array(Ve),sr=new Float64Array(Ve),ar=new Float64Array(Ve);{let r=Mi(\\\"string-body-forest\\\");for(let t=0;t<Ve;t++){let e=800*Math.pow(10,t/(Ve-1));er[t]=e*(1+(2*r()-1)*.12),sr[t]=8+17*r(),ar[t]=(.15+.25*r())*(t%2===0?1:-1)}}var ir=.9,nr=1.3,ol=1/(1+ir)*nr;var hl=Math.PI*2;var rr=33,or=16,wa=16;function hr(){let r=new Float64Array(wa),t=0;for(let s=0;s<wa;s++){let a=2*s+1,i=a-or,n=Math.PI*i/2,o=Math.sin(n)/n,l=2*Math.PI*a/(rr-1),h=.42-.5*Math.cos(l)+.08*Math.cos(2*l);r[s]=.5*o*h,t+=r[s]}let e=.5/t;for(let s=0;s<wa;s++)r[s]*=e;return r}var ll=hr();var Ma=64,Es=1024,ka=Math.PI*2,Ls=null;function lr(){if(Ls===null){Ls=new Float32Array(Es);for(let r=0;r<Es;r++)Ls[r]=.5*(1-Math.cos(ka*r/(Es-1)))}return Ls}function cr(){return{live:!1,pos:0,step:0,age:0,dur:0,amp:0,gl:0,gr:0}}function oe(r,t,e){let s=r[t];return typeof s==\\\"number\\\"&&Number.isFinite(s)?s:e}var Aa=class{sr;rng;buffer;bufferRate;window;grains;liveGrains=0;gate=!1;vel=1;rateBase=1;countdown=0;grainSize;density;position;spray;pitch;pitchJitter;spread;reverse;baseNote;level;constructor(t,e,s,a,i){this.sr=t,this.rng=s,this.buffer=a,this.bufferRate=i,this.window=lr(),this.grains=[];for(let n=0;n<Ma;n++)this.grains.push(cr());this.grainSize=oe(e,\\\"grainSize\\\",80),this.density=oe(e,\\\"density\\\",20),this.position=oe(e,\\\"position\\\",.25),this.spray=oe(e,\\\"spray\\\",.05),this.pitch=oe(e,\\\"pitch\\\",1),this.pitchJitter=oe(e,\\\"pitchJitter\\\",0),this.spread=oe(e,\\\"spread\\\",.5),this.reverse=oe(e,\\\"reverse\\\",0),this.baseNote=oe(e,\\\"baseNote\\\",69),this.level=oe(e,\\\"level\\\",.9)}noteOn(t,e){this.vel=z(e,0,1),this.gate=!0,this.rateBase=t/Gn(this.baseNote)*(this.bufferRate/this.sr),this.countdown=0;for(let s of this.grains)s.live=!1;this.liveGrains=0}noteOff(){this.gate=!1}spawn(){let t=2*this.rng()-1,e=2*this.rng()-1,s=this.rng(),a=2*this.rng()-1,i=null;for(let p=0;p<Ma;p++)if(!this.grains[p].live){i=this.grains[p];break}if(i===null)return;let n=z(this.grainSize,10,500)/1e3,o=Math.max(2,Math.round(n*this.sr)),l=z(this.position+z(this.spray,0,1)*t,0,1),h=this.rateBase*z(this.pitch,.25,4);h*=Math.pow(2,z(this.pitchJitter,0,12)*e/12),s<z(this.reverse,0,1)&&(h=-h);let m=(.5+.5*z(this.spread,0,1)*a)*Math.PI/2;i.live=!0,i.pos=l*(this.buffer.length-2),i.step=h,i.age=0,i.dur=o,i.amp=this.vel/Math.sqrt(Math.max(1,this.density*n)),i.gl=Math.cos(m),i.gr=Math.sin(m),this.liveGrains++}process(t,e,s,a){if(!this.gate&&this.liveGrains===0)return;let i=this.buffer,n=i.length-2,o=this.window,l=Es-1,h=this.level;for(let m=s;m<a;m++){if(this.gate)for(this.countdown-=1;this.countdown<=0;)this.spawn(),this.countdown+=this.sr/z(this.density,.5,400);let p=0,v=0;for(let N=0;N<Ma;N++){let u=this.grains[N];if(!u.live)continue;let k=u.age/u.dur*l,g=k|0,S=k-g,d=o[g]+S*(o[g+1]-o[g]),x=u.pos|0,M=u.pos-x,f=(i[x]+M*(i[x+1]-i[x]))*d*u.amp;p+=f*u.gl,v+=f*u.gr,u.pos+=u.step,u.age++,(u.age>=u.dur-1||u.pos<0||u.pos>=n)&&(u.live=!1,this.liveGrains--)}t[m]+=p*h,e[m]+=v*h}}setParam(t,e){switch(t){case\\\"grainSize\\\":this.grainSize=e;break;case\\\"density\\\":this.density=e;break;case\\\"position\\\":this.position=e;break;case\\\"spray\\\":this.spray=e;break;case\\\"pitch\\\":this.pitch=e;break;case\\\"pitchJitter\\\":this.pitchJitter=e;break;case\\\"spread\\\":this.spread=e;break;case\\\"reverse\\\":this.reverse=e;break;case\\\"baseNote\\\":this.baseNote=e;break;case\\\"level\\\":this.level=e;break}}get active(){return this.gate||this.liveGrains>0}},Nr=[{name:\\\"grainSize\\\",min:10,max:500,default:80,curve:\\\"exp\\\",unit:\\\"ms\\\"},{name:\\\"density\\\",min:.5,max:400,default:20,curve:\\\"exp\\\",unit:\\\"Hz\\\"},{name:\\\"position\\\",min:0,max:1,default:.25},{name:\\\"spray\\\",min:0,max:1,default:.05},{name:\\\"pitch\\\",min:.25,max:4,default:1,curve:\\\"exp\\\"},{name:\\\"pitchJitter\\\",min:0,max:12,default:0,unit:\\\"st\\\"},{name:\\\"spread\\\",min:0,max:1,default:.5},{name:\\\"reverse\\\",min:0,max:1,default:0},{name:\\\"baseNote\\\",min:24,max:96,default:69},{name:\\\"level\\\",min:0,max:1,default:.9}];function mr(r,t,e=\\\"granular\\\"){return{id:e,label:\\\"Granular\\\",params:Nr,polyphony:8,createVoice:(s,a,i)=>new Aa(s,a,i,r,t)}}var Ra=44100,Fs=null;function pr(){if(Fs===null){let r=Ra;Fs=new Float32Array(r);let t=Math.round(.01*r);for(let e=0;e<r;e++){let s=e/Ra,a=1;e<t?a=e/t:e>r-t&&(a=(r-e)/t),Fs[e]=a*(.7*Math.sin(ka*220*s)+.2*Math.sin(ka*440*s))}}return Fs}var cl=mr(pr(),Ra);var Nl=Math.PI*2;var fr=-96,ml=Math.pow(10,fr/20),pl=Math.LN10/20;var fl=Math.PI*2,ur=[.6923877778065,.9360654322959,.988229522686,.9987488452737],dr=[.4021921162426,.856171088242,.9722909545651,.9952884791278],ul=new Float64Array(ur.map(r=>r*r)),dl=new Float64Array(dr.map(r=>r*r));var vr=6;var br=[80,250,800,2500,6e3,12e3],gr=[.707,1,1,1,1,.707];function xr(){let r=[];for(let t=0;t<vr;t++)r.push({name:\\\"b\\\"+t+\\\"freq\\\",min:20,max:2e4,default:br[t],curve:\\\"exp\\\",unit:\\\"Hz\\\"}),r.push({name:\\\"b\\\"+t+\\\"gain\\\",min:-24,max:24,default:0,unit:\\\"dB\\\"}),r.push({name:\\\"b\\\"+t+\\\"q\\\",min:.1,max:12,default:gr[t]}),r.push({name:\\\"b\\\"+t+\\\"enabled\\\",min:0,max:1,default:1});return r}var vl=xr();var bl=2*Math.PI;var gl=Object.freeze({stages:5,hz:5300,bw:1500}),xl=Object.freeze({stages:5,hz:5400,bw:1500}),yl=Object.freeze({stages:4,hz:5500,bw:1e3}),wl=Object.freeze({stages:2,hz:4700,bw:750}),Ml=Object.freeze({stages:1,hz:4600,bw:500}),kl=Object.freeze({stages:0,hz:4500,bw:1e3});var yr=new Uint32Array(256);for(let r=0;r<256;r++){let t=r<<24;for(let e=0;e<8;e++)t=((t&2147483648)!==0?t<<1^79764919:t<<1)>>>0;yr[r]=t}var Al=16*1024*1024;var Rl=8*1024*1024;function as(r){let t={};for(let e=1;e<=32;e++){let s=r[e-1]??0;t[\\\"partial\\\"+e]=s,t[\\\"target\\\"+e]=s}return t}var wr=[{id:\\\"nylon-guitar\\\",label:\\\"NYLON GUITAR\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.5,pickPos:.32,exciteType:.6,decay:2.2,level:.9},gain:.85},{id:\\\"steel-guitar\\\",label:\\\"STEEL GUITAR\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.24,pickPos:.18,exciteType:.2,decay:3.5,level:.85}},{id:\\\"twelve-string\\\",label:\\\"TWELVE STRING\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.26,pickPos:.16,exciteType:.2,decay:3.2,level:.8},fx:[{effectId:\\\"chorus\\\",params:{rate:.8,depth:.35,mix:.55,feedback:0}}]},{id:\\\"muted-electric\\\",label:\\\"MUTED ELECTRIC\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.78,pickPos:.12,exciteType:.35,decay:.35,level:.95},gain:.9},{id:\\\"clean-electric\\\",label:\\\"CLEAN ELECTRIC\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.3,pickPos:.14,exciteType:.15,decay:3,level:.85},fx:[{effectId:\\\"tapeDelay\\\",params:{time:.115,feedback:.12,mix:.22,wow:.06,flutter:.08,saturation:.3,tone:5500,hiss:0}}]},{id:\\\"bass-guitar\\\",label:\\\"BASS GUITAR\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.55,pickPos:.25,exciteType:.45,decay:2.2,level:.95},gain:.9,octave:-2},{id:\\\"banjo\\\",label:\\\"BANJO\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.12,pickPos:.08,exciteType:.55,decay:1.1,level:.8}},{id:\\\"sitar-drone\\\",label:\\\"SITAR DRONE\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.18,pickPos:.04,exciteType:.3,decay:6,level:.75}},{id:\\\"koto\\\",label:\\\"KOTO\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.42,pickPos:.42,exciteType:.75,decay:1.8,level:.85}},{id:\\\"harp\\\",label:\\\"HARP\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.4,pickPos:.5,exciteType:.5,decay:4.5,level:.85}},{id:\\\"clavinet\\\",label:\\\"CLAVINET\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.3,pickPos:.07,exciteType:1,decay:.9,level:.9}},{id:\\\"violin\\\",label:\\\"VIOLIN\\\",family:\\\"strings\\\",engineId:\\\"string\\\",params:{damp:.18,sustain:.85,dispersion:0,bow:.8,bowPressure:.55,bowSpeed:.6,bowPos:.11,body:.8,bodySize:0,bowNoise:.35,attackBite:.5,vibRate:6.1,vibDepth:22,vibOnset:.3,dynamics:.7,polDetune:2,glide:.035,legatoScratch:.2,level:.8},fx:[{effectId:\\\"plate\\\",params:{decay:.42,predelay:.02,mix:.14}}],gain:.94},{id:\\\"viola\\\",label:\\\"VIOLA\\\",family:\\\"strings\\\",engineId:\\\"string\\\",params:{damp:.28,sustain:.85,dispersion:0,bow:.8,bowPressure:.6,bowSpeed:.55,bowPos:.115,body:.8,bodySize:.18,bowNoise:.35,attackBite:.45,vibRate:5.6,vibDepth:20,vibOnset:.3,dynamics:.7,polDetune:2,glide:.04,legatoScratch:.2,level:.8},fx:[{effectId:\\\"plate\\\",params:{decay:.42,predelay:.02,mix:.14}}],gain:1},{id:\\\"cello\\\",label:\\\"CELLO\\\",family:\\\"strings\\\",engineId:\\\"string\\\",params:{damp:.38,sustain:.9,dispersion:0,bow:.85,bowPressure:.65,bowSpeed:.45,bowPos:.125,body:.8,bodySize:.62,bowNoise:.4,attackBite:.55,vibRate:5,vibDepth:16,vibOnset:.35,dynamics:.7,polDetune:1.8,glide:.05,legatoScratch:.2,level:.8},fx:[{effectId:\\\"plate\\\",params:{decay:.42,predelay:.025,mix:.15}}],gain:.94,octave:-1},{id:\\\"double-bass\\\",label:\\\"DOUBLE BASS\\\",family:\\\"strings\\\",engineId:\\\"string\\\",params:{damp:.5,sustain:.9,dispersion:.05,bow:.85,bowPressure:.7,bowSpeed:.35,bowPos:.14,body:.7,bodySize:1,bowNoise:.45,attackBite:.6,vibRate:4.5,vibDepth:10,vibOnset:.4,dynamics:.7,polDetune:1.5,glide:.06,legatoScratch:.2,level:.85},fx:[{effectId:\\\"plate\\\",params:{decay:.42,predelay:.025,mix:.12}}],gain:.66,octave:-2},{id:\\\"pizzicato-strings\\\",label:\\\"PIZZICATO STRINGS\\\",family:\\\"strings\\\",engineId:\\\"string\\\",params:{damp:.45,sustain:.3,dispersion:0,bow:0,body:.6,bodySize:.3,level:.9},gain:1},{id:\\\"concert-flute\\\",label:\\\"CONCERT FLUTE\\\",family:\\\"winds\\\",engineId:\\\"harmonic\\\",params:{brightness:.32,evenOdd:.5,noiseMix:.18,noiseColor:4,attack:.06,release:.2,level:.85},octave:1},{id:\\\"pan-flute\\\",label:\\\"PAN FLUTE\\\",family:\\\"winds\\\",engineId:\\\"harmonic\\\",params:{brightness:.25,evenOdd:.5,noiseMix:.35,noiseColor:3,attack:.05,release:.15,level:.85},octave:1},{id:\\\"clarinet\\\",label:\\\"CLARINET\\\",family:\\\"winds\\\",engineId:\\\"tube\\\",params:{breath:.85,noise:.05,glide:.02,legatoScratch:0,level:.8}},{id:\\\"recorder\\\",label:\\\"RECORDER\\\",family:\\\"winds\\\",engineId:\\\"tube\\\",params:{breath:.7,noise:.12,glide:.02,legatoScratch:0,level:.75},octave:1},{id:\\\"ocarina\\\",label:\\\"OCARINA\\\",family:\\\"winds\\\",engineId:\\\"harmonic\\\",params:{brightness:.08,evenOdd:.5,noiseMix:.1,noiseColor:1,attack:.04,release:.12,level:.9},octave:1},{id:\\\"shakuhachi\\\",label:\\\"SHAKUHACHI\\\",family:\\\"winds\\\",engineId:\\\"harmonic\\\",params:{brightness:.35,evenOdd:.5,noiseMix:.4,noiseColor:2.5,attack:.09,release:.3,level:.85}},{id:\\\"trumpet\\\",label:\\\"TRUMPET\\\",family:\\\"brass\\\",engineId:\\\"harmonic\\\",params:{brightness:.72,evenOdd:.5,formantShift:1.8,noiseMix:.04,attack:.04,release:.15,level:.8}},{id:\\\"trombone\\\",label:\\\"TROMBONE\\\",family:\\\"brass\\\",engineId:\\\"harmonic\\\",params:{brightness:.55,evenOdd:.5,formantShift:.9,noiseMix:.05,attack:.07,release:.2,level:.85},octave:-1},{id:\\\"brass-section\\\",label:\\\"BRASS SECTION\\\",family:\\\"brass\\\",engineId:\\\"harmonic\\\",params:{brightness:.62,evenOdd:.5,formantShift:1.4,noiseMix:.06,attack:.09,release:.25,level:.85},fx:[{effectId:\\\"chorus\\\",params:{rate:.5,depth:.3,mix:.4,feedback:0}}]},{id:\\\"fm-horn\\\",label:\\\"FM HORN\\\",family:\\\"brass\\\",engineId:\\\"fm\\\",params:{ops:2,algorithm:1,ratio1:1,level1:1,ratio2:1,level2:.55,feedback:.25,brightness:.8,attack:.06,decay:.25,sustain:.85,release:.25,mAttack:.09,mDecay:.5,mSustain:.65,mRelease:.2}},{id:\\\"dx-epiano\\\",label:\\\"DX E-PIANO\\\",family:\\\"keys\\\",engineId:\\\"fm\\\",params:{ops:4,algorithm:5,ratio1:1,level1:1,ratio2:1,level2:.4,ratio3:1,level3:.55,ratio4:14,level4:.1,feedback:.1,brightness:.9,attack:.002,decay:1.4,sustain:.2,release:.35,mAttack:.001,mDecay:.3,mSustain:0,mRelease:.2},fx:[{effectId:\\\"chorus\\\",params:{rate:.7,depth:.3,mix:.3,feedback:0}}]},{id:\\\"drawbar-organ\\\",label:\\\"DRAWBAR ORGAN\\\",family:\\\"keys\\\",engineId:\\\"additive\\\",params:{...as([1,.85,.65,.5,.18,.4,.08,.3]),inharm:0,decay:20,rolloff:1,attack:.004,release:.08,gain:1}},{id:\\\"church-organ\\\",label:\\\"CHURCH ORGAN\\\",family:\\\"keys\\\",engineId:\\\"additive\\\",params:{...as([1,.75,.4,.6,.15,.35,.08,.3,0,.12,0,.18]),inharm:0,decay:20,rolloff:1,attack:.04,release:.3,gain:1}},{id:\\\"harpsichord\\\",label:\\\"HARPSICHORD\\\",family:\\\"keys\\\",engineId:\\\"pluck\\\",params:{damp:.2,pickPos:.06,exciteType:1,decay:1.6,level:.85}},{id:\\\"celesta\\\",label:\\\"CELESTA\\\",family:\\\"keys\\\",engineId:\\\"additive\\\",params:{...as([1,.2,.05,.12]),inharm:.001,decay:1.8,rolloff:.55,attack:.001,release:.4,gain:1},octave:1},{id:\\\"music-box\\\",label:\\\"MUSIC BOX\\\",family:\\\"keys\\\",engineId:\\\"additive\\\",params:{...as([1,0,.5,0,.22,0,.1]),inharm:.004,decay:1.3,rolloff:.45,attack:.001,release:.3,gain:1},octave:2},{id:\\\"marimba\\\",label:\\\"MARIMBA\\\",family:\\\"mallets\\\",engineId:\\\"modal\\\",params:{material:0,decay:.4,brightness:.45,strikeHardness:.5,level:.75}},{id:\\\"vibraphone\\\",label:\\\"VIBRAPHONE\\\",family:\\\"mallets\\\",engineId:\\\"modal\\\",params:{material:0,decay:3.5,brightness:.4,strikeHardness:.35,level:.65},fx:[{effectId:\\\"tremolo\\\",params:{rate:4.5,depth:.4,shape:0,phase:0}}]},{id:\\\"glockenspiel\\\",label:\\\"GLOCKENSPIEL\\\",family:\\\"mallets\\\",engineId:\\\"modal\\\",params:{material:0,decay:1.6,brightness:.8,strikeHardness:.85,level:.5},octave:2},{id:\\\"tubular-bells\\\",label:\\\"TUBULAR BELLS\\\",family:\\\"mallets\\\",engineId:\\\"modal\\\",params:{material:2,decay:5,brightness:.5,strikeHardness:.7,level:.55}},{id:\\\"kalimba\\\",label:\\\"KALIMBA\\\",family:\\\"mallets\\\",engineId:\\\"modal\\\",params:{material:0,decay:.9,brightness:.22,strikeHardness:.4,level:.8}},{id:\\\"steel-drum\\\",label:\\\"STEEL DRUM\\\",family:\\\"mallets\\\",engineId:\\\"modal\\\",params:{material:2,decay:1.1,brightness:.62,strikeHardness:.45,level:.7}},{id:\\\"woodblock\\\",label:\\\"WOODBLOCK\\\",family:\\\"mallets\\\",engineId:\\\"modal\\\",params:{material:4,decay:2,brightness:.6,strikeHardness:.9,level:.85}},{id:\\\"timpani\\\",label:\\\"TIMPANI\\\",family:\\\"mallets\\\",engineId:\\\"modal\\\",params:{material:1,decay:3,brightness:.15,strikeHardness:.3,level:.8},octave:-2},{id:\\\"choir-aah\\\",label:\\\"CHOIR AAH\\\",family:\\\"voices\\\",engineId:\\\"formant\\\",params:{vowel:0,breath:.15,vibratoRate:4.5,vibratoDepth:.2,shape:0,level:1},fx:[{effectId:\\\"chorus\\\",params:{rate:.4,depth:.45,mix:.5,feedback:0}}]},{id:\\\"voice-ooh\\\",label:\\\"VOICE OOH\\\",family:\\\"voices\\\",engineId:\\\"formant\\\",params:{vowel:3.2,breath:.12,vibratoRate:5,vibratoDepth:.25,shape:0,level:1.1}},{id:\\\"whistle\\\",label:\\\"WHISTLE\\\",family:\\\"voices\\\",engineId:\\\"additive\\\",params:{...as([1]),inharm:0,decay:20,rolloff:1,attack:.04,release:.12,gain:.9},octave:2},{id:\\\"analog-lead\\\",label:\\\"ANALOG LEAD\\\",family:\\\"synth\\\",engineId:\\\"va\\\",params:{shape:0,detune:9,sub:.2,cutoff:3200,resonance:.35,filterType:0,envAmount:1.5,attack:.004,decay:.15,sustain:.85,release:.18,fAttack:.002,fDecay:.25,fSustain:.45,fRelease:.2,drift:.25}},{id:\\\"fat-saw-pad\\\",label:\\\"FAT SAW PAD\\\",family:\\\"synth\\\",engineId:\\\"va\\\",params:{shape:0,detune:18,sub:.35,cutoff:1600,resonance:.12,filterType:0,envAmount:1,attack:.6,decay:.4,sustain:.85,release:1.1,fAttack:.9,fDecay:.5,fSustain:.6,fRelease:.8,drift:.4},gain:.75},{id:\\\"acid-bass\\\",label:\\\"ACID BASS\\\",family:\\\"synth\\\",engineId:\\\"va\\\",params:{shape:0,detune:0,sub:0,cutoff:320,resonance:.85,filterType:0,envAmount:3,attack:.002,decay:.25,sustain:.55,release:.12,fAttack:.001,fDecay:.18,fSustain:.05,fRelease:.1,drift:.1},octave:-1},{id:\\\"sub-bass\\\",label:\\\"SUB BASS\\\",family:\\\"synth\\\",engineId:\\\"va\\\",params:{shape:3,detune:0,sub:0,cutoff:900,resonance:0,envAmount:0,attack:.004,decay:.1,sustain:1,release:.12,drift:0},gain:.95,octave:-2},{id:\\\"west-coast-pluck\\\",label:\\\"WEST COAST PLUCK\\\",family:\\\"synth\\\",engineId:\\\"westcoast\\\",params:{foldAmount:.55,foldStages:2,foldEnv:.8,lpgColor:.85,lpgDecay:.3,level:.85}},{id:\\\"motion-pad\\\",label:\\\"MOTION PAD\\\",family:\\\"synth\\\",engineId:\\\"wavetable\\\",params:{position:.25,scanRate:.2,scanDepth:.35,envToPosition:.25,attack:.7,decay:.4,sustain:.85,release:1.2,filter:1,cutoff:3800,resonance:.15},gain:.75},{id:\\\"fm-bell-lead\\\",label:\\\"FM BELL LEAD\\\",family:\\\"synth\\\",engineId:\\\"fm\\\",params:{ops:2,algorithm:1,ratio1:1,level1:1,ratio2:3.53,level2:.45,feedback:.15,brightness:1,attack:.002,decay:2,sustain:0,release:.6,mAttack:.001,mDecay:1.1,mSustain:0,mRelease:.5}}],Mr=new Map;for(let r of wr)Mr.set(r.id,r);var Is=6;function is(r,t=.98){let e=i=>{let n=1,o=1;for(let l=1;l<r;l++)n*=i/l,o+=n;return Math.exp(-i)*o},s=0,a=10*r+50;for(let i=0;i<200;i++){let n=.5*(s+a);e(n)>1-t?s=n:a=n}return .5*(s+a)}var Sa=is(Is),Cs=1e15,kr=.001,ki=1e9,Ar=1e-30,Ts=class{channels;order;values;x;goal;rate;c;h;settle;constructor(t,e,s=Is){if(!(Number.isInteger(t)&&t>0&&t<=65536))throw new RangeError(`channel count must be an integer from 1 to 65536, got ${t}`);if(!(Number.isInteger(s)&&s>=1&&s<=12))throw new RangeError(`order must be an integer from 1 to 12, got ${s}`);if(!(e>=.001&&e<=1e9))throw new RangeError(`step rate must be within [1e-3, 1e9] Hz, got ${e}`);this.channels=t,this.order=s,this.h=1/e,this.values=new Float64Array(t),this.x=new Float64Array(t*s),this.goal=new Float64Array(t),this.rate=new Float64Array(t),this.c=new Float64Array(t*s),this.settle=is(s);for(let a=0;a<t;a++)this.setRate(a,this.settle/.1)}setRate(t,e){if(!Number.isFinite(e))return;let s=z(e,kr,ki);s!==this.rate[t]&&(this.rate[t]=s,this.coefficients(t))}setTime(t,e){if(!Number.isFinite(e))return;let s=z(e,0,Number.MAX_VALUE);this.setRate(t,s>0?this.settle/s:ki)}setTarget(t,e){Number.isFinite(e)&&(this.goal[t]=z(e,-Cs,Cs))}snap(t,e){if(!Number.isFinite(e))return;let s=z(e,-Cs,Cs);this.goal[t]=s,this.values[t]=s;let a=this.order;for(let i=0;i<a;i++)this.x[t*a+i]=s}place(t,e){if(e-e!==0)return;let s=e<-1e15?-1e15:e>1e15?1e15:e;this.x[t*this.order+this.order-1]=s,this.values[t]=s}placeFrom(t,e,s){this.place(t,e[s])}velocity(t){let e=this.order,s=t*e+e-1;return e>1?(this.x[s-1]-this.x[s])*this.rate[t]:(this.goal[t]-this.x[s])*this.rate[t]}stage(t,e){return this.x[t*this.order+e]}target(t){return this.goal[t]}setAll(t,e){for(let s=0;s<this.channels;s++){let a=t[s];a-a===0&&(this.goal[s]=a<-1e15?-1e15:a>1e15?1e15:a);let i=e[s];if(i-i!==0)continue;let n=i<.001?.001:i>1e9?1e9:i;n!==this.rate[s]&&(this.rate[s]=n,this.coefficients(s))}}step(){let t=this.order,e=this.x,s=this.c,a=this.goal;for(let i=0;i<this.channels;i++){let n=i*t,o=a[i],l=0;for(let h=t-1;h>=0;h--){let m=0;for(let p=0;p<=h;p++)m+=s[n+h-p]*(e[n+p]-o);e[n+h]=o+m,m>l?l=m:-m>l&&(l=-m)}if(l<Ar)for(let h=0;h<t;h++)e[n+h]=o;this.values[i]=e[n+t-1]}}coefficients(t){let e=this.order,s=this.h*this.rate[t],a=Math.exp(-s);for(let i=0;i<e;i++)this.c[t*e+i]=a,a*=s/(i+1)}};var Rr=.2,Sr=1,Os=class{h;x=0;v=0;goal=0;w=2*Math.PI*5.5;zeta=.6;prep=0;a=1;b=0;c=0;d=1;constructor(t){if(!(t>=10&&t<=1e7))throw new RangeError(`PitchGlide step rate ${t} Hz is outside [10, 1e7]`);this.h=1/t,this.update()}setSpeed(t){Number.isFinite(t)&&(this.w=2*Math.PI*z(t,.1,200),this.update())}setDamping(t){Number.isFinite(t)&&(this.zeta=z(t,Rr,1),this.update())}setPreparation(t){Number.isFinite(t)&&(this.prep=z(t,0,Sr))}setTarget(t){if(!Number.isFinite(t))return;let e=t-this.goal;this.goal=t,e!==0&&this.prep>0&&(this.v-=this.w*this.prep*e)}snap(t){Number.isFinite(t)&&(this.x=this.goal=t,this.v=0)}step(){return this.advance(),this.x}advance(){let t=this.x-this.goal,e=this.v;this.x=this.goal+this.a*t+this.b*e,this.v=this.c*t+this.d*e}get value(){return this.x}get velocity(){return this.v}get target(){return this.goal}leadTime(){let t=0,e=10/this.w;for(let s=0;s<60;s++){let a=.5*(t+e);this.stepResponse(a)<.5?t=a:e=a}return .5*(t+e)}stepResponse(t){let e=this.w,s=this.zeta,a=-1,i=-e*this.prep,n=Math.exp(-s*e*t);if(s>=1-1e-9)return 1+n*(a+(i+e*a)*t);let o=e*Math.sqrt(1-s*s);return 1+n*(a*Math.cos(o*t)+(i+s*e*a)/o*Math.sin(o*t))}update(){let t=this.w,e=this.zeta,s=this.h,a=Math.exp(-e*t*s);if(e>=1-1e-9){this.a=(1+t*s)*a,this.b=s*a,this.c=-t*t*s*a,this.d=(1-t*s)*a;return}let i=t*Math.sqrt(1-e*e),n=Math.cos(i*s),o=Math.sin(i*s);this.a=a*(n+e*t/i*o),this.b=a*o/i,this.c=-a*t*t*o/i,this.d=a*(n-e*t/i*o)}};var he=980.665,Qt={m:1.5,r:2e3,k:1e5},qs={m:1.5,r:800,k:66667},Ai={m:.6,r:1e3,k:1e6},Ri={m:1,r:3e3,k:1e6};var Lr=.00114*35e3,Fr=Math.sqrt(.00114*186e-6*2*Math.PI*700/2),dt=256,Si=dt-1,ns=class{nn=0;D;F;B;Z;area;rv;wS;gam;ibq;wV;wY;U;wCm=0;wK=0;wIb=0;T=0;sG;sCm;sK;sQ;sY;sP;constructor(t){let e=t-1;this.D=new Int32Array(e),this.F=new Float64Array(e*dt),this.B=new Float64Array(e*dt),this.Z=new Float64Array(e),this.area=new Float64Array(e),this.rv=new Float64Array(t),this.wS=new Float64Array(t),this.gam=new Float64Array(t).fill(1),this.ibq=new Float64Array(t),this.wV=new Float64Array(t),this.wY=new Float64Array(t),this.U=new Float64Array(t),this.sG=new Float64Array(t),this.sCm=new Float64Array(t),this.sK=new Float64Array(t),this.sQ=new Float64Array(t),this.sY=new Float64Array(t),this.sP=new Float64Array(t)}addResonator(t,e,s,a){!(t>=1&&t<this.nn-1)||!(e>0)||(this.sG[t]=.5*e,this.sCm[t]=s*e,this.sK[t]=a*e,this.refresh(t))}refresh(t){let e=this.Z[t-1],s=1/(1+e*(this.wS[t]*this.wIb+this.sG[t]));this.gam[t]=s,this.ibq[t]=1/(e*s+this.Z[t]+this.rv[t])}configure(t,e,s,a,i,n,o,l,h){this.nn=a,this.T=1/h;let m=a-1;for(let N=0;N<m;N++){let u=s[N],k=s[N+1];this.D[N]=k-u>>1;let g=0;for(let S=u;S<k;S++)g+=1/t[S];this.area[N]=(k-u)/g,this.Z[N]=Lr/this.area[N]}let p=i.m*h+.5*i.r;this.wCm=i.m*h-.5*i.r,this.wK=i.k,this.wIb=1/p,this.rv.fill(0),this.wS.fill(0);let v=n*2*Math.sqrt(Math.PI)*l*o;for(let N=1;N<e;N++){let u=-1,k=1/0;for(let d=1;d<a-1;d++){let x=s[d]>N?s[d]-N:N-s[d];x<k&&(k=x,u=d)}if(u<0)continue;let g=t[N-1],S=t[N];this.rv[u]+=.25*Fr*v*(Math.pow(g,-1.5)+Math.pow(S,-1.5)),this.wS[u]+=n*2*Math.sqrt(Math.PI*.5*(g+S))*l}this.sG.fill(0),this.sCm.fill(0),this.sK.fill(0);for(let N=1;N<a-1;N++)this.refresh(N);this.reset()}reset(){this.F.fill(0),this.B.fill(0),this.wV.fill(0),this.wY.fill(0),this.U.fill(0),this.sQ.fill(0),this.sY.fill(0),this.sP.fill(0)}interior(t){let e=this.F,s=this.B,a=this.D,i=this.Z,n=this.wCm,o=this.wK,l=this.wIb,h=this.T,m=this.nn;for(let p=1;p<m-1;p++){let v=(p-1)*dt,N=p*dt,u=e[v+(t-a[p-1]&Si)],k=s[N+(t-a[p]&Si)],g=i[p-1],S=this.wV[p],d=this.wY[p],x=n*S-o*d,M=this.sG[p],f=M>0?M*this.sP[p]+this.sCm[p]*this.sQ[p]-this.sK[p]*this.sY[p]:0,b=-this.wS[p]*x*l-f,E=this.gam[p],O=(2*u*E-2*k+g*E*b)*this.ibq[p],H=(2*u-g*(O-b))*E,I=(x+H)*l;if(this.wV[p]=I,this.wY[p]=d+h*I,M>0){let X=M*H+f;this.sY[p]+=.5*h*(X+this.sQ[p]),this.sQ[p]=X,this.sP[p]=H}s[v+t]=H-u,e[N+t]=k+i[p]*O,this.U[p]=O}}};function Li(r,t,e){let s=0;e[s++]=0;for(let a=1;a<=t;a++){let i=2*Math.round(a*r/(t+1)/2);i>e[s-1]&&i<r&&(e[s++]=i)}return e[s++]=r,s}var La=.00114;function Fi(r,t,e,s){let a=2*Math.PI*t,i=2*s*Math.tan(a/(2*s)),n=i*i*r,o=a*r/e;return[1/(r*s+.5*o+n/(4*s)),r*s-.5*o-n/(4*s),n]}var Er=2.5,Pr=1.8,Cr=10;function Ei(r,t){let e=Pr*r,s=Er*r*r*r/e,a=e+.61*Math.sqrt(s/2/Math.PI);return Fi(La*a/(2*s),35e3/(4*a),Cr,t)}var Tr=30,Ir=.2,Or=1,qr=8;function Pi(r,t){let e=Tr*r*r*r,s=La*Or*r/(Ir*r*r),a=Math.sqrt(La*35e3*35e3/e/s)/(2*Math.PI);return Fi(s,a,qr,t)}var Ue=class{openR=45;sealR=5;lo=.03;hi=.4;ease=.03;dt=0;setScale(t){let e=t*t;this.openR=45*e,this.sealR=5*e,this.lo=.03*e,this.hi=.4*e,this.ease=.03*e}setStep(t){this.dt=t}closeRate(t){if(t<this.ease)return this.sealR*Math.sqrt((t>0?t:0)/this.ease);let e=t<=this.lo?0:t>=this.hi?1:(t-this.lo)/(this.hi-this.lo);return this.sealR+(this.openR-this.sealR)*e*e*(3-2*e)}limit(t,e,s){let a=t-e;if(a>0){let n=(this.openR+40*t)*s;return a>n?e+n:t}let i=(this.closeRate(e)+40*e)*s;return a<-i?e-i:t}limitAll(t,e,s){let a=this.dt,i=this.openR,n=this.sealR,o=this.lo,l=this.hi-this.lo,h=this.ease;for(let m=0;m<s;m++){let p=e[m],v=t[m]-p;if(v>0){let k=(i+40*t[m])*a;v>k&&(t[m]=p+k);continue}let N;if(p<h)N=n*Math.sqrt((p>0?p:0)/h);else{let k=(p-o)/l;k=k<0?0:k>1?1:k,N=n+(i-n)*k*k*(3-2*k)}let u=(N+40*p)*a;v<-u&&(t[m]=p-u)}}};var Fa=1/(Math.sqrt(1/3)*Math.SQRT2*.875),Lt=Math.PI/2,Ii=Lt,Oi=-Ii*Lt*Lt/6,qi=-Oi*Lt*Lt/20,Di=-qi*Lt*Lt/42,Bi=-Di*Lt*Lt/72,zi=-Bi*Lt*Lt/110,_i=-zi*Lt*Lt/156,Dr=-_i*Lt*Lt/210;function Br(r){let t=r*r;return r*(Ii+t*(Oi+t*(qi+t*(Di+t*(Bi+t*(zi+t*(_i+t*Dr)))))))}var Ta=.08,zr=1/Ta,_r=1/8.43,Hr=500,Ea=.3,Vr=1.4,Gr=100,Ci=48,Ur=.28,rs=.38,jr=.8,Xr=.55,Yr=.37,Wr=.2,Kr=.6,Pa=2,Ti=1,$r=.25,Zr=.25;function Ca(r,t,e,s,a,i,n){if(r>=t)return 0;let o=r*e,l=o<s,h=Br(l?o*a:1-(o-s)*i),m=h*h;return l?m:m+(h-m)*n}var os=class{sampleRate;invSampleRate;maxHz;cycleRng;driftRng;chaosRng;cycleS=1;driftS=1;driftInterval;driftPole0;driftPole1;driftPole2;driftIn0;driftIn1;driftIn2;hz=110;targetOq=.6;targetSkew=.64;targetSharp=.2;targetFry=0;jitter=0;shimmer=0;diplophonia=0;chaos=0;driftCents=6;fry=0;oq=.6;invOq=1/.6;skew=.64;invSkew=1/.64;invFall=1/.36;sharp=.2;fryGain=0;oq2=0;invOq2=0;end2=0;closeFirst=Pa;closeSecond=Pa;phase=0;odd=!1;scale=1;amp=1;ampPrev=1;chaosX=Yr;inc=0;drift0=0;drift1=0;drift2=0;driftCountdown=0;pitchFactor=1;u=0;uOut=0;pending=0;y=0;aOut=0;constructor(t,e){this.sampleRate=t,this.invSampleRate=1/t,this.maxHz=t*$r,this.cycleRng=e.fork(\\\"jitter\\\"),this.driftRng=e.fork(\\\"drift\\\"),this.chaosRng=e.fork(\\\"chaos\\\"),this.driftInterval=Math.max(1,Math.round(t/Hr));let s=t/this.driftInterval;this.driftPole0=Math.exp(-2*Math.PI*Ea/s),this.driftPole1=Math.exp(-2*Math.PI*Ea*3/s),this.driftPole2=Math.exp(-2*Math.PI*Ea*9/s),this.driftIn0=Math.sqrt(1-this.driftPole0*this.driftPole0),this.driftIn1=Math.sqrt(1-this.driftPole1*this.driftPole1),this.driftIn2=Math.sqrt(1-this.driftPole2*this.driftPole2),this.setTension(.5),this.setRoughness(.1),this.reset()}reset(){this.phase=0,this.odd=!1,this.scale=1,this.amp=1,this.ampPrev=1,this.chaosX=Wr+Kr*this.chaosRng(),this.cycleS=this.cycleRng()*4294967296|0,this.driftS=this.driftRng()*4294967296|0,this.drift0=0,this.drift1=0,this.drift2=0,this.driftCountdown=0,this.pitchFactor=1,this.u=0,this.uOut=0,this.pending=0,this.aOut=0,this.latch(),this.inc=this.hz*this.invSampleRate}setFreq(t){t===t&&(this.hz=Math.min(Math.max(t,Ti),this.maxHz))}setFreqFrom(t,e){let s=t[e];s===s&&(this.hz=Math.min(Math.max(s,Ti),this.maxHz))}setTension(t){let e=z(t,0,1);this.targetOq=z(.78-.36*e,.25,.98),this.targetSkew=z(.56+.16*e,.3,.9),this.targetSharp=z(.4*e+1.375*Math.max(0,e-.6),0,1),this.phase===0&&this.latch()}setRoughness(t){let e=z(t,0,1);this.jitter=.0021+.0245*e,this.shimmer=.02+.22*e,this.diplophonia=e>.5?(e-.5)*1.4:0}setFry(t){this.targetFry=z(t,0,1),this.phase===0&&this.latch()}setDrift(t){this.driftCents=z(t,0,Gr)}setJitter(t){this.jitter=z(t,0,Zr)}setShimmer(t){this.shimmer=z(t,0,1)}setDiplophonia(t){this.diplophonia=z(t,0,1)}setChaos(t){this.chaos=z(t,0,1)}get flow(){return this.u}get openArea(){return this.aOut}nextArea(){--this.driftCountdown<=0&&this.stepDrift();let t=this.hz*this.pitchFactor;this.fry>0&&(t=this.fryPull(t)),t>this.maxHz&&(t=this.maxHz);let e=t*this.invSampleRate/this.scale;this.inc=e;let s=this.phase+e;s>=1&&(s-=1,this.startCycle()),this.phase=s,this.aOut=this.area(s)}processArea(t,e,s){for(let a=e;a<s;a++)this.nextArea(),t[a]=this.aOut}nextPhase(){--this.driftCountdown<=0&&this.stepDrift();let t=this.hz*this.pitchFactor;this.fry>0&&(t=this.fryPull(t)),t>this.maxHz&&(t=this.maxHz);let e=t*this.invSampleRate/this.scale;this.inc=e;let s=this.phase+e;s>=1&&(s-=1,this.ampPrev=this.amp,this.startCycle()),this.phase=s}processPhase(t,e,s){for(let a=e;a<s;a++)this.nextPhase(),t[a]=this.phase}get f0(){return this.inc*this.sampleRate}next(){return this.step(),this.y}process(t,e,s){for(let a=e;a<s;a++)this.step(),t[a]=this.y}step(){--this.driftCountdown<=0&&this.stepDrift();let t=this.hz*this.pitchFactor;this.fry>0&&(t=this.fryPull(t)),t>this.maxHz&&(t=this.maxHz);let e=t*this.invSampleRate/this.scale;this.inc=e;let s=this.phase+e;s>=1&&(s-=1,this.startCycle()),this.phase=s;let a=this.area(s),i=0;if(a>0){let o=e*zr,l=this.u+o;i=2*l/(1+Math.sqrt(1+4*o*l/(a*a)))}let n=i+this.pending;this.pending=0,s+e>=this.closeFirst&&s<this.closeFirst&&(n+=this.cornerFirst(s,e)),s+e>=this.closeSecond&&s<this.closeSecond&&(n+=this.cornerSecond(s,e)),this.y=(n-this.uOut)*_r/e,this.uOut=n,this.u=i}fryPull(t){let e=this.fry;return t*(1-e)+(t<Ci?t:Ci)*e}area(t){let e=this.amp,s=e*Ca(t,this.oq,this.invOq,this.skew,this.invSkew,this.invFall,this.sharp);return this.fryGain>0&&t>rs&&(s+=e*this.fryGain*Ca(t-rs,this.oq2,this.invOq2,this.skew,this.invSkew,this.invFall,this.sharp)),s}cornerFirst(t,e){let s=this.oq,a=1;this.fryGain>0&&s>rs&&(a=1/(1+this.amp*this.fryGain*Ca(s-rs,this.oq2,this.invOq2,this.skew,this.invSkew,this.invFall,this.sharp)*Ta/(2*e)));let i=this.amp*this.sharp*Lt*this.invFall*this.invOq;return this.corner(t,e,s,i,a)}cornerSecond(t,e){let s=this.amp*this.fryGain*this.sharp*Lt*this.invFall*this.invOq2;return this.corner(t,e,this.end2,s,1)}corner(t,e,s,a,i){let n=Ta*a,o=.5*a*(n+Math.sqrt(n*n+4)),l=i*o*e,h=(s-t)/e,m=1-h;return this.pending+=l*h*h*h/6,l*m*m*m/6}startCycle(){this.latch(),this.odd=!this.odd;let t=this.odd?1:-1,e=0,s=0,a=this.chaos;if(a>0){let N=(2.9+1.1*a)*this.chaosX*(1-this.chaosX);N>0&&N<1||(N=.37),this.chaosX=N;let u=N-.5;e=.45*a*u,s=1.1*a*u}let i=this.cycleS,n=0,o=0;for(let v=0;v<8;v++){i=i+1831565813|0;let N=Math.imul(i^i>>>15,i|1);N^=N+Math.imul(N^N>>>7,N|61);let u=((N^N>>>14)>>>0)/4294967296;v<4?n+=u:o+=u}this.cycleS=i;let l=(n-2)*Math.SQRT2*.875*Fa,h=(o-2)*Math.SQRT2*.875*Fa,m=1+this.jitter*l+this.diplophonia*.08*t+e;this.scale=m<.55?.55:m>1.8?1.8:m;let p=1+this.shimmer*h-(this.odd?this.diplophonia*.35:0)+s;this.amp=p>.12?p:.12}stepDrift(){this.driftCountdown=this.driftInterval;let t=this.driftS,e=0,s=0,a=0;for(let o=0;o<12;o++){t=t+1831565813|0;let l=Math.imul(t^t>>>15,t|1);l^=l+Math.imul(l^l>>>7,l|61);let h=((l^l>>>14)>>>0)/4294967296;o<4?e+=h:o<8?s+=h:a+=h}this.driftS=t;let i=Math.SQRT2*.875*Fa;this.drift0=this.driftPole0*this.drift0+this.driftIn0*(e-2)*i,this.drift1=this.driftPole1*this.drift1+this.driftIn1*(s-2)*i,this.drift2=this.driftPole2*this.drift2+this.driftIn2*(a-2)*i;let n=(this.drift0+this.drift1/2+this.drift2/3)/Vr;this.pitchFactor=Math.pow(2,this.driftCents*n/1200)}latch(){let t=this.targetFry;this.fry=t;let e=t>0?this.targetOq*(1-t)+Ur*t:this.targetOq;this.oq=e,this.invOq=1/e,this.skew=this.targetSkew,this.invSkew=1/this.targetSkew,this.invFall=1/(1-this.targetSkew),this.sharp=this.targetSharp;let s=this.sharp>0;if(this.closeFirst=s?e:2,t>.3){let a=z((t-.3)/.5,0,1);this.fryGain=Xr*a*a*(3-2*a),this.oq2=e*jr,this.invOq2=1/this.oq2,this.end2=rs+this.oq2,this.closeSecond=s?this.end2:2}else this.fryGain=0,this.end2=0,this.closeSecond=Pa}};var ke=Math.PI,Bs=1/ke,Qr=2/ke,Hi=2*ke,Gi=.1/Math.sqrt(8e3),hs=256,zs=new Float64Array(hs+2),_s=new Float64Array(hs+2);(function(){for(let t=0;t<=hs+1;t++){let e=Math.min(1,t/hs),s=ke*(1-e*e),a=1e-12,i=1;for(let o=0;o<80;o++){let l=.5*(a+i);Math.sin(ke*l)/l>s?a=l:i=l}let n=.5*(a+i);zs[t]=n,_s[t]=Math.cos(ke*n)}})();var ee=new Float64Array(3);function Vi(){let r=ee[0],t=ee[1];if(t>=0&&r>=0||t<0&&r>=-ke*t){ee[2]=.5*r+Qr*t;return}if(!(t>0&&-r<ke*t||t<0&&r>0)){ee[2]=0;return}let s=1- -r/t*Bs;s=s>0?Math.sqrt(s):0;let a=s*hs,i=a|0,n=a-i,o=zs[i]+(zs[i+1]-zs[i])*n,l=_s[i]+(_s[i+1]-_s[i])*n,h=1-o,m=r*(h-.5*h*h)+t*Bs*l;ee[2]=t>0?.5*r+t*Bs-m:m+t*Bs}var Hs=class{xRest1=.03;xRest2=.06;chink=.01;xMax=0;length=1.6;lag=70/360;skew=0;doublePulse=.05;area1=0;area2=0;r1=.03;r2=.06;ch=.01;xm=0;first=!0;reset(){this.first=!0,this.area1=this.area2=0}process(t,e,s,a){this.first&&(this.r1=this.xRest1,this.r2=this.xRest2,this.ch=this.chink,this.xm=this.xMax,this.first=!1);let i=a-s;if(i<=0)return;let n=1/i,o=this.r1,l=this.r2,h=this.ch,m=this.xm,p=this.xRest1-o,v=this.xRest2-l,N=this.chink-h,u=this.xMax-m,k=2*this.length,g=this.skew;g=g<-.9?-.9:g>.9?.9:g;let S=.25*(1+g),d=.25/S,x=.25/(.5-S),M=this.lag;M=M<0?0:M>.5?.5:M;let f=this.doublePulse;f=f<0?0:f>1?1:f;let b=1-.5*f,E=0,O=0;for(let H=s;H<a;H++){t.nextPhase();let I=(H-s+1)*n,X=m+u*I,V=t.phase,y=V<S?V*d:V<.5?.25+(V-S)*x:V,F=Math.sin(Hi*y);t.odd&&(F=b*(F+1)-1);let q=V-M,R=t.odd,_=t.amp;q<0&&(q+=1,R=!R,_=t.ampPrev),y=q<S?q*d:q<.5?.25+(q-S)*x:q;let G=Math.sin(Hi*y);R&&(G=b*(G+1)-1);let D=h+N*I;ee[0]=o+p*I,ee[1]=X*t.amp*F,Vi(),E=k*ee[2]+D,ee[0]=l+v*I,ee[1]=X*_*G,Vi(),O=k*ee[2]+D,e[H]=E<O?E:O}this.area1=E,this.area2=O,this.r1=this.xRest1,this.r2=this.xRest2,this.ch=this.chink,this.xm=this.xMax}};var Jr=1200/Math.LN2,Vs=1.6,to=3,Gs=class{target=110;measured=110;correction=1;tau=.04;pending=0;deep=1;onset=1;weight=1;restart=0;lastLog=0;farRun=0;farSide=0;reset(){this.correction=1,this.measured=this.target,this.pending=0,this.lastLog=0,this.farRun=0,this.farSide=0}cycle(){if(this.pending===0)return;this.pending=0;let t=this.measured,e=this.target;if(!(t>0)||!(e>0))return;let s=e/t,a=0;if(s>Vs||s<1/Vs){let v=s>1?1:-1;if(this.farRun=this.deep===0?0:v===this.farSide?this.farRun+1:1,this.farSide=v,this.farRun<to)return;s=Math.min(Math.max(s,1/Vs),Vs),a=1}else this.farRun=0;this.restart!==0&&(this.restart=0,this.lastLog=0);let i=Math.log(s),n=this.lastLog;this.lastLog=i;let o=i*n>0?1:0,l=i<0?-i:i,h=n<0?-n:n,m=this.deep*o*(this.onset|a)*(l<h?l:h)*Jr,p=1-Math.exp(-this.weight*(1+m/40)/(t*this.tau));this.correction=Math.min(Math.max(this.correction*Math.pow(s,p),.5),2)}};var Ui=.125,ji=.025,Xi=8e4,Yi=8e3,Wi=25e3,eo=.1,so=.6,ao=.25,io=.05,Ki=3,$i=1,Zi=158,Ia=.25,no=.2,ro=.03,qa=1.6,oo=.05,Oa=12,Us=class{ps=0;pe=0;rest1=.01;rest2=.01;chink=.01;length=1.4;rest1To=.01;rest2To=.01;chinkTo=.01;lengthTo=1.4;rampLeft=0;perturb=1;free=1;servo=new Gs;area=0;area1=0;area2=0;x1=0;x2=0;v1=0;v2=0;cycles=0;dt=0;rate=0;m1=Ui;m2=ji;k1=Xi;k2=Yi;kc=Wi;b1=0;b2=0;bh1=0;bh2=0;q=1;stale=1;n=0;lastV1=0;lastT=-1;lastVoiced=-1;onsetEnd=-1;sinceTurn=1e9;aLo=1e9;aHi=0;constructor(t){this.rate=t,this.dt=1/t}reset(){this.x1=this.x2=this.v1=this.v2=0,this.ps=this.pe=0,this.area=this.area1=this.area2=0,this.n=0,this.lastV1=0,this.lastT=-1,this.lastVoiced=-1,this.onsetEnd=-1,this.sinceTurn=1e9,this.aLo=1e9,this.aHi=0,this.cycles=0,this.rampLeft=0,this.servo.reset(),this.tune()}tune(){this.stale=1}get tension(){if(!this.stale)return this.q;let t=this.servo.target/Zi*this.servo.correction*this.perturb;return t<Ia?Ia:t>Oa?Oa:t===t?t:1}step(){if(this.rampLeft>0){let D=1/this.rampLeft;this.rest1+=(this.rest1To-this.rest1)*D,this.rest2+=(this.rest2To-this.rest2)*D,this.chink+=(this.chinkTo-this.chink)*D,this.length+=(this.lengthTo-this.length)*D,this.rampLeft--}if(this.stale){this.stale=0;let D=this.servo.target/Zi*this.servo.correction*this.perturb,Z=Math.min(Math.max(D===D?D:1,Ia),Oa);this.q=Z;let it=Math.sqrt(Z),rt=1/(Z*it);this.m1=Ui*rt,this.m2=ji*rt,this.k1=Xi*it,this.k2=Yi*it,this.kc=Wi*it,this.b1=2*eo*Math.sqrt(this.m1*this.k1),this.b2=2*so*Math.sqrt(this.m2*this.k2),this.bh1=2*$i*Math.sqrt(this.m1*this.k1),this.bh2=2*$i*Math.sqrt(this.m2*this.k2)}let t=this.length,e=2*t,s=this.rest1>0?this.rest1:0,a=this.rest2>0?this.rest2:0,i=this.x1,n=this.x2,o=0,l=0,h=0;i>=0?o=.5*s+i:s+i>0?(o=(s+i)*(s+i)/(2*s),l=i*i/(2*s),h=-i/s):(l=-(.5*s+i),h=1);let m=0,p=0,v=0;n>=0?m=.5*a+n:a+n>0?(m=(a+n)*(a+n)/(2*a),p=n*n/(2*a),v=-n/a):(p=-(.5*a+n),v=1);let N=e*o,u=e*m,k=this.ps,g=this.pe,S=k,d=g;if(N>0&&u>0)if(N>=u){let D=u/N;S=k-(k-g)*D*D}else S=g;else N>0&&(d=k);let x=this.free<0?0:this.free>1?1:this.free,M=this.k1,f=this.k2,b=this.kc,E=this.m1,O=this.m2,H=this.dt,I=x*S*t*ao-M*i-b*(i-n)+Ki*M*l,X=x*d*t*io-f*n-b*(n-i)+Ki*f*p,V=this.b1+this.bh1*h,y=this.b2+this.bh2*v,F=(this.v1+H*I/E)/(1+H*V/E),q=(this.v2+H*X/O)/(1+H*y/O);this.v1=F,this.v2=q,this.x1=i+H*F,this.x2=n+H*q;let R=this.chink>0?this.chink:0;this.area1=N+R,this.area2=u+R,this.area=(N<u?N:u)+R,this.n++;let _=this.area;this.aLo=Math.min(this.aLo,_),this.aHi=Math.max(this.aHi,_);let G=this.lastV1;if(this.lastV1=F,G>0&&F<=0){let D=this.n-1+G/(G-F),Z=D-this.lastT,it=this.aHi-this.aLo,rt=.5*(this.aHi+this.aLo);if(this.lastT>=0&&Z>1&&it>ro*rt){let et=it>no*rt?1:0;et&&((this.lastVoiced<0||D-this.lastVoiced>qa*this.rate/this.servo.target)&&(this.onsetEnd=D+oo*this.rate,this.servo.restart=1),this.lastVoiced=D),this.servo.measured=this.rate/Z,this.servo.deep=et,this.servo.onset=D<this.onsetEnd?1:0,this.servo.pending=1,this.cycles++}this.lastT=D,this.aLo=1e9,this.aHi=0}this.sinceTurn=this.lastVoiced>=0?this.n-this.lastVoiced:1e9,this.servo.cycle()}};var ls=2e3,ho=4*he*10,Da=.7,lo=.006,co=.006,js=class{pressure=0;halfWidth=0;drive=1;onset=ls;offset=Da*ls;on=0;level=0;cOn=0;cOff=0;constructor(t){this.cOn=1-Math.exp(-t/lo),this.cOff=1-Math.exp(-t/co)}reset(){this.on=0,this.level=0,this.onset=ls,this.offset=Da*ls}step(){let t=this.halfWidth>0?this.halfWidth:0,e=ls+ho*t;this.onset=e,this.offset=Da*e;let s=this.pressure;this.on===0?s>e&&(this.on=1):s<this.offset&&(this.on=0);let a=this.drive;a=a<0?0:a>1?1:a;let i=this.on*a,n=i>this.level?this.cOn:this.cOff;this.level+=n*(i-this.level)}};var Ys=0,je=1,ps=2,Ft=.00114,le=.00114*35e3,cs=1/le,No=Math.sqrt(le),Qi=Math.sqrt(Ft*186e-6*2*Math.PI*700/2),Ae=2e-4,mo=55e-8,Ji=.002,tn=.003,nt=5,Ns=3,ms=4,be=16,Ce=512,en=7,po=18,fo=25,uo=3,vo=.3,bo=6,go=3e-9,xo=10,yo=3,wo=3.5,Mo=2/Math.sqrt(Math.PI)*(.00114/186e-6),ko=1e3,Ao=1/1e3,Ro=500,So=25,Ba=.15,sn=3500,za=1,Lo=.2,an=2,Fo=3,Eo=.5,_a=.25,nn=.15,Po=1.5,Co=.5,Ha=.004,To=.5,rn=.3,Io=1.4,Oo=.37,qo=1,Do=.3,on=.8,Bo=25,zo=2,_o=70,Ho=18e3,Vo=60,hn=4,ln=6,cn=1.25,Nn=.25;function Ws(r){let t=35e3/(2*r);return cn>3.2*t?cn:3.2*t}var Go=.1,Uo=.2,jo=.03,Xo=.05,Yo=os.prototype.processArea,Xs=class{rate=0;block=0;dx=0;nMax=0;nG=0;jv=2;k=1;T=0;gridIn;gridMin;vflow;ductLen=2;ductArea=3;velum=0;pLung=0;mic=0;cheeks=0;branches=!0;piriform=0;pJa=-1;wCmA;wKsA;wIbsA;wallCheeks=-1;wallSplit=-1;pJ=-1;pG=0;pCm=0;pK=0;pDi=0;pQ=0;pY=0;pP=0;micX=0;micY=0;micC=0;agStatic=.02;closure=0;model=ps;chink=.01;foldLength=1.6;upperRest=.03;lag=70/360;skew=0;doublePulse=.05;xRel=1;restOffset=0;f0=110;teethX=30;labial=0;splitI=20;gain=1;voicing=0;dpGlottis=0;pTrans=0;pSupra=0;dpAcc=0;paAcc=0;dpSmooth=0;pSubSmooth=0;pSub=0;uLips=0;uNose=0;glottis;geometric=new Hs;folds;threshold;noiseLevel=new Float64Array(nt);noiseVelocity=new Float64Array(nt);noiseArea=new Float64Array(nt);noiseGain=new Float64Array(nt);noisePlace=new Float64Array(nt).fill(-1);R;L;sZ;isZ;Zs;area;dArea;aMin;dAMin;iaMin;viscC;perimF;wallK;moving;nMoving=0;tgt;tgtMin;slew=new Ue;kf;kb;rv;U;pn;wS;gw;wV;wY;jmList;nJm=0;gamA;ibA;bqA;dv1;dv2;dvRaw;dvCoef=0;wCm=0;wKs=0;wIbs=0;tr;na;secScratch;nodeScratch=new Int32Array(16);fBuf=new Float64Array(dt);bBuf=new Float64Array(dt);pos=0;ductTau=2;dTau=0;ductSZ=1;dDuctSZ=0;ductA=1;areaBuf;areaArgs;agSt=.02;agSt0=.02;aVib=0;aVib0=0;uG=0;momG=0;lG=0;ag=1e-4;agAcc=0;agMean=.05;agLast=0;pL=0;pL0=0;visc0=0;ldG=0;vel=0;vel0=0;velNow=0;uV=0;momV=0;lV=0;velLen=1;ulLips=0;lrLips=0;ulNose=0;pLipsOld=0;pNoseOld=0;radPrev=0;wallRadAcc=0;hpX=0;hpY=0;hpC=0;lb0=0;lb1=0;la1=0;la2=0;lx1=0;lx2=0;ly1=0;ly2=0;w=0;f0Buf=new Float64Array(1);srcExit=new Int32Array(nt).fill(-1);srcUJ=new Int32Array(nt);srcSec=new Int32Array(nt);srcCmd0=new Float64Array(nt);srcCmd1=new Float64Array(nt);nTap=new Int32Array(nt);tapJ=new Int32Array(nt*be);tapW0=new Float64Array(nt*be);tapW1=new Float64Array(nt*be);velW0=0;velW1=0;pnV=0;vF=new Float64Array(nt);vS=new Float64Array(nt);aF=new Float64Array(nt);nL=new Float64Array(nt);nL2=new Float64Array(nt);cLp2=new Float64Array(nt).fill(1);cLp=new Float64Array(nt);vAcc=new Float64Array(nt);lvAcc=new Float64Array(nt);tau0=new Float64Array(nt);tau1=new Float64Array(nt);modOn=new Float64Array(nt);ring=new Float64Array(nt*Ce);ringPos=0;tx=0;tw=0;tShare=0;vMax=0;runLo=new Int32Array(3);runHi=new Int32Array(3);runMin=new Int32Array(3);conLo=new Int32Array(3);conHi=new Int32Array(3);runSlot=new Int32Array(3);cVc=0;cVs=0;noiseScale=0;rng;seed=1;blocks=0;constructor(t,e,s){this.rate=t,this.T=1/t,this.block=Math.max(8,Math.round(32*t/48e3)),this.dx=35e3/(2*t),this.nMax=e,this.rng=s.fork(\\\"noise\\\");let a=e,i=a+1;this.gridIn=new Float64Array(a).fill(3),this.gridMin=new Float64Array(a).fill(3),this.vflow=new Float64Array(i),this.R=new Float64Array(a),this.L=new Float64Array(a),this.sZ=new Float64Array(a),this.isZ=new Float64Array(a),this.Zs=new Float64Array(a),this.area=new Float64Array(a),this.dArea=new Float64Array(a),this.aMin=new Float64Array(a),this.dAMin=new Float64Array(a),this.iaMin=new Float64Array(a),this.viscC=new Float64Array(a),this.perimF=new Float64Array(a),this.wallK=new Float64Array(a),this.moving=new Int32Array(a),this.tgt=new Float64Array(a),this.tgtMin=new Float64Array(a),this.kf=new Float64Array(i),this.kb=new Float64Array(i),this.rv=new Float64Array(i),this.U=new Float64Array(i),this.pn=new Float64Array(i),this.wS=new Float64Array(i),this.gw=new Float64Array(i),this.wCmA=new Float64Array(i),this.wKsA=new Float64Array(i),this.wIbsA=new Float64Array(i),this.wV=new Float64Array(i),this.wY=new Float64Array(i),this.jmList=new Int32Array(i),this.gamA=new Float64Array(i).fill(1),this.ibA=new Float64Array(i),this.bqA=new Float64Array(i),this.dv1=new Float64Array(i),this.dv2=new Float64Array(i),this.dvRaw=new Float64Array(i),this.dvCoef=1-Math.exp(-2*Math.PI*Vo/t),this.wCm=Qt.m*t-.5*Qt.r,this.wKs=Qt.k,this.wIbs=1/(Qt.m*t+.5*Qt.r),this.tr=new ns(hn+2),this.na=new ns(ln+5),this.secScratch=new Float64Array(Math.ceil(14*1.2/this.dx)+4),this.glottis=new os(t,s.fork(\\\"glottis\\\")),this.folds=new Us(t),this.threshold=new js(this.block/t),this.areaBuf=new Float64Array(this.block),this.areaArgs=[this.areaBuf,0,this.block],this.hpC=Math.exp(-2*Math.PI*Bo/t),this.micC=Math.exp(-2*Math.PI*_o/t);let n=Math.min(Ho,.45*t),o=Math.tan(Math.PI*n/t),l=Math.SQRT1_2,h=1/(1+o/l+o*o);this.lb0=o*o*h,this.lb1=2*this.lb0,this.la1=2*(o*o-1)*h,this.la2=(1-o/l+o*o)*h,this.noiseScale=go*Math.sqrt(t/48e3),this.cVc=1-Math.exp(-2*Math.PI*Ro/t),this.cVs=1-Math.exp(-2*Math.PI*So/t),this.configure(1,Math.min(a,30),12)}configure(t,e,s){this.k=t;let a=t*t,i=this.dx;this.nG=e<this.nMax?e:this.nMax,this.jv=s,this.slew.setScale(t),this.slew.setStep(this.block/this.rate),this.visc0=12*186e-6*rn*t*(Io*t)**2,this.ldG=Ft*rn*t,this.velLen=qo*t;let n=this.secScratch,o=this.nodeScratch,l=Math.max(6,Math.round(12*t/i));l%2&&l++,l>n.length&&(l=n.length-n.length%2);for(let N=0;N<l;N++)n[N]=2.5*a;let h=Li(l,hn,o);this.tr.configure(n,l,o,h,Ai,1,1,i,this.rate);let m=Math.max(8,Math.round(11.4*t/i));m%2&&m++,m>n.length&&(m=n.length-n.length%2);for(let N=0;N<m;N++){let u=(N+.5)/m,k=u<.18?2.6:u<.75?2-.6*(u-.18):u<.9?1.4:1;n[N]=k*a}h=0,o[h++]=0,o[h++]=2*Math.round(.18*m/2);let p=ln-3;for(let N=1;N<=p;N++)o[h++]=2*Math.round((.18+(.75-.18)*N/(p+1))*m/2);o[h++]=2*Math.round(.75*m/2),o[h++]=2*Math.round(.9*m/2),o[h++]=m;let v=1;for(let N=1;N<h;N++)o[N]>o[v-1]&&(o[v++]=o[N]);if(this.na.configure(n,m,o,v,Ri,3.2,2.5,i,this.rate),this.branches){let N=Pi(t,this.rate);this.na.addResonator(v>>1,N[0],N[1],N[2]);let u=Ei(t,this.rate);this.pJ=2<this.nG-1&&s!==2?2:-1,this.pDi=u[0],this.pG=.5*u[0],this.pCm=u[1],this.pK=u[2]}else this.pJ=-1;this.wallCheeks=-1;for(let N=0;N<this.nMax;N++)this.perimF[N]=N<s?1.25:1.5,this.wallK[N]=2*this.perimF[N]*2*Math.sqrt(Math.PI)*i,this.viscC[N]=.25*Qi*this.perimF[N]*2*Math.sqrt(Math.PI)*i/Math.pow(le,1.5);this.reset(),this.updateWalls()}updateWalls(){let t=this.cheeks<0?0:this.cheeks>1?1:this.cheeks,e=Math.ceil(this.splitI);if(t===this.wallCheeks&&e===this.wallSplit)return;this.wallCheeks=t,this.wallSplit=e;let s=this.rate,a=this.wCmA.length;for(let i=0;i<a;i++){let n=i>=e?t:0,o=Qt.m+(qs.m-Qt.m)*n,l=Qt.r+(qs.r-Qt.r)*n,h=Qt.k+(qs.k-Qt.k)*n;this.wCmA[i]=o*s-.5*l,this.wKsA[i]=h,this.wIbsA[i]=1/(o*s+.5*l)}}reset(){let t=this.k*this.k;this.tr.reset(),this.na.reset(),this.glottis.reset(),this.geometric.reset(),this.folds.reset(),this.threshold.reset(),this.pTrans=this.dpAcc=0,this.pSupra=this.paAcc=0,this.R.fill(0),this.L.fill(0),this.U.fill(0),this.pn.fill(0),this.wV.fill(0),this.wY.fill(0),this.dv1.fill(0),this.dv2.fill(0),this.dvRaw.fill(0),this.area.fill(3*t),this.aMin.fill(3*t),this.fBuf.fill(0),this.bBuf.fill(0),this.pos=0,this.uG=this.momG=this.lG=0,this.uV=this.momV=this.lV=0,this.ulLips=this.lrLips=this.ulNose=0,this.pLipsOld=this.pNoseOld=0,this.radPrev=this.wallRadAcc=0,this.hpX=this.hpY=0,this.lx1=this.lx2=this.ly1=this.ly2=0,this.voicing=0,this.dpGlottis=this.dpSmooth=0,this.pSub=this.pSubSmooth=0,this.uLips=this.uNose=0,this.micX=this.micY=0,this.pQ=this.pY=this.pP=0,this.aVib=this.aVib0=0,this.agAcc=0,this.agMean=.05,this.agLast=0,this.ag=1e-4,this.srcExit.fill(-1),this.srcUJ.fill(0),this.srcSec.fill(0),this.srcCmd0.fill(0),this.srcCmd1.fill(0),this.nTap.fill(0),this.vF.fill(0),this.vS.fill(0),this.aF.fill(0),this.nL.fill(0),this.nL2.fill(0),this.vAcc.fill(0),this.lvAcc.fill(0),this.noiseLevel.fill(0),this.noiseVelocity.fill(0),this.noiseArea.fill(0),this.noiseGain.fill(0),this.noisePlace.fill(-1),this.tau0.fill(0),this.tau1.fill(0),this.ring.fill(0),this.ringPos=0,this.velW0=this.velW1=this.pnV=0,this.seed=this.rng()*4294967296|0||1,this.blocks=0}beginBlock(){this.updateWalls(),this.pJa=this.piriform>0?this.pJ:-1;let t=this.blocks===0;this.blocks++;let e=this.block,s=this.k,a=s*s,i=this.nG,n=this.area,o=this.dArea,l=this.tgt,h=this.tgtMin,m=e/this.rate;for(let y=0;y<i;y++){let F=this.gridIn[y];l[y]=F>1e-4?F:1e-4;let q=this.gridMin[y];h[y]=q>1e-4?q:1e-4}t||(this.slew.limitAll(l,n,i),this.slew.limitAll(h,this.aMin,i));for(let y=0;y<i;y++){l[y]<1e-4&&(l[y]=1e-4);let F=h[y];F>l[y]&&(F=l[y]),h[y]=F<1e-4?1e-4:F}if(this.splitI>=0){let y=Math.floor(this.splitI-1);y=y<2?2:y>i-2?i-2:y;let F=this.vel<=Ae&&this.velum<=Ae&&this.uV<1&&this.uV>-1;(t||F)&&(this.jv=y)}let p=0;for(let y=0;y<i;y++){let F=l[y];t&&(n[y]=F);let q=F-n[y],R=q<0?-q:q,_=h[y];t&&(this.aMin[y]=_);let G=_-this.aMin[y],D=G<0?-G:G;if(R>tn*.5*(F+n[y])||D>tn*.5*(_+this.aMin[y])||G!==0&&_<.5*a)o[y]=q/e,this.dAMin[y]=G/e,this.moving[p++]=y;else{this.dAMin[y]=0,this.aMin[y]=_,this.iaMin[y]=1/_,o[y]=0,n[y]=F;let Z=Math.sqrt(le/F);this.sZ[y]=Z,this.isZ[y]=1/Z,this.Zs[y]=Z*Z}}this.nMoving=p;let v=0,N=this.dx;for(let y=1;y<i;y++){let F=y-1,q=y,R=o[F]!==0||o[q]!==0||this.dAMin[F]!==0||this.dAMin[q]!==0;R&&(this.jmList[v++]=y);let _=l[F],G=l[q],D=1/h[F]-1/G,Z=1/h[q]-1/_,it=1/h[q]-1/_,rt=1/h[F]-1/G;this.kf[y]=.5*Ft*((D>0?D*D:0)+(it>0?.1*it*it:0)),this.kb[y]=.5*Ft*((Z>0?Z*Z:0)+(rt>0?.1*rt*rt:0));let et=le/_,A=le/G,K=this.viscC[F]*et*Math.sqrt(et)+this.viscC[q]*A*Math.sqrt(A);this.rv[y]=K;let Y=.5*(_+G),pt=(y&1)===0&&Y>Ae?this.wallK[F]*Math.sqrt(Y-Ae):0;this.wS[y]=pt;let At=pt*this.wIbsA[y]+(y===this.pJa?this.pG:0);if(this.gw[y]=At,!R){let st=1/(1+et*At);this.gamA[y]=st;let _t=et*st+A+K;this.bqA[y]=_t,this.ibA[y]=1/_t}}this.nJm=v;let u=this.dvRaw;if(u.fill(0),!t)for(let y=0;y<=i;y++){let F=(y&1)===0?y:y+1<=i?y+1:y-1;u[F]+=this.vflow[y]}for(let y=0;y<=i;y++){let F=y>0?l[y-1]:this.ductArea,q=y<i?l[y]:1,R=((F>q?F:q)-.02*a)/(.1*a);R=R<0?0:R>1?1:R*R*(3-2*R),u[y]*=R}let k=this.ductLen*this.rate/35e3;t&&(this.ductTau=k),this.dTau=(k-this.ductTau)/e;let g=this.ductArea>1e-6?this.ductArea:1e-6,S=Math.sqrt(le/g);t&&(this.ductSZ=S),this.dDuctSZ=(S-this.ductSZ)/e,this.ductA=g,this.vel0=t?this.velum:this.vel,this.vel=this.velum,this.pL0=t?this.pLung:this.pL,this.pL=this.pLung;let d=this.closure<0?0:this.closure>1?1:this.closure,x=this.agStatic*(1-.92*d);this.agSt0=t?x:this.agSt,this.agSt=x;let M=1-Math.exp(-2*Math.PI*30*m);this.dpSmooth+=M*(this.dpGlottis-this.dpSmooth),this.pSubSmooth+=M*(this.pSub-this.pSubSmooth);let f=2.5*he,b=(this.dpSmooth-f*.8)/(f*.8);b=b<0?0:b>1?1:b*b*(3-2*b);let E=(this.agStatic-.0125*a-.08)/.14;E=E<0?0:E>1?1:E*E*(3-2*E);let O=1-E,H=this.model;H===ps&&(this.voicing+=(1-Math.exp(-2*Math.PI*25*m))*(b*O*(1-d)-this.voicing));let I=(this.pLung/he-3)/10;I=I<0?0:I>1?1:I,this.aVib0=this.aVib,this.aVib=.17*a*(.45+.75*I)*this.voicing,t&&(this.aVib0=this.aVib),this.placeSources(),this.agAcc=0,this.f0Buf[0]=this.f0,this.glottis.setFreqFrom(this.f0Buf,0),this.areaArgs[2]=e;let X=t?0:this.dpAcc/e,V=t?0:this.paAcc/e;this.dpAcc=0,this.paAcc=0,this.pTrans+=M*(X-this.pTrans),this.pSupra+=M*(V-this.pSupra),H===Ys?this.geometricBlock(d):H===je?this.foldBlock(d):this.pulseBlock()}pulseBlock(){Reflect.apply(Yo,this.glottis,this.areaArgs);let t=this.areaBuf,e=this.block,s=1/e,a=t[e-1];for(let i=e-1;i>=0;i--){let n=(i+1)*s,o=this.agSt0+(this.agSt-this.agSt0)*n,l=this.aVib0+(this.aVib-this.aVib0)*n,h=o+l*.5*(t[i]+(i>0?t[i-1]:this.agLast));h<1e-7&&(h=1e-7),t[i]=h}this.agLast=a}geometricBlock(t){let e=this.geometric,s=this.foldLength>.1?this.foldLength:.1,a=1-.92*t,i=(this.chink>0?this.chink:0)*a,n=this.agSt-i,o=(n>0?n:0)/s+this.restOffset,l=o+this.upperRest*a;e.length=s,e.chink=i,e.xRest1=o,e.xRest2=l,e.lag=this.lag,e.skew=this.skew,e.doublePulse=this.doublePulse;let h=this.threshold;h.pressure=this.pTrans,h.halfWidth=.25*(o+l),h.drive=1-t,h.step(),this.voicing=h.level;let m=this.pTrans>0?this.pTrans:0;e.xMax=Gi*this.xRel*Math.sqrt(m)*h.level,e.process(this.glottis,this.areaBuf,0,this.block)}foldBlock(t){let e=this.folds,s=this.foldLength>.1?this.foldLength:.1,a=1-.92*t,i=(this.chink>0?this.chink:0)*a,n=this.agSt-i,o=(n>0?n:0)/s+this.restOffset;o=o>0?o:0,this.blocks===1&&(e.rest1=o,e.rest2=o,e.chink=i,e.length=s),e.rest1To=o,e.rest2To=o,e.chinkTo=i,e.lengthTo=s,e.rampLeft=this.block,e.free=1-t,this.glottis.processPhase(this.areaBuf,0,this.block),e.servo.target=this.f0*this.glottis.pitchFactor;let l=this.pSupra/Math.max(this.pSubSmooth,he),h=Math.min(Math.max((l-Go)/Uo,0),1),m=h*h*(3-2*h),p=Math.min(Math.max((this.agSt/(this.k*this.k)-jo)/Xo,0),1),v=p*p*(3-2*p);e.servo.weight=(1-m)*(1-v),e.perturb=1/this.glottis.scale,e.tune();let N=this.f0>20?this.rate/this.f0:this.rate/20,u=e.sinceTurn<qa*N?1:0;this.voicing+=(1-Math.exp(-2*Math.PI*25*this.block/this.rate))*(u-this.voicing)}placeSources(){let t=this.pLung>0?this.pLung:-this.pLung;this.vMax=1.2*Math.sqrt(2*t/Ft)+100;let e=this.k,s=e*e,a=this.nG,i=this.tgtMin,n=this.dx,o=this.rate,l=this.block,h=this.tapW0,m=this.tapW1;for(let d=0;d<nt;d++){let x=d*be,M=0,f=0;for(let b=0;b<this.nTap[d];b++)M+=m[x+b],f+=m[x+b]*this.tapJ[x+b],h[x+b]=m[x+b],m[x+b]=0;d===ms&&(M=this.velW1),this.noiseLevel[d]=this.lvAcc[d]/l,this.noiseVelocity[d]=this.vAcc[d]/l,this.noiseArea[d]=this.aF[d],this.noiseGain[d]=M,this.noisePlace[d]=d===ms?M>0?this.jv:-1:M>0?f/M:-1,this.lvAcc[d]=0}let p=this.runLo,v=this.runHi,N=this.conLo,u=this.conHi,k=za*s,g=0;for(let d=0;d<3;d++){let x=za*s,M=-1;for(let O=0;O<a;O++){let H=i[O];if(H>=x)continue;let I=!0;for(let X=0;X<g;X++)O>=N[X]&&O<=u[X]&&(I=!1);I&&(x=H,M=O)}if(M<0)break;let f=x+Lo*s,b=M,E=M;for(;;){let O=b-1;if(O<0||i[O]>=f)break;let H=!0;for(let I=0;I<g;I++)O>=N[I]&&O<=u[I]&&(H=!1);if(!H)break;b=O}for(;;){let O=E+1;if(O>=a||i[O]>=f)break;let H=!0;for(let I=0;I<g;I++)O>=N[I]&&O<=u[I]&&(H=!1);if(!H)break;E=O}for(p[g]=b,v[g]=E,this.runMin[g]=M;b>0&&i[b-1]<k;)b--;for(;E<a-1&&i[E+1]<k;)E++;N[g]=b,u[g]=E,g++}let S=0;for(let d=0;d<g;d++){let x=v[d]+1,M=-1,f=4;for(let b=0;b<3;b++){if(S>>b&1||this.srcExit[b]<0)continue;let E=this.srcExit[b]>x?this.srcExit[b]-x:x-this.srcExit[b];E<f&&(f=E,M=b)}if(M<0)for(let b=0;b<3&&M<0;b++)!(S>>b&1)&&this.srcExit[b]<0&&this.nTap[b]===0&&(M=b);if(M<0)for(let b=0;b<3&&M<0;b++)!(S>>b&1)&&this.srcExit[b]<0&&(M=b);if(M<0)for(let b=0;b<3&&M<0;b++)S>>b&1||(M=b);S|=1<<M,this.runSlot[d]=M}for(let d=0;d<3;d++)S>>d&1||(this.srcExit[d]=-1);for(let d=0;d<g;d++){let x=this.runSlot[d],M=this.runMin[d],f=v[d]+1,b=i[M],E=this.nTap[x]===0;E&&this.freshSource(x,M),this.srcExit[x]=f,this.srcUJ[x]=M+1,this.srcSec[x]=M;let O=1e9;for(let K=N[d];K<=u[d];K++)this.gridMin[K]<O&&(O=this.gridMin[K]);this.srcCmd0[x]=E?O:this.srcCmd1[x],this.srcCmd1[x]=O;let H=(this.teethX-f)*n/e,I=H/Eo;I=I<=0?1:I>=1?0:1-I*I*(3-2*I);let X=this.labial<0?0:this.labial>1?1:this.labial,V=M+1-this.teethX;V=V<=0?0:V>=1?1:V*V*(3-2*V);let y=I*X,F=(1-y)*V;I=y+F;let q=(H-an)/(Fo-an);q=q<0?0:q>1?1:q*q*(3-2*q);let R=H/vo;R=R<=0?0:R>=1?1:R*R*(3-2*R),this.tx=f+_a*e/n,this.tw=(1-I)*(q*en+(1-q)*(1-R)*bo),this.addAt(x),this.tx=this.teethX,this.tw=(1-I)*(1-q)*R*po,this.addAt(x),this.tx=f+nn*e/n,this.tw=y*fo+F*uo,this.addAt(x);let _=this.vAcc[x]/l,G=2*Math.sqrt((b>1e-4?b:1e-4)/Math.PI),D=Ba*_/G;D=D<200?200:D>.45*o?.45*o:D,this.cLp[x]=1-Math.exp(-2*Math.PI*D/o);let Z=(1-I)*(1-q)*R,it=sn*Math.exp(Z*Math.log(.45*o/sn));it=it>.45*o?.45*o:it,this.cLp2[x]=1-Math.exp(-2*Math.PI*it/o);let rt=H>0?H*e:0,et=(1-I)*(q*_a*e+(1-q)*(R*rt+(1-R)*_a*e))+I*nn*e,A=_>1?et/(Co*_):Ha;A=(A<Ha?A:Ha)*o,this.tau0[x]=this.tau1[x],this.tau1[x]=A,this.modOn[x]=1}{let d=Ns;this.nTap[d]===0&&this.freshSource(d,0);let x=(Po*e-this.ductLen)/n;x=x<0?0:x>a?a:x,this.tx=x;let M=this.voicing;this.tw=xo*(1-M)+yo*Math.pow(e,wo)*M,this.addAt(d);let f=this.agMean>1e-4?this.agMean:1e-4,b=Ba*(this.vAcc[d]/l)/(2*Math.sqrt(f/Math.PI));b=b<200?200:b>.45*o?.45*o:b,this.cLp[d]=1-Math.exp(-2*Math.PI*b/o),this.modOn[d]=0}{let d=ms,x=this.velum;this.velW0=this.velW1,this.velW1=x>Ae&&x<za*s?en:0,this.velW0===0&&this.velW1>0&&this.freshSource(d,0);let M=2*Math.sqrt((x>1e-4?x:1e-4)/Math.PI),f=Ba*(this.vAcc[d]/l)/M;f=f<200?200:f>.45*o?.45*o:f,this.cLp[d]=1-Math.exp(-2*Math.PI*f/o),this.modOn[d]=0}for(let d=0;d<nt;d++)this.vAcc[d]=0;for(let d=0;d<nt;d++){let x=d*be,M=0;for(let f=0;f<this.nTap[d];f++)h[x+f]===0&&m[x+f]===0||(this.tapJ[x+M]=this.tapJ[x+f],h[x+M]=h[x+f],m[x+M]=m[x+f],M++);this.nTap[d]=M}}freshSource(t,e){this.vF[t]=0,this.vS[t]=0,this.nL[t]=0,this.nL2[t]=0,this.aF[t]=t<3?this.tgtMin[e]:t===Ns?this.ag:this.velum>1e-4?this.velum:1e-4,this.tau0[t]=this.tau1[t]=0,this.ring.fill(0,t*Ce,(t+1)*Ce)}addAt(t){if(!(this.tw>0))return;let s=this.nG,a=this.tx;a=a<0?0:a>s?s:a;let i=Math.floor(a),n=a-i;this.tShare=1-n,this.addTap(t,i),n>0&&i<s&&(this.tShare=n,this.addTap(t,i+1))}addTap(t,e){let s=t*be,a=this.nTap[t],i=this.tw*this.tShare;for(let n=0;n<a;n++)if(this.tapJ[s+n]===e){this.tapW1[s+n]+=i;return}a>=be||(this.tapJ[s+a]=e,this.tapW0[s+a]=0,this.tapW1[s+a]=i,this.nTap[t]=a+1)}render(t,e,s,a,i,n){let o=this.T,l=this.rate,h=this.nG,m=this.jv,p=this.R,v=this.L,N=this.sZ,u=this.isZ,k=this.Zs,g=this.area,S=this.dArea,d=this.U,x=this.pn,M=this.kf,f=this.kb,b=this.rv,E=this.viscC,O=this.wallK,H=this.gw,I=this.wV,X=this.wY,V=this.wS,y=this.moving,F=this.nMoving,q=this.jmList,R=this.nJm,_=this.gamA,G=this.ibA,D=this.bqA,Z=this.dv1,it=this.dv2,rt=this.dvRaw,et=this.dvCoef,A=this.aMin,K=this.dAMin,Y=this.iaMin,pt=this.wIbsA,At=this.wCmA,st=this.wKsA,_t=this.pJa,ge=this.pG,xe=this.pCm,Ot=this.pK,me=this.pDi,pe=this.pQ,$e=this.pY,Ze=this.pP,fe=this.fBuf,vt=this.bBuf,ht=this.tr,Kt=this.na,Rt=this.areaBuf,ue=this.folds,De=this.model===je,va=this.visc0,ba=this.ldG,Be=this.block,xs=1/Be,ga=this.gain,xa=this.mic*35e3/(2*zo),Qe=this.micC,ys=.5*le/ht.area[0],Fe=ht.nn-2,ot=Fe*dt,ws=ht.D[Fe],wt=ht.Z[Fe],te=ht.area[Fe],Ee=this.ring,qt=this.tapJ,Ms=this.tapW0,ks=this.tapW1,As=this.cVc,Je=this.cVs,ye=this.noiseScale,Rs=this.voicing,de=this.vMax,ze=0;for(let we=0;we<a;we++){let ts=i+we,ne=(ts+1)*xs;this.w=ne;for(let w=0;w<F;w++){let B=y[w],$=g[B]+S[B];g[B]=$,$<1e-4&&($=1e-4);let J=A[B]+K[B];A[B]=J,J>$&&(J=$),J<1e-4&&(J=1e-4),Y[B]=1/J;let tt=Math.sqrt($)/No,Q=1/tt;N[B]=Q,u[B]=tt,k[B]=Q*Q}for(let w=0;w<R;w++){let B=q[w],$=k[B-1],J=k[B],tt=Y[B-1]-J*cs,Q=Y[B]-$*cs,at=Y[B]-$*cs,gt=Y[B-1]-J*cs;M[B]=.5*Ft*((tt>0?tt*tt:0)+(at>0?.1*at*at:0)),f[B]=.5*Ft*((Q>0?Q*Q:0)+(gt>0?.1*gt*gt:0));let ft=E[B-1]*$*N[B-1]+E[B]*J*N[B];if(b[B]=ft,(B&1)===0){let Bt=.5*(g[B-1]+g[B]),$t=Bt>Ae?O[B-1]*Math.sqrt(Bt-Ae):0;V[B]=$t,H[B]=$t*pt[B]+(B===_t?ge:0)}let mt=$*H[B],xt=mt<.001?1-mt:1/(1+mt);_[B]=xt;let ut=$*xt+J+ft;D[B]=ut,G[B]=1/ut}this.ductTau+=this.dTau,this.ductSZ+=this.dDuctSZ;let ve=this.pL0+(this.pL-this.pL0)*ne;this.velNow=this.vel0+(this.vel-this.vel0)*ne;let re;De?(ue.step(),re=ue.area):re=Rt[ts],re<1e-7&&(re=1e-7),this.ag=re,this.agAcc+=re;let Ht=this.ringPos;for(let w=0;w<nt;w++){let B=this.nTap[w],$=w===ms;if(B===0&&!($&&(this.velW0>0||this.velW1>0)))continue;let J,tt,Q;w<3?(J=d[this.srcUJ[w]],tt=A[this.srcSec[w]],tt>g[this.srcSec[w]]&&(tt=g[this.srcSec[w]]),Q=this.srcCmd0[w]+(this.srcCmd1[w]-this.srcCmd0[w])*ne,Q>tt&&(Q=tt)):w===Ns?(J=this.uG,tt=re,Q=tt):(J=this.uV,tt=this.velNow,Q=tt);let at=(Q-2e-4)*1250;at=w===Ns?1:at<=0?0:at>=1?1:at*at*(3-2*at),tt<1e-4&&(tt=1e-4),Q<1e-4&&(Q=1e-4);let gt=this.aF[w]+As*(Q-this.aF[w]);this.aF[w]=gt;let ft=J/tt;ft=ft>de?de:ft<-de?-de:ft;let mt=this.vF[w]+As*(ft-this.vF[w]);this.vF[w]=mt;let xt=mt<0?-mt:mt;this.vAcc[w]+=xt;let ut=w*Ce;Ee[ut+Ht]=xt;let Bt=this.tau0[w]+(this.tau1[w]-this.tau0[w])*ne,$t=Bt|0,Pt=Bt-$t,zt=Ee[ut+(Ht-$t&Ce-1)]*(1-Pt)+Ee[ut+(Ht-$t-1&Ce-1)]*Pt,Vt=zt*zt*zt,Gt=this.vS[w]+Je*(Vt-this.vS[w]);this.vS[w]=Gt;let Zt=this.modOn[w]*Rs;if(Zt>0){let jt=Gt>1?Vt/Gt-1:0;jt=jt/(1+(jt<0?-jt:jt)*(1/To)),Vt=(1-Zt)*Vt+Zt*Gt*(1+jt)}let St=this.seed+1831565813|0;this.seed=St,St=Math.imul(St^St>>>15,St|1),St^=St+Math.imul(St^St>>>7,St|61);let He=(((St^St>>>14)>>>0)/4294967296*2-1)*1.7320508075688772,Ut=this.nL[w]+this.cLp[w]*(He-this.nL[w]);this.nL[w]=Ut;let ui=this.nL2[w]+this.cLp2[w]*(Ut-this.nL2[w]);this.nL2[w]=ui;let Vn=ui,di=Math.sqrt(gt),Pe=(xt*di*Mo-ko)*Ao;Pe=w===Ns?1:Pe<=0?0:Pe>=1?1:Pe*Pe*(3-2*Pe);let vi=at*Pe*Vt*di;this.lvAcc[w]+=vi;let bi=ye*vi*Vn*mt/(xt+1);if($){this.pnV=bi*(this.velW0+(this.velW1-this.velW0)*ne);continue}let Ss=w*be;for(let jt=0;jt<B;jt++)x[qt[Ss+jt]]+=bi*(Ms[Ss+jt]+(ks[Ss+jt]-Ms[Ss+jt])*ne)}this.ringPos=Ht+1&Ce-1;let Dt=this.ductTau-.5,Me=Math.floor(Dt),bt=Dt-Me,es=-bt*(bt-1)*(bt-2)/6,ya=(bt+1)*(bt-1)*(bt-2)/2,ss=-(bt+1)*bt*(bt-2)/2,_e=(bt+1)*bt*(bt-1)/6,Mt=this.pos;{let w=ht.B[Mt-ht.D[0]&dt-1],B=ht.Z[0],$=(ve-2*w)/(ys+B);ht.F[Mt]=w+B*$}ht.interior(Mt);{let w=ht.F[ot+(Mt-ws&dt-1)],B=Mt-(Me+1)&dt-1,$=this.ductSZ,J=(es*vt[B+1&dt-1]+ya*vt[B]+ss*vt[B-1&dt-1]+_e*vt[B-2&dt-1])*$,tt=$*$,Q=1/re,at=ba*Q,gt=va*Q*Q*Q,ft=Q-tt*cs,mt=Q-1/te,xt=Oo*.5*Ft*Q*Q,ut=xt+.5*Ft*(ft>0?ft*ft:0),Bt=xt+.5*Ft*(mt>0?mt*mt:0),$t=at<this.lG?at*this.uG:this.momG;this.lG=at;let Pt=2*(w-J)+$t*l,zt=wt+tt+gt+at*l,Vt=Pt>=0?2*Pt/(zt+Math.sqrt(zt*zt+4*ut*Pt)):2*Pt/(zt+Math.sqrt(zt*zt-4*Bt*Pt));this.uG=Vt,this.momG=at*Vt;let Gt=2*w-wt*Vt,Zt=2*J+tt*Vt;this.dpGlottis=Gt-Zt,this.dpAcc+=Gt-Zt,this.paAcc+=Zt,ue.ps=Gt,ue.pe=Zt,this.pSub=Gt,ht.B[ot+Mt]=Gt-w,fe[Mt]=(Zt-J)/$}for(let w=1;w<h;w+=2){if(w===m)continue;let B=w-1,$=k[B],J=k[w],tt=p[B]*N[B],Q=v[w]*N[w],at=2*(tt-Q)+x[w],gt=G[w],ft=at>=0?M[w]:f[w],mt=at<0?-at:at,xt=4*ft*mt*gt*gt,ut;if(xt<Ji)ut=at*gt*(1-.25*xt);else{let Bt=D[w];ut=2*at/(Bt+Math.sqrt(Bt*Bt+4*ft*mt))}d[w]=ut,v[B]=(tt-$*ut)*u[B],p[w]=(Q+J*ut)*u[w]}(m&1)===1&&(this.velumNode(Mt),Kt.interior(Mt),this.nostrils(Mt)),(h&1)===1&&this.lips();for(let w=2;w<h;w+=2){if(w===m)continue;let B=w-1,$=k[B],J=k[w],tt=p[B]*N[B],Q=v[w]*N[w],at=V[w],gt=At[w]*I[w]-st[w]*X[w],ft=pt[w],mt=w===_t?(.5*Ze+xe*pe-Ot*$e)*me:0,xt=Z[w]+et*(rt[w]-Z[w]);Z[w]=xt;let ut=it[w]+et*(xt-it[w]);it[w]=ut;let Bt=ut-at*gt*ft-mt,$t=_[w],Pt=2*tt*$t-2*Q+$*$t*Bt+x[w],zt=G[w],Vt=Pt>=0?M[w]:f[w],Gt=Pt<0?-Pt:Pt,Zt=4*Vt*Gt*zt*zt,St;if(Zt<Ji)St=Pt*zt*(1-.25*Zt);else{let Ut=D[w];St=2*Pt/(Ut+Math.sqrt(Ut*Ut+4*Vt*Gt))}d[w]=St;let He=(2*tt-$*(St-Bt))*$t;if(w===_t){let Ut=ge*He+mt;$e+=.5*o*(Ut+pe),pe=Ut,Ze=He}if(at>0){let Ut=(gt+He)*ft;I[w]=Ut,X[w]+=o*Ut,ze+=at*Ut*Nn}v[B]=(He-tt)*u[B],p[w]=(Q+J*St)*u[w]}(m&1)===0&&(this.velumNode(Mt),Kt.interior(Mt),this.nostrils(Mt));{let w=this.ductSZ,B=w*w,$=Mt-Me&dt-1,J=(es*fe[$+1&dt-1]+ya*fe[$]+ss*fe[$-1&dt-1]+_e*fe[$-2&dt-1])*w,tt=k[0],Q=v[0]*N[0],at=Z[0]+et*(rt[0]-Z[0]);Z[0]=at;let gt=it[0]+et*(at-it[0]);it[0]=gt;let ft=gt,mt=2*J-2*Q+B*ft+x[0];x[0]=0;let xt=mt/(B+tt);d[0]=xt;let ut=2*J-B*(xt-ft);vt[Mt]=(ut-J)/w,p[0]=(Q+tt*xt)*u[0]}(h&1)===0&&this.lips();for(let w=0;w<ms;w++){let B=w*be;for(let $=0;$<this.nTap[w];$++)x[qt[B+$]]=0}this.pnV=0,this.pos=Mt+1&dt-1;let c=this.uLips+this.uNose+this.wallRadAcc+ze;this.wallRadAcc=0,ze=0;let P=xa*c,T=P-this.micX+Qe*this.micY;this.micX=P,this.micY=T;let C=((c-this.radPrev)*l+T)*mo;this.radPrev=c;let j=C-this.hpX+this.hpC*this.hpY;this.hpX=C,this.hpY=j;let W=this.lb0*(j+this.lx2)+this.lb1*this.lx1-this.la1*this.ly1-this.la2*this.ly2;this.lx2=this.lx1,this.lx1=j,this.ly2=this.ly1,this.ly1=W;let Nt=W*ga*n[we];t[s+we]+=Nt,e[s+we]+=Nt}this.pQ=pe,this.pY=$e,this.pP=Ze,i+a>=Be&&(this.agMean=this.agAcc/Be)}lips(){let t=this.nG-1,e=this.Zs[t],s=this.R[t]*this.sZ[t],a=this.area[t]>1e-4?this.area[t]:1e-4,i=8*Ft/(3*Math.PI*Math.sqrt(Math.PI*a)),n=128*le/(9*Math.PI*Math.PI*a),o=this.ulLips,l=this.lrLips;l>0&&i>l&&(o*=l/i);let h=this.T/(2*i),m=this.pLipsOld,p=this.pn[this.nG];this.pn[this.nG]=0;let v=(2*s+p-e*(o+h*m))/(1+e*(h+1/n)),N=o+h*(m+v),u=N+v/n;this.pLipsOld=v,this.U[this.nG]=u,this.L[t]=(v-p-s)*this.isZ[t],this.ulLips=N,this.lrLips=i,this.uLips=u}nostrils(t){let e=this.na,s=e.nn-2,a=e.Z[s],i=e.F[s*dt+(t-e.D[s]&dt-1)],n=e.area[s],o=8*Ft/(3*Math.PI*Math.sqrt(Math.PI*n)),l=128*le/(9*Math.PI*Math.PI*n),h=this.T/(2*o),m=this.pNoseOld,p=(2*i-a*(this.ulNose+h*m))/(1+a*(h+1/l)),v=this.ulNose+h*(m+p);this.ulNose=v,this.pNoseOld=p,this.uNose=v+p/l,e.B[s*dt+t]=p-i}velumNode(t){let e=this.jv,s=this.R,a=this.L,i=this.sZ,n=this.isZ,o=this.Zs,l=e-1,h=e,m=this.na,p=o[l],v=o[h],N=m.Z[0],u=s[l]*i[l],k=a[h]*i[h],g=m.B[t-m.D[0]&dt-1],S=this.gw[e],d=this.dv1[e]+this.dvCoef*(this.dvRaw[e]-this.dv1[e]);this.dv1[e]=d;let x=this.dv2[e]+this.dvCoef*(d-this.dv2[e]);this.dv2[e]=x;let M=x;S>0&&(M-=this.wS[e]*(this.wCmA[e]*this.wV[e]-this.wKsA[e]*this.wY[e])*this.wIbsA[e]);let f=1/(1/p+S),b=2*u/p+M,E=this.pn[e];this.pn[e]=0;let O=this.kf[e],H=this.kb[e],I=f+v+this.rv[e],X=f*b-2*k+E,V=this.U[e],y=0,F=this.velNow;if(F>Ae){let R=1/F,_=Ft*this.velLen*R,G=Qi*2*Math.sqrt(Math.PI)*this.velLen*Math.sqrt(F)*R*R,D=R-1/m.area[0],Z=this.area[l]<this.area[h]?this.area[l]:this.area[h],it=R-1/Z,rt=Do*.5*Ft*R*R,et=rt+on*.5*Ft*(D>0?D*D:0),A=rt+on*.5*Ft*(it>0?it*it:0),K=_<this.lV?_*this.uV:this.momV;this.lV=_;let Y=f+N+G+_*this.rate,pt=f*b-2*g+K*this.rate+this.pnV;y=this.uV;for(let At=0;At<3;At++){let st=X-f*y;st>=0?V=O>0?2*st/(I+Math.sqrt(I*I+4*O*st)):st/I:V=H>0?2*st/(I+Math.sqrt(I*I-4*H*st)):st/I,st=pt-f*V,st>=0?y=et>0?2*st/(Y+Math.sqrt(Y*Y+4*et*st)):st/Y:y=A>0?2*st/(Y+Math.sqrt(Y*Y-4*A*st)):st/Y}this.momV=_*y}else{this.momV=0,this.lV=0;let R=X;R>=0?V=O>0?2*R/(I+Math.sqrt(I*I+4*O*R)):R/I:V=H>0?2*R/(I+Math.sqrt(I*I-4*H*R)):R/I}this.uV=y;let q=f*(b-V-y);if(S>0){let R=(this.wCmA[e]*this.wV[e]+q-this.wKsA[e]*this.wY[e])*this.wIbsA[e];this.wV[e]=R,this.wY[e]+=this.T*R,this.wallRadAcc+=this.wS[e]*R*Nn}this.U[e]=V,a[l]=(q-u)*n[l],s[h]=(k+v*V)*n[h],m.F[t]=g+N*y}};var Ks=[\\\"_\\\",\\\"\\\\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\\\"],Wo={\\\\u025A:\\\"\\\\u025D\\\",\\\\u0261:\\\"g\\\",r:\\\"\\\\u0279\\\",\\\\u02A7:\\\"t\\\\u0283\\\",\\\\u02A4:\\\"d\\\\u0292\\\"},Va=new Map(Ks.map((r,t)=>[r,t]));function mn(r){let t=Va.get(r);if(t!==void 0)return t;let e=Wo[r];return e===void 0?-1:Va.get(e)??-1}var Ga=1,ct={cls:\\\"vowel\\\",voiced:!0},Ko={_:{cls:\\\"silence\\\",voiced:!1},\\\\u0251:ct,\\\\u00E6:ct,\\\\u028C:ct,\\\\u0254:ct,\\\\u025B:ct,\\\\u025D:ct,\\\\u026A:ct,i:ct,\\\\u028A:ct,u:ct,e:ct,o:ct,a:ct,\\\\u0259:ct,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:ct,\\\\u0250:ct,\\\\u025C:ct,\\\\u0289:ct,\\\\u0268:ct,\\\\u0258:ct,\\\\u0275:ct,y:ct,\\\\u00F8:ct,\\\\u0153:ct,\\\\u026F:ct,\\\\u0264:ct},fs=Ks.map(r=>{let t=Ko[r];return{ipa:r,cls:t.cls,voiced:t.voiced,aspiration:t.aspiration??0,vot:t.vot??0}});var Jl=Va.get(\\\"s\\\")??-1,$o=new Uint8Array(fs.length),Zo=new Uint8Array(fs.length);fs.forEach((r,t)=>{$o[t]=r.cls===\\\"vowel\\\"||r.cls===\\\"silence\\\"?1:r.cls===\\\"approximant\\\"?2:0,Zo[t]=r.cls===\\\"stop\\\"?1:0});var Ua=[{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}],ja=Ks.length,Qo=Ua.length*2,$s=ja+Qo;var L={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},U=17,Ct=U,Xe=U+1,Zs=U+2,Re=U+3;function pn(r,t){let e=n=>typeof n==\\\"number\\\"&&Number.isFinite(n)?n:0;if(t.fill(0),t.length<U)return;let s=e(r.jawSet);t[L.jaw]=.6*s,t[L.tbX]=.6*e(r.tongueFront),t[L.tbY]=.5*e(r.tongueHigh)-.5*s;let a=e(r.lipRound);a>0?(t[L.lipProt]=.6*a,t[L.lipWidth]=-.5*a,t[L.lipAp]=-.15*a):(t[L.lipWidth]=-.6*a,t[L.lipProt]=.15*a,t[L.lipAp]=-.1*a),t[L.lipAp]+=.4*e(r.lipOpen)+.3*s;let i=e(r.throat);t[L.larynx]=.9*e(r.larynxSet)+.3*e(r.twang)-.4*(i>0?i:0),t[L.epilarynx]=.8*e(r.twang),t[L.root]=.6*i,t[L.velum]=.7*e(r.nasal)}var Xa=[-.1,1,4.8,3.5,5,0,-1,-.4,-.2,0,0,-.25,-1.6,0,0,0,0],fn=[2.6,4.8,9.2,8,10.8,1,1,2.4,1.5,1,1,1.4,1.6,1,1,1,1],Te=[10,12,12,13,13,9,9,11,11,11,10,12,8,6,6,10,9],Qs=[.6,2.9,6.85,6.45,7.3,0,0,.7,.2,.5,0,-.15,0,0,0,0,0],Yt=[\\\"_\\\",\\\"\\\\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\\\"];var Ya=[{manner:\\\"silence\\\",voiced:!1,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"stop\\\",voiced:!1,place:\\\"bilabial\\\",dominant:[7],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"stop\\\",voiced:!0,place:\\\"bilabial\\\",dominant:[7],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"stop\\\",voiced:!1,place:\\\"alveolar\\\",dominant:[3,4],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"stop\\\",voiced:!0,place:\\\"alveolar\\\",dominant:[3,4],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"stop\\\",voiced:!1,place:\\\"velar\\\",dominant:[2],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"stop\\\",voiced:!0,place:\\\"velar\\\",dominant:[2],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"fricative\\\",voiced:!1,place:\\\"labiodental\\\",dominant:[10,7],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"fricative\\\",voiced:!0,place:\\\"labiodental\\\",dominant:[10,7],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"fricative\\\",voiced:!1,place:\\\"dental\\\",dominant:[3,4],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"fricative\\\",voiced:!0,place:\\\"dental\\\",dominant:[3,4],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"fricative\\\",voiced:!1,place:\\\"alveolar\\\",dominant:[3,4,0],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"fricative\\\",voiced:!0,place:\\\"alveolar\\\",dominant:[3,4,0],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"fricative\\\",voiced:!1,place:\\\"postalveolar\\\",dominant:[3,4,0,8,9],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"fricative\\\",voiced:!0,place:\\\"postalveolar\\\",dominant:[3,4,0,8,9],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"glottal\\\",voiced:!1,place:\\\"glottal\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"open\\\"},{manner:\\\"affricate\\\",voiced:!1,place:\\\"postalveolar\\\",dominant:[3,4,8,9],release:27,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"affricate\\\",voiced:!0,place:\\\"postalveolar\\\",dominant:[3,4,8,9],release:28,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"nasal\\\",voiced:!0,place:\\\"bilabial\\\",dominant:[7],release:-1,nasal:!0,glottal:\\\"none\\\"},{manner:\\\"nasal\\\",voiced:!0,place:\\\"alveolar\\\",dominant:[3,4],release:-1,nasal:!0,glottal:\\\"none\\\"},{manner:\\\"nasal\\\",voiced:!0,place:\\\"velar\\\",dominant:[2],release:-1,nasal:!0,glottal:\\\"none\\\"},{manner:\\\"lateral\\\",voiced:!0,place:\\\"alveolar\\\",dominant:[3,4,15],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"approximant\\\",voiced:!0,place:\\\"postalveolar\\\",dominant:[3,4,5,8,9,6],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"approximant\\\",voiced:!0,place:\\\"labial-velar\\\",dominant:[7,8,9,1,2],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"approximant\\\",voiced:!0,place:\\\"palatal\\\",dominant:[1,2],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"tap\\\",voiced:!0,place:\\\"alveolar\\\",dominant:[3,4],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"glottal\\\",voiced:!1,place:\\\"glottal\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"stop\\\"},{manner:\\\"lateral\\\",voiced:!0,place:\\\"alveolar\\\",dominant:[3,4,15,1,2],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"}],Jt=[{name:\\\"male\\\",k:1,pharynxScale:1,tongueRadius:2.25,lipWidthBody:4.6,roofX:[-1.36528,-1.71909,-1.44257,-1.16605,-.88953,-.613,-.33648,-.05996,.23112,.57333,.85144,.93,1.10519,1.35681,1.618,1.86963,2.13081,2.392,2.65319,2.91437,3.166,3.40489,3.63422,3.854,4.06422,4.26489,4.456,4.63915,4.81274,4.972,5.11374,5.24115,5.359,5.46793,5.56731,5.66,5.74727,5.82786,5.9008,5.96514,6.02184,6.0728,6.12121,6.1639,6.1932],roofY:[8.50094,8.80094,8.88635,8.96813,9.04301,9.10839,9.1626,9.20506,9.24377,9.32092,9.43984,9.6,9.68519,9.80593,9.92,10.0163,10.10593,10.18,10.23667,10.27778,10.3,10.30148,10.28407,10.25,10.19926,10.13185,10.05,9.95074,9.83704,9.72,9.60037,9.47741,9.36,9.25444,9.15444,9.05,8.93815,8.82185,8.7,8.56852,8.43148,8.3,8.16667,8.03889,7.95],minLength:15.8741,neutralPharynx:8.679114,neutralLength:17.01563,vowelTargets:[[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[1.685,2.022,5.692,NaN,NaN,0,-.354,2,0,1,NaN,NaN,.217,NaN,NaN,NaN,NaN],[1.71734,4.3181,5.50464,NaN,NaN,.002,-.946147,2.19916,.0417314,1,NaN,NaN,.328,NaN,NaN,NaN,NaN],[1.02219,1.76474,6.05988,NaN,NaN,.002,.23676,.966674,-.0037729,.607,NaN,NaN,.053,NaN,NaN,NaN,NaN],[1.84396,1.3173,5.83076,NaN,NaN,0,-.851506,1.70254,.174709,.539,NaN,NaN,.175,NaN,NaN,NaN,NaN],[1.11739,3.34821,6.55346,NaN,NaN,0,-.216509,1.94745,-.0422592,1,NaN,NaN,.379,NaN,NaN,NaN,NaN],[.976,2.727,7.285,5.642,8.632,1,-.9,.654,.592,.347,NaN,NaN,-.921,NaN,NaN,NaN,NaN],[.575,3.637,7.419,NaN,NaN,0,-.001,1.154,0,1,NaN,NaN,.357,NaN,NaN,NaN,NaN],[.413,3.683,7.739,NaN,NaN,0,.514,1.046,0,1,NaN,NaN,.798,NaN,NaN,NaN,NaN],[.516,2.317,7.139,NaN,NaN,0,.478,.44,1.228,.199,NaN,NaN,.425,NaN,NaN,NaN,NaN],[.203,2.419,7.428,NaN,NaN,0,.402,.291,1.4,.065,NaN,NaN,.252,NaN,NaN,NaN,NaN],[.745,3.6,7.236,NaN,NaN,0,.269,1.315,0,1,NaN,NaN,.506,NaN,NaN,NaN,NaN],[.668,1.519,6.592,NaN,NaN,0,.227,.405,.597,.027,NaN,NaN,.061,NaN,NaN,NaN,NaN],[1.649,2.292,5.667,NaN,NaN,0,-.373,2,0,1,NaN,NaN,.37,NaN,NaN,NaN,NaN],[.505,2.944,6.685,NaN,NaN,0,.421,.323,.352,.533,NaN,NaN,.149,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,N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N,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[1.32069,1.25678,6.02835,NaN,NaN,0,-.335276,.998411,.463491,.539,NaN,NaN,.175,NaN,NaN,NaN,NaN],[.959344,1.81494,6.27513,NaN,NaN,.002,-.655744,2.0817,-.2,.607,NaN,NaN,.053,NaN,NaN,NaN,NaN],[1.04883,2.45673,6.28233,NaN,NaN,.002,.275032,.237875,-.00604252,.607,NaN,NaN,.053,NaN,NaN,NaN,NaN],[.196691,3.67139,7.59105,NaN,NaN,0,.118988,.21855,1.28252,.065,NaN,NaN,.252,NaN,NaN,NaN,NaN],[-.0486764,4.14389,6.68275,NaN,NaN,0,.363131,.0911767,1.06718,.199,NaN,NaN,.425,NaN,NaN,NaN,NaN],[.401239,2.74333,7.30483,NaN,NaN,0,.836646,.545774,.312847,1,NaN,NaN,.357,NaN,NaN,NaN,NaN],[.543948,2.70384,7.05207,NaN,NaN,0,.483956,.540973,1.24207,.199,NaN,NaN,.425,NaN,NaN,NaN,NaN],[.259827,4.68061,4.80757,NaN,NaN,0,.425163,.164055,1.5,.065,NaN,NaN,.252,NaN,NaN,NaN,NaN],[1.52518,2.84169,7.66767,NaN,NaN,0,-.71472,.755555,.744262,1,NaN,NaN,.506,NaN,NaN,NaN,NaN],[1.10488,2.15801,7.0783,NaN,NaN,0,.0687887,1.67217,.0623865,1,NaN,NaN,.379,NaN,NaN,NaN,NaN],[.255433,3.06882,6.81746,NaN,NaN,0,.522489,.0507891,1.44655,.065,NaN,NaN,.252,NaN,NaN,NaN,NaN],[.673371,1.81111,5.83671,NaN,NaN,0,.404942,.572677,.510262,.027,NaN,NaN,.061,NaN,NaN,NaN,NaN]],consonantTargets:[[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,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,0,0,0,0,0,606.4453,612.3047,612.3047,348.6328,445.3125,410.1563,445.3125,348.6328,459.9609,568.3594,348.6328,468.75],tuneSlope:[0,-29.29688,43.94531,0,-8.789063,76.17188,67.38281,143.5547,190.4297,84.96094,149.4141,120.1172,32.22656,-43.94531,14.64844,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-8.789063,0,0,149.4141,84.96094,143.5547,84.96094,149.4141,120.1172,76.17188,149.4141,32.22656],tuneJaw:[0,1.685,1.516,1.022,1.182,1.041,.976,.575,.413,.516,.203,.745,.668,1.649,.505,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.182,1.022,1.022,.203,.516,.575,.516,.203,.745,1.041,.203,.668],tuneR1Max:[0,673.8281,638.6719,597.6563,541.9922,653.3203,515.625,603.5156,574.2188,524.4141,509.7656,626.9531,498.0469,644.5313,571.2891,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,541.9922,597.6563,597.6563,509.7656,524.4141,603.5156,524.4141,509.7656,626.9531,653.3203,509.7656,498.0469]},{name:\\\"female\\\",k:.9,pharynxScale:.88,tongueRadius:2.2,lipWidthBody:4.4,roofX:[-1.22852,-1.54718,-1.29831,-1.04944,-.80057,-.5517,-.30284,-.05397,.20801,.516,.76629,.837,.99467,1.22113,1.4562,1.68267,1.91773,2.1528,2.38787,2.62293,2.8494,3.0644,3.2708,3.4686,3.6578,3.8384,4.0104,4.17523,4.33147,4.4748,4.60237,4.71703,4.8231,4.92114,5.01058,5.094,5.17255,5.24507,5.31072,5.36863,5.41965,5.46552,5.50909,5.54751,5.57388],roofY:[7.65084,7.92084,7.99772,8.07132,8.13871,8.19755,8.24634,8.28455,8.31939,8.38883,8.49586,8.64,8.71667,8.82533,8.928,9.01467,9.09533,9.162,9.213,9.25,9.27,9.27133,9.25567,9.225,9.17933,9.11867,9.045,8.95567,8.85333,8.748,8.64033,8.52967,8.424,8.329,8.239,8.145,8.04433,7.93967,7.83,7.71167,7.58833,7.47,7.35,7.235,7.155],minLength:13.424,neutralPharynx:7.089841,neutralLength:14.72364,vowelTargets:[[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[1.682,1.847,5.832,NaN,NaN,0,-.665,2,0,1,NaN,NaN,.523,NaN,NaN,NaN,NaN],[1.483,3.712,6.328,NaN,NaN,0,-.094,1.851,0,1,NaN,NaN,.854,NaN,NaN,NaN,NaN],[1.28088,1.62683,5.87387,NaN,NaN,.002,.335575,1.12359,-.0348056,1,NaN,NaN,.087,NaN,NaN,NaN,NaN],[2.18231,1.18279,5.42025,NaN,NaN,0,-.961013,2.28849,.348209,.59,NaN,NaN,.254,NaN,NaN,NaN,NaN],[1.1329,2.86028,6.55673,NaN,NaN,0,-.332378,2.22805,-.127752,1,NaN,NaN,.773,NaN,NaN,NaN,NaN],[.694,2.581,7.338,5.71,8.898,1,-.9,.657,.59,.349,NaN,NaN,-.832,NaN,NaN,NaN,NaN],[.567,3.647,7.421,NaN,NaN,0,.077,1.147,0,1,NaN,NaN,.196,NaN,NaN,NaN,NaN],[.459,3.754,7.647,NaN,NaN,0,.295,1.092,0,1,NaN,NaN,1.016,NaN,NaN,NaN,NaN],[.573,2.314,7.268,NaN,NaN,0,.255,.371,1.4,.301,NaN,NaN,.382,NaN,NaN,NaN,NaN],[.266,2.243,7.381,NaN,NaN,0,.205,.187,1.4,.301,NaN,NaN,.24,NaN,NaN,NaN,NaN],[.8,3.593,7.368,NaN,NaN,0,.08,1.369,0,1,NaN,NaN,.853,NaN,NaN,NaN,NaN],[.966,1.827,7.11,NaN,NaN,0,.221,.288,1.4,.304,NaN,NaN,.46,NaN,NaN,NaN,NaN],[1.637,2.191,5.739,NaN,NaN,0,-.407,2,0,1,NaN,NaN,.641,NaN,NaN,NaN,NaN],[.818,2.996,6.841,NaN,NaN,0,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,2.25892,6.13862,NaN,NaN,.002,.291513,.217835,.153579,1,NaN,NaN,.087,NaN,NaN,NaN,NaN],[.748835,3.88263,7.45553,NaN,NaN,0,-.373731,.0944109,.996741,.301,NaN,NaN,.24,NaN,NaN,NaN,NaN],[.530736,3.70811,5.39006,NaN,NaN,0,.457426,.114866,1.43778,.301,NaN,NaN,.382,NaN,NaN,NaN,NaN],[.638896,2.6998,7.38642,NaN,NaN,0,.281391,.975347,.239022,1,NaN,NaN,.196,NaN,NaN,NaN,NaN],[1.34709,2.70038,6.73629,NaN,NaN,0,-.953099,.366066,1.47198,.301,NaN,NaN,.382,NaN,NaN,NaN,NaN],[-.0601416,4.75205,5.57332,NaN,NaN,0,.153204,.151234,1.33915,.301,NaN,NaN,.24,NaN,NaN,NaN,NaN],[.486386,2.7133,7.67124,NaN,NaN,0,-.995394,2.03666,.823076,1,NaN,NaN,.853,NaN,NaN,NaN,NaN],[1.09814,2.26515,7.21004,NaN,NaN,0,-.0773372,1.86078,.153965,1,NaN,NaN,.773,NaN,NaN,NaN,NaN],[.0242767,2.92052,6.7245,NaN,NaN,0,.17196,.00556334,1.35377,.301,NaN,NaN,.24,NaN,NaN,NaN,NaN],[.537281,2.37085,7.18489,NaN,NaN,0,.271071,.60755,1.2741,.304,NaN,NaN,.46,NaN,NaN,NaN,NaN]],consonantTargets:[[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,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NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]],tuneR1:[0,840.8203,653.3203,741.2109,714.8438,706.0547,492.1875,468.75,416.0156,486.3281,433.5938,521.4844,521.4844,823.2422,571.2891,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,714.8438,741.2109,741.2109,433.5938,486.3281,468.75,486.3281,433.5938,521.4844,706.0547,433.5938,521.4844],tuneSlope:[0,20.50781,55.66406,49.80469,46.875,43.94531,64.45313,146.4844,193.3594,114.2578,149.4141,137.6953,82.03125,11.71875,70.3125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.875,49.80469,49.80469,149.4141,114.2578,146.4844,114.2578,149.4141,137.6953,43.94531,149.4141,82.03125],tuneJaw:[0,1.682,1.483,1.067,1.256,1.181,.694,.567,.459,.573,.266,.8,.966,1.637,.818,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.256,1.067,1.067,.266,.573,.567,.573,.266,.8,1.181,.266,.966],tuneR1Max:[0,855.4688,697.2656,817.3828,755.8594,747.0703,583.0078,659.1797,662.1094,609.375,591.7969,700.1953,621.0938,820.3125,659.1797,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,755.8594,817.3828,817.3828,591.7969,609.375,659.1797,609.375,591.7969,700.1953,747.0703,591.7969,621.0938]},{name:\\\"child\\\",k:.74,pharynxScale:.8,tongueRadius:2.15,lipWidthBody:4,roofX:[-1.01,-1.27213,-1.0675,-.86288,-.65825,-.45362,-.249,-.04437,.17103,.42426,.63006,.6882,.81784,1.00404,1.19732,1.38353,1.5768,1.77008,1.96336,2.15663,2.34284,2.51962,2.68932,2.85196,3.00752,3.15602,3.29744,3.43297,3.56143,3.67928,3.78417,3.87845,3.96566,4.04627,4.11981,4.1884,4.25298,4.31262,4.36659,4.4142,4.45616,4.49387,4.5297,4.56128,4.58297],roofY:[6.29069,6.51269,6.5759,6.63642,6.69183,6.74021,6.78032,6.81174,6.84039,6.89748,6.98548,7.104,7.16704,7.25639,7.3408,7.41206,7.47839,7.5332,7.57513,7.60556,7.622,7.6231,7.61021,7.585,7.54745,7.49757,7.437,7.36355,7.27941,7.1928,7.10427,7.01328,6.9264,6.84829,6.77429,6.697,6.61423,6.52817,6.438,6.3407,6.2393,6.142,6.04333,5.94878,5.883],minLength:11.4771,neutralPharynx:5.801429,neutralLength:12.3134,vowelTargets:[[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[1.905,1.651,6.308,NaN,NaN,0,-.9,2,.361,.952,NaN,NaN,-.353,NaN,NaN,NaN,NaN],[1.367,3.496,6.678,NaN,NaN,0,-.534,1.601,.356,.548,NaN,NaN,-.23,NaN,NaN,NaN,NaN],[1.27917,1.94179,7.10892,NaN,NaN,0,-1,.468459,.334422,.516,NaN,NaN,-.157,NaN,NaN,NaN,NaN],[1.60487,1.06182,6.66595,NaN,NaN,0,-.481291,.829557,1.11712,.461,NaN,NaN,-.049,NaN,NaN,NaN,NaN],[1.35086,3.05085,7.03165,NaN,NaN,0,-.960103,1.63754,.550585,.548,NaN,NaN,-.168,NaN,NaN,NaN,NaN],[.05,1.859,7,5.722,9.357,1,-.9,.12,1.4,.214,NaN,NaN,-1.288,NaN,NaN,NaN,NaN],[.489,3.381,7.692,NaN,NaN,0,.005,.366,.001,.55,NaN,NaN,-.025,NaN,NaN,NaN,NaN],[.096,3.719,7.754,NaN,NaN,.001,.095,.386,.004,.655,NaN,NaN,-.001,NaN,NaN,NaN,NaN],[.498,2.338,7.482,NaN,NaN,0,-.498,.335,.6,.279,NaN,NaN,-.249,NaN,NaN,NaN,NaN],[.162,2.324,7.563,NaN,NaN,0,-.646,.301,.637,.054,NaN,NaN,-.327,NaN,NaN,NaN,NaN],[.676,3.477,7.552,NaN,NaN,0,-.219,.717,.351,.55,NaN,NaN,-.14,NaN,NaN,NaN,NaN],[.78,1.814,7.259,NaN,NaN,0,-.566,.131,1.241,.301,NaN,NaN,-.209,NaN,NaN,NaN,NaN],[1.816,2.008,6.239,NaN,NaN,0,-.753,2,.042,1,NaN,NaN,-.092,NaN,NaN,NaN,NaN],[.804,2.698,7.382,NaN,NaN,0,-.503,.569,.359,.535,NaN,NaN,-.379,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,N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N,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[1.19584,1.005,6.15846,NaN,NaN,0,-.461571,.918682,1.45202,.461,NaN,NaN,-.049,NaN,NaN,NaN,NaN],[.826508,1.53041,6.55857,NaN,NaN,0,-.117684,.884437,.373767,.516,NaN,NaN,-.157,NaN,NaN,NaN,NaN],[.655674,2.67915,7.45479,NaN,NaN,0,-.133794,.34988,.797836,.516,NaN,NaN,-.157,NaN,NaN,NaN,NaN],[.133509,3.13399,7.96958,NaN,NaN,0,-.991959,.561642,.399755,.054,NaN,NaN,-.327,NaN,NaN,NaN,NaN],[.439487,3.18761,7.94796,NaN,NaN,0,-.410189,.694782,.496471,.279,NaN,NaN,-.249,NaN,NaN,NaN,NaN],[.747307,3.0391,7.41261,NaN,NaN,0,.0226394,.228696,.183817,.55,NaN,NaN,-.025,NaN,NaN,NaN,NaN],[.504898,2.38409,7.58125,NaN,NaN,0,-.987977,1.11439,.843035,.279,NaN,NaN,-.249,NaN,NaN,NaN,NaN],[.39757,3.4521,8.0045,NaN,NaN,0,-.998927,.733525,.365173,.054,NaN,NaN,-.327,NaN,NaN,NaN,NaN],[1.00669,3.33113,7.16419,NaN,NaN,0,.0409327,.0676099,.618111,.55,NaN,NaN,-.14,NaN,NaN,NaN,NaN],[1.19737,2.32862,7.48863,NaN,NaN,0,-.922591,1.1836,.179866,.548,NaN,NaN,-.168,NaN,NaN,NaN,NaN],[.179337,2.6655,7.85598,NaN,NaN,0,-.87943,.748314,.52383,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,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]],tuneR1:[0,972.6563,700.1953,717.7734,758.7891,717.7734,489.2578,483.3984,421.875,533.2031,462.8906,536.1328,544.9219,978.5156,626.9531,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,758.7891,717.7734,717.7734,462.8906,533.2031,483.3984,533.2031,462.8906,536.1328,717.7734,462.8906,544.9219],tuneSlope:[0,-46.875,55.66406,84.96094,-14.64844,26.36719,29.29688,166.9922,213.8672,172.8516,213.8672,125.9766,102.5391,-49.80469,120.1172,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-14.64844,84.96094,84.96094,213.8672,172.8516,166.9922,172.8516,213.8672,125.9766,26.36719,213.8672,102.5391],tuneJaw:[0,1.905,1.367,.861,1.408,1.071,.05,.489,.096,.498,.162,.676,.78,1.816,.804,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.408,.861,.861,.162,.498,.489,.498,.162,.676,1.071,.162,.78],tuneR1Max:[0,893.5547,767.5781,779.2969,750,723.6328,489.2578,676.7578,682.6172,697.2656,667.9688,682.6172,650.3906,899.4141,741.2109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,750,779.2969,779.2969,667.9688,697.2656,676.7578,697.2656,667.9688,682.6172,723.6328,667.9688,650.3906]}];var Se=5.83392170191739;var o0=2*Math.PI*10;var Wt=r=>Ua.findIndex(t=>t.id===r),Jo=Wt(\\\"B\\\"),us=Wt(\\\"t\\\"),th=Wt(\\\"tss\\\"),un=Wt(\\\"Pf\\\"),eh=Wt(\\\"K\\\"),sh=Wt(\\\"^K\\\"),ah=Wt(\\\"!\\\"),ih=Wt(\\\"P!\\\"),nh=Wt(\\\"kch\\\"),dn=Wt(\\\"m\\\"),rh=Wt(\\\"ch\\\"),oh=Wt(\\\"Psh\\\"),vn=Wt(\\\"in\\\"),hh=7.7,lh=.025,ch=.5,Nh=.18,Wa=Yt.indexOf(\\\"p\\\"),Ka=Yt.indexOf(\\\"t\\\"),Ie=Yt.indexOf(\\\"k\\\"),bn=Yt.indexOf(\\\"s\\\"),mh=Yt.indexOf(\\\"f\\\"),$a=Yt.indexOf(\\\"\\\\u0283\\\"),ph=Yt.indexOf(\\\"m\\\");function xn(r,t,e,s,a){let i=t>>1,n=(t&1)===1?1.3:1,o=i===dn||i===vn;r.begin();for(let h=0;h<U;h++){if(h===L.velum)continue;let m=r.schwaTarget(h);h===L.tbY?m+=.1:h===L.jaw?m=.4:h===L.lipAp?m=.25:h===L.lipProt&&(m=.1),r.key(h,m)}r.emit(a?e-.15:e,e+s,.03,.03,1,0),o||(r.begin(),r.key(L.velum,r.schwaTarget(L.velum)),r.emit(a?e-.15:e-.02,e+s,.03,.03,4,0));let l=NaN;if(i===Jo)r.beatOral(Wa,e-.075,e,2,3.5,.01,l,!1,L.jaw,.3,-1,0,!1),Za(r,L.tbY,hh,e-.09,e+.01,.03,.04,2),gn(r,e-.075,e,n);else if(i===us||i===rh){let h=i===us?bn:$a,m=i===us?.03:.05;r.beatOral(Ka,e-.05,e,2,3.5,.01,l,!1,L.jaw,.3,-1,0,!1),r.beatOral(h,e+.012,e+m,1.6,0,0,.008,!1,-1,0,-1,0,!1),Js(r,e-.03,e+m-.004,(i===us?1.25:1.3)*n,i===us?.36:.38,.02)}else if(i===th){let h=Math.max(.09,Math.min(.26,s*1.6));r.beatOral(Ka,e-.05,e,2,3.5,.01,l,!1,L.jaw,.3,-1,0,!1),r.beatOral(bn,e+.012,e+h,1.4,0,0,.008,!1,-1,0,-1,0,!1),Js(r,e-.03,e+h,1.2*n,.4,.09)}else if(i===un||i===oh){let h=i===un;r.beatOral(Wa,e-.06,e,2,3.5,.01,l,!1,-1,0,-1,0,!1),r.beatOral(h?mh:$a,e+.018,e+(h?.08:.11),h?1.6:1.5,0,0,.008,!1,-1,0,-1,0,!1),Js(r,e-.045,e+(h?.075:.1),1.7*n,.45,h?.04:.05)}else if(i===eh)r.beatOral(Ie,e-.08,e,2,4,.008,l,!1,L.jaw,.35,-1,0,!1),gn(r,e-.08,e,n);else if(i===sh)r.beatOral(Ie,e-.06,e,2,4,.008,l,!1,L.jaw,.35,-1,0,!1),r.beatOral(Ie,e+.012,e+.085,1.4,0,0,.008,!0,L.tbY,r.xTbY-.015,-1,0,!1),r.begin(),r.key(Ct,.5),r.emit(e-.05,e+.085,.02,.04,6,0),r.begin(),r.key(Re,-1.7*n),r.emit(e-.035,e+.085,.015,.05,2,0);else if(i===ah)r.beatOral(Ka,e-.12,e,2,3.5,.01,l,!1,-1,0,-1,0,!0),r.beatOral(Ie,e-.12,e+.035,2,0,0,l,!1,L.tbY,7.85,L.jaw,.4,!1),Za(r,L.dorsum,1,e-.03,e+.006,.04,.03,2);else if(i===ih){r.beatOral(Wa,e-.12,e,2,5,.006,l,!1,L.lipAp,-.08,-1,0,!1),r.beatOral(Ie,e-.12,e+.03,2,0,0,l,!1,-1,0,-1,0,!1),r.begin(),r.key(L.jaw,1.6),r.key(L.dorsum,1);let h=r.emit(e-.07,e+.004,.04,.05,40,2);h>=0&&r.rank(h,2)}else if(i===nh){let h=Math.max(.14,Math.min(.34,s*2));r.beatOral(Ie,e-.06,e,2,4,.008,l,!1,-1,0,-1,0,!1),r.beatOral(Ie,e+.002,e+.045,2,0,0,.008,!0,L.tbY,r.xTbY,-1,0,!1),r.beatOral($a,e+.025,e+h,1.4,0,0,.008,!1,-1,0,-1,0,!1),Js(r,e-.035,e+h,1.75*n,.45,.14)}else if(i===dn){let h=Math.max(.06,s*.92);r.beatOral(ph,e-.03,e+h,1.6,0,0,l,!1,-1,0,-1,0,!1),r.begin(),r.key(L.velum,.9),r.emit(e-.02,e+h,.03,.03,4,0),r.begin(),r.key(Ct,.3),r.emit(e-.08,e-.03,.02,.02,5,0),r.begin(),r.key(Re,.95*n),r.emit(e-.01,e+h,.02,.04,1,0)}else if(i===vn){let h=Math.max(.12,s);Za(r,L.jaw,.95,e-.04,e+h-.05,.05,.06,1.2),r.begin(),r.key(L.lipAp,.9),r.key(L.velum,.5),r.emit(e-.04,e+h-.05,.05,.06,4,0),r.begin(),r.key(Ct,Nh),r.emit(e-.03,e+h,.03,.05,8,0),r.begin(),r.key(Re,-ch*n),r.emit(e,e+h-.04,.06,.05,2,0)}}function Za(r,t,e,s,a,i,n,o){r.begin(),r.key(t,e);let l=r.emit(s,a,i,n,40,o);l>=0&&r.rank(l,o)}function gn(r,t,e,s){r.begin(),r.key(Xe,1),r.emit(t-.012,e+.03,.012,.03,8,0),r.begin(),r.key(L.larynx,Math.min(1.6,1.25+.3*s));let a=r.emit(e-.05,e+lh,.03,.08,40,3);a>=0&&r.rank(a,3)}function Js(r,t,e,s,a,i){r.begin(),r.key(Ct,a),r.emit(t,e+i+.02,.02,.03,6,0),r.begin(),r.key(Re,s),r.emit(t-.01,e,.02,i,1,0)}var ta=U+4,fh=.08,uh=Yt.length,aa=0,ae=1,Ye=2,ia=3,vs=4,bs=5,ei=6,si=7,na=8,dh=9,gs=10,vh={silence:aa,vowel:ae,stop:Ye,fricative:ia,affricate:vs,nasal:bs,approximant:ei,lateral:si,tap:na,glottal:dh},bh={bilabial:0,labiodental:1,dental:2,alveolar:3,postalveolar:4,retroflex:5,palatal:6,velar:7,uvular:8},qe=uh;if(qe!==ja)throw new Error(\\\"vocal planner: the beats must follow the table phonemes\\\");var ie=$s,yt=new Uint8Array(ie),ai=new Uint8Array(ie),ce=new Int8Array(ie).fill(-1),ii=new Uint8Array(ie),wn=new Uint8Array(ie),Mn=new Uint8Array(ie),kn=new Int16Array(ie).fill(-1),ra=new Int32Array(ie),ni=new Uint8Array(ie),ri=new Uint8Array(ie);for(let r=qe;r<ie;r++)yt[r]=gs;var Qa=Yt.indexOf(\\\"\\\\u0259\\\"),Ja=[7.365,7.43,7.499],gh=.45,xh=.35;for(let r=0;r<qe;r++){let t=Ya[r];yt[r]=vh[t.manner],ai[r]=t.voiced?1:0,ce[r]=bh[t.place]??-1,ii[r]=t.place===\\\"alveolar\\\"?1:0,wn[r]=t.nasal?1:0,Mn[r]=t.glottal===\\\"open\\\"?1:t.glottal===\\\"stop\\\"?2:t.glottal===\\\"breathy\\\"?3:0,kn[r]=t.release;let e=0;for(let i of t.dominant)e|=1<<i;ra[r]=e;let s=1<<L.tbX|1<<L.tbY|1<<L.root,a=1<<L.lipAp|1<<L.labiodental;ni[r]=e!==0&&(e&~s)===0?1:0,ri[r]=e!==0&&(e&~a)===0?1:0}var ti=32,Et=256,se=12,ea=.003,yh=1.5,yn=.06,ds=127,sa=.05,oa=class{segIdx=new Int16Array(ti);segT0=new Float64Array(ti);segCount=0;droppedVowel=!1;end=1/0;gT0=new Float64Array(Et);gT1=new Float64Array(Et);gRi=new Float64Array(Et);gRo=new Float64Array(Et);gStr=new Float64Array(Et);gSpeed=new Float64Array(Et);gHold=new Float64Array(Et);gRet=new Float64Array(Et);gRank=new Int8Array(Et);gLead=new Float64Array(Et*se);gLeadMin=new Float64Array(Et);gLeadMax=new Float64Array(Et);gKeyCount=new Uint8Array(Et);gKeys=new Uint8Array(Et*se);gVals=new Float64Array(Et*se);gCount=0;vowelT=new Float64Array(qe*U);consT=new Float64Array(qe*U);kTmp=new Uint8Array(ta);vTmp=new Float64Array(ta);nTmp=0;target=new Float64Array(U);speed=new Float64Array(U);abduction=0;closure=0;stiffness=0;breath=1;beat=0;held=new Float64Array(U);xTbY=Ja[0];beatT=new Float64Array(U);at=0;restX=0;restY=0;silent=0;vowel=-1;wsum=new Float64Array(ta);vsum=new Float64Array(ta);rankA=new Int8Array(U);rankF=new Int8Array(U);rankR=new Int8Array(U);speedA=new Float64Array(U);speedR=new Float64Array(U);constructor(){this.setBody(0)}setBody(t){let e=t>0?t<2?t:2:0,s=Math.floor(e)<2?Math.floor(e):1,a=e-s,i=Jt[s],n=Jt[s+1];this.xTbY=Ja[s]*(1-a)+Ja[s+1]*a;for(let o=0;o<qe;o++)for(let l=0;l<U;l++)this.vowelT[o*U+l]=i.vowelTargets[o][l]*(1-a)+n.vowelTargets[o][l]*a,this.consT[o*U+l]=i.consonantTargets[o][l]*(1-a)+n.consonantTargets[o][l]*a;this.rebuild()}clear(){this.segCount=0,this.gCount=0,this.droppedVowel=!1,this.end=1/0}addNow(t,e){for(let a=0;a<this.segCount;a++)if(this.segIdx[a]===t&&Math.abs(this.segT0[a]-e)<=ea)return;let s=this.segCount;if(!(s>0&&this.segIdx[s-1]===t&&this.segT0[s-1]<e-ea&&yt[t]!==gs)){for(;this.segCount>0&&this.segT0[this.segCount-1]>=e-ea;)this.segCount--;this.push(t,e),this.rebuild()}}addUpcoming(t,e){for(let s=0;s<this.segCount;s++)if(Math.abs(this.segT0[s]-e)<=ea){this.segIdx[s]=t,this.rebuild();return}this.push(t,e),this.rebuild()}setEnd(t){for(this.end=t;this.segCount>0&&this.segT0[this.segCount-1]>=t;)this.segCount--;this.rebuild()}forget(t){let e=0;for(;e+2<this.segCount&&this.segT0[e+2]<t-yh;)e++;if(e!==0){for(let s=0;s<e;s++)yt[this.segIdx[s]]===ae&&(this.droppedVowel=!0);this.segIdx.copyWithin(0,e,this.segCount),this.segT0.copyWithin(0,e,this.segCount),this.segCount-=e,this.rebuild()}}push(t,e){this.segCount===ti&&(yt[this.segIdx[0]]===ae&&(this.droppedVowel=!0),this.segIdx.copyWithin(0,1),this.segT0.copyWithin(0,1),this.segCount--);let s=this.segCount;for(;s>0&&this.segT0[s-1]>e;)s--;for(let a=this.segCount;a>s;a--)this.segIdx[a]=this.segIdx[a-1],this.segT0[a]=this.segT0[a-1];this.segIdx[s]=t,this.segT0[s]=e,this.segCount++}t1(t){return t+1<this.segCount?this.segT0[t+1]:this.end}segmentAt(t){let e=-1;for(let s=0;s<this.segCount&&this.segT0[s]<=t;s++)e=s;return e}phonemeOf(t){return this.segIdx[t]}vowelAt(t){for(let e=0;e<this.segCount;e++)if(yt[this.segIdx[e]]===ae&&this.t1(e)>t)return this.segIdx[e];return-1}beatAt(t){let e=this.segmentAt(t),s=e>=0?e:this.segCount>0?0:-1;return s>=0&&yt[this.segIdx[s]]===gs}silentAt(t){let e=this.segmentAt(t);return e>=0&&yt[this.segIdx[e]]===aa}queryNow(){let t=this.at,e=-1,s=-1;for(let a=0;a<this.segCount;a++){let i=this.segT0[a],n=this.segIdx[a];i<=t&&(e=a);let o=a+1<this.segCount?this.segT0[a+1]:this.end;s<0&&yt[n]===ae&&o>t&&(s=n)}this.silent=e>=0&&yt[this.segIdx[e]]===aa?1:0,this.vowel=s}begin(){this.nTmp=0}key(t,e){e===e&&(this.kTmp[this.nTmp]=t,this.vTmp[this.nTmp]=e,this.nTmp++)}emit(t,e,s,a,i,n){if(this.nTmp===0||this.gCount===Et)return-1;let o=this.gCount++;this.gT0[o]=t,this.gT1[o]=e,this.gRi[o]=s,this.gRo[o]=a,this.gStr[o]=i,this.gSpeed[o]=n,this.gHold[o]=0,this.gRet[o]=0,this.gRank[o]=-1;let l=this.nTmp<se?this.nTmp:se;this.gKeyCount[o]=l;let h=1/0,m=-1/0;for(let p=0;p<l;p++){let v=this.kTmp[p];this.gKeys[o*se+p]=v,this.gVals[o*se+p]=this.vTmp[p];let N=v<U?wh*Se/(2*Math.PI*Te[v]*(n>0?n:1)):0;this.gLead[o*se+p]=N,N<h&&(h=N),N>m&&(m=N)}return this.gLeadMin[o]=h,this.gLeadMax[o]=m,this.nTmp=0,o}oral(t,e,s,a,i,n){let o=this.consT,l=ra[t],h=ni[t]===1,m=h?1+(i-1)*.35:i,p=yt[t],v=p===Ye||p===bs||p===vs,N=ri[t]===1,u=v?h?.039:N?.025:.024:0,k=v?h?.024:N?.022:.031:.008;this.begin();let g=v&&ce[t]===0;for(let f=0;f<U;f++)l&1<<f&&this.key(f,g&&f===L.lipAp?oi:o[e+f]);let S=this.emit(s-k,Math.max(s+.01,a-u),.03,h?.03:.018,40,m);if(S>=0){let f=h?1+(n-1)*.35:n,b=0;for(let E=0;E<U;E++)l&1<<E&&Te[E]>b&&(b=Te[E]);this.gRet[S]=f,this.gHold[S]=Se/(2*Math.PI*(b>0?b:10)*f),this.gRank[S]=(v?0:16)+(ce[t]>=0?ce[t]:0)}let d=o[e+L.tbX]===o[e+L.tbX];ii[t]===1&&!d&&(v||p===ia||p===na)&&(this.begin(),this.key(L.tbX,3.2),this.key(L.tbY,7.4),this.emit(s,a,.05,.05,1.2,0)),this.begin();let M=NaN;for(let f=0;f<U;f++){if(l&1<<f)continue;let b=o[e+f];b===b&&(h&&f===L.tbX?M=b:this.key(f,b))}this.emit(s,a,.05,.05,2.2,0),M===M&&(this.begin(),this.key(L.tbX,M),this.emit(s,a,.05,.05,.25,0))}rebuild(){this.gCount=0;let t=this.segCount,e=-1;for(let a=0;a<t;a++){let i=this.segIdx[a];if(yt[i]!==ae)continue;let n=this.segT0[a],o=this.t1(a),l=-1;for(let N=a+1;N<t;N++)if(yt[this.segIdx[N]]===ae){l=N;break}let h=e>=0?this.t1(e):n-.08,m=Math.max(.03,.75*(n-h))+.01,p=l>=0?Math.max(.03,.4*(this.segT0[l]-o))+.01:.042,v=i*U;this.begin();for(let N=0;N<U;N++)this.key(N,this.vowelT[v+N]);this.emit(n,o,m,p,1,0),e=a}let s=t;if(this.droppedVowel)s=-1;else for(let a=0;a<t;a++)if(yt[this.segIdx[a]]===ae){s=a;break}for(let a=0;a<t;a++){let i=this.segIdx[a],n=yt[i];if(n===ae||n===aa)continue;if(n===gs){let N=this.t1(a);xn(this,i-qe,this.segT0[a],N<1/0?N-this.segT0[a]:.25,a===0);continue}let o=this.gCount,l=this.segT0[a],h=this.t1(a),m=h-l,p=i*U;if(n===Ye){let N=!1;if(a>1){let u=this.segIdx[a-1],k=this.segIdx[a-2];if(yt[u]===Ye&&ce[u]>=0&&ce[u]<ce[i]){N=!0;let g=ra[i];for(let S=0;S<U;S++){let d=this.consT[k*U+S];g&1<<S&&d!==d&&(N=!1)}}}this.oral(i,p,N?l+Math.min(.025,Math.max(0,m-.03)):l,h,1.55,Oe[i]),ai[i]===1&&(this.begin(),this.key(L.larynx,this.vowelT[Qa*U+L.larynx]-gh),this.key(L.root,this.vowelT[Qa*U+L.root]+xh),this.emit(l+.15*m,h,.03,.04,3,0))}else if(n===bs)this.oral(i,p,l,h,1.55,Oe[i]);else if(n===na)this.oral(i,p,l,h,2.8,Oe[i]);else if(n===vs){let N=l+m*.55;this.oral(i,p,l,N,2,Oe[i]);let u=kn[i];u>=0&&this.oral(i,u*U,N+.008,h,1.4,Oe[u])}else(n===ia||n===ei||n===si)&&this.oral(i,p,l,h,1.3,Oe[i]);wn[i]&&(this.begin(),this.key(L.velum,.45),this.emit(l-.02,h-.02,.05,.03,4,0));let v=Mn[i];if(this.begin(),v===1)this.key(Ct,.33),this.emit(l-.01,h,.03,.035,5,0);else if(v===2)this.key(Xe,1),this.emit(l,h,.012,.015,8,0);else if(v===3)this.key(Ct,.1),this.emit(l,h,.03,.03,5,0);else if(ai[i]===0)if(n===Ye||n===vs){let N=a+1<t&&yt[this.segIdx[a+1]]===ae,u=a>0&&Yt[this.segIdx[a-1]]===\\\"s\\\",k=N&&!u;this.key(Ct,k?.36:.22);let g=k?Math.max(.02,Mh[i]-.05):.0048;this.emit(l+.25*m,h+g,.035,k?.045:.02,6,0),this.stiffen(l+.25*m,h+g+(k?.045:.02))}else this.key(Ct,.3),this.emit(l-.015,h+.005,.03,.03,6,0),this.stiffen(l-.015,h+.035);else n===ia&&(this.key(Ct,.035),this.emit(l,h,.03,.03,3,0));if(a===0&&a<s)for(let N=o;N<this.gCount;N++){let u=this.gKeyCount[N],k=!1;for(let g=0;g<u;g++)this.gKeys[N*se+g]>=Ct&&(k=!0);k||(this.gT0[N]-=yn,this.gRi[N]+=.5*yn)}}if(this.end<1/0){let a=t>0?this.segIdx[t-1]:0,i=yt[a],n=i===ae||i===bs||i===ei||i===si||i===na;this.begin(),this.key(Ct,.22),this.emit(this.end+(n?.045:.015),this.end+.1,.03,.06,6,0)}}evaluate(t,e,s){this.at=t,this.restX=e,this.restY=s,this.evaluateNow()}evaluateNow(){let t=this.at,e=this.restX,s=this.restY,a=this.wsum,i=this.vsum,n=this.speed,o=this.rankA,l=this.rankR,h=this.speedA,m=this.speedR;a.fill(0),i.fill(0);let p=this.held;p.fill(0);let v=this.rankF;o.fill(ds),v.fill(ds),l.fill(ds),h.fill(1),m.fill(1);for(let f=0;f<this.gCount;f++){let b=this.gRank[f];if(b<0)continue;let E=this.gT0[f]-this.gRi[f],O=this.gT1[f],H=O+this.gRo[f]+this.gHold[f];if(t+this.gLeadMax[f]<=E||t+this.gLeadMin[f]>H)continue;let I=this.gKeyCount[f],X=f*se;for(let V=0;V<I;V++){let y=t+this.gLead[X+V];if(y<=E||y>H)continue;let F=y<O,q=F?this.gSpeed[f]:this.gRet[f],R=this.gKeys[X+V];F?((b<o[R]||b===o[R]&&q>h[R])&&(o[R]=b,h[R]=q),y>=this.gT0[f]&&b<v[R]&&(v[R]=b)):(b<l[R]||b===l[R]&&q>m[R])&&(l[R]=b,m[R]=q)}}for(let f=0;f<U;f++)n[f]=o[f]!==ds?h[f]:l[f]!==ds?m[f]:1;for(let f=0;f<this.gCount;f++){let b=this.gT0[f]-this.gRi[f],E=this.gT0[f],O=this.gT1[f],H=this.gRi[f]>1e-6?this.gRi[f]:1e-6,I=this.gRo[f];if(t+this.gLeadMax[f]<=b||t+this.gLeadMin[f]>=O+I)continue;let X=this.gStr[f],V=this.gRank[f],y=this.gKeyCount[f],F=f*se,q=t+this.gLeadMin[f]>=E&&t+this.gLeadMax[f]<=O;for(let R=0;R<y;R++){let _=t+this.gLead[F+R];if(_<=b||_>=O+I)continue;let G=this.gKeys[F+R];if(V>=0&&_<O&&G<U&&V>v[G])continue;let D=1;q||(_<E?D=.5-.5*Math.cos(Math.PI*(_-b)/H):_>O&&(D=.5+.5*Math.cos(Math.PI*(_-O)/(I>1e-6?I:1e-6))));let Z=D*X;a[G]+=Z,i[G]+=Z*this.gVals[F+R],V>=0&&G<U&&D>p[G]&&(p[G]=D)}}let N=this.target;for(let f=0;f<U;f++){let b=f===L.ttX?e:f===L.ttY?s:kh[f],E=b;a[f]>0&&(f===L.velum?E=b+Math.min(1,a[f]/2)*(i[f]/a[f]-b):E=(b*sa+i[f])/(sa+a[f])),N[f]=E}let u=a[Ct];this.abduction=u>0?i[Ct]/u*Math.min(1,u/2):0;let k=a[Xe];this.closure=k>0?i[Xe]/k*Math.min(1,k/2):0;let g=a[Zs];this.stiffness=g>0?i[Zs]/g*Math.min(1,g):0;let S=-1;for(let f=0;f<this.segCount&&this.segT0[f]<=t;f++)S=f;S<0&&this.segCount>0&&(S=0);let d=S>=0&&yt[this.segIdx[S]]===gs;this.beat=d?1:0;let x=d?0:1,M=a[Re];this.breath=M>0?(x*sa+i[Re])/(sa+M):x}beatOral(t,e,s,a,i,n,o,l,h,m,p,v,N){let u=this.consT,k=t*U,g=this.beatT;for(let F=0;F<U;F++)g[F]=F===h?m:F===p?v:u[k+F];let S=ra[t],d=ni[t]===1,x=yt[t],M=!l&&(x===Ye||x===bs||x===vs),f=ri[t]===1,b=M?d?.039:f?.025:.024:0,E=M?d?.024:f?.022:.031:.008,O=o===o?Math.min(.03,o):.03,H=i>0?i:d?1+(a-1)*.35:a;this.begin();let I=M&&ce[t]===0;for(let F=0;F<U;F++)S&1<<F&&this.key(F,I&&F===L.lipAp&&h!==L.lipAp?oi:g[F]);let X=i>0?n:d?.03:.018,V=this.emit(e-E,Math.max(e+.01,s-b),O,X,40,H);if(V>=0){let F=i>0?i:Oe[t],q=0;for(let R=0;R<U;R++)S&1<<R&&Te[R]>q&&(q=Te[R]);this.gRet[V]=F,this.gHold[V]=Se/(2*Math.PI*(q>0?q:10)*F),this.gRank[V]=(M?0:16)+(ce[t]>=0?ce[t]:0)}let y=g[L.tbX]===g[L.tbX];!N&&ii[t]===1&&!y&&(this.begin(),this.key(L.tbX,3.2),this.key(L.tbY,7.4),this.emit(e,s,Math.min(.05,O+.02),.05,1.2,0)),this.begin();for(let F=0;F<U;F++){if(S&1<<F||N&&(F===L.tbX||F===L.tbY))continue;let q=g[F];q===q&&this.key(F,q)}this.emit(e,s,Math.min(.05,O+.02),.05,2.2,0)}rank(t,e){this.gRank[t]=30,this.gRet[t]=e,this.gHold[t]=.02}schwaTarget(t){return this.vowelT[Qa*U+t]}stiffen(t,e){this.begin(),this.key(Zs,1),this.emit(t,e,.03,fh,1,0)}},An=Float64Array.from(Te,r=>2*Math.PI*r*Sa/Se),wh=is(Is,.5)/Sa-is(2,.5)/Se,Oe=Float64Array.from(Ya,r=>r.manner===\\\"stop\\\"||r.manner===\\\"nasal\\\"?1.55:r.manner===\\\"tap\\\"?2.8:r.manner===\\\"affricate\\\"?2:1.3),Mh=Float64Array.from(Yt,r=>{let t=mn(r);return t>=0?fs[t].vot:0}),kh=Float64Array.from(Qs),x0=Float64Array.from(Xa),hi=Float64Array.from(fn),li=-.25,oi=-1,ci=Float64Array.from(Xa,(r,t)=>t===L.lipAp?Math.min(r,oi):r);function Rn(r,t){let e=-r[L.jaw]/9.84,s=Math.cos(e),a=Math.sin(e);t[0]=-2.5+8.95*s+3.15*a+.3*(r[L.tbX]-2.9),t[1]=10.5+8.95*a-3.15*s+.35*(r[L.tbY]-6.85)}var ha=class{k=0;pharynxScale=0;r=0;roofX;roofY;x=0;y=0;sd=0;qx=0;qy=0;bx=0;by=0;tipX=0;tipY=0;constructor(t){this.k=t.k,this.pharynxScale=t.pharynxScale,this.r=t.tongueRadius*t.k,this.roofX=Float64Array.from(t.roofX),this.roofY=Float64Array.from(t.roofY)}px(t){return(t>.5?.5+(t-.5)*.86:t)*this.k}py(t){return(t<7?7-(7-t)*this.pharynxScale:t)*this.k}sx(t){return(t>.5?.86:1)*this.k}sy(t){return(t<7?this.pharynxScale:1)*this.k}project(){let t=this.x,e=this.y,s=1/0,a=1,i=this.roofX,n=this.roofY;for(let o=0;o+1<i.length;o++){let l=i[o],h=n[o],m=i[o+1]-l,p=n[o+1]-h,v=m*m+p*p,N=((t-l)*m+(e-h)*p)/v;N=N<0?0:N>1?1:N;let u=l+m*N,k=h+p*N,g=Math.sqrt((t-u)*(t-u)+(e-k)*(e-k));g<s&&(s=g,a=m*(e-h)-p*(t-l)<0?1:-1,this.qx=u,this.qy=k)}this.sd=s*a}bodyPoint(t){let e=t[L.tbX],s=t[L.tbY];this.bx=(e>.5?.5+(e-.5)*.86:e)*this.k,this.by=(s<7?7-(7-s)*this.pharynxScale:s)*this.k}tipPoint(t){let e=this.k,s=this.pharynxScale,a=t[L.tbX],i=t[L.tbY],n=t[L.ttX],o=t[L.ttY],l=(a>.5?.5+(a-.5)*.86:a)*e,h=(i<7?7-(7-i)*s:i)*e,m=(n>.5?.5+(n-.5)*.86:n)*e,p=(o<7?7-(7-o)*s:o)*e,v=Math.sqrt((m-l)*(m-l)+(p-h)*(p-h));if(v<1.05*this.r){let N=1.05*this.r/(v>1e-9?v:1e-9);m=l+(m-l)*N,p=h+(p-h)*N}this.tipX=m,this.tipY=p}};var lt={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};var la=[-1,-1.5,-1.1,1.5,-1.2,3.6,-1.3,5.6,-1.38,7.5,-1.33,8.9,-1.05,10.1,-.45,10.9,.4,11.3],ca=[1,9.6,1.8,9.92,2.7,10.18,3.6,10.3,4.4,10.25,5.1,10.05,5.7,9.72,6.15,9.36,6.5,9.05,6.78,8.7,6.98,8.3,7.12,7.95],Le=Math.PI,Na=Le/180,Ah=.5,Rh=.3,Sn=.7,Sh=.1,We=32,Ni=64,Fn=256,Ne=64,Lh=new Float64Array([-1,-.5,.5,1]),Fh=2,Eh=2.6,Ph=2,Ch=1.6,ma=1.4,kt=class{xs;ys;n=0;constructor(t=Fn){this.xs=new Float64Array(t),this.ys=new Float64Array(t)}};function Ln(r,t,e,s,a){r.n=0;for(let i=0;i<s-1;i++){let n=i>0?i-1:0,o=i+2<s-1?i+2:s-1;for(let l=0;l<a;l++){let h=l/a,m=h*h,p=m*h;r.xs[r.n]=.5*(2*t[i]+(-t[n]+t[i+1])*h+(2*t[n]-5*t[i]+4*t[i+1]-t[o])*m+(-t[n]+3*t[i]-3*t[i+1]+t[o])*p),r.ys[r.n]=.5*(2*e[i]+(-e[n]+e[i+1])*h+(2*e[n]-5*e[i]+4*e[i+1]-e[o])*m+(-e[n]+3*e[i]-3*e[i+1]+e[o])*p),r.n++}}r.xs[r.n]=t[s-1],r.ys[r.n]=e[s-1],r.n++}var pa=class{k=1;pharWall=new kt(64);palate=new kt(64);ctlX=new Float64Array(16);ctlY=new Float64Array(16);pnsX=0;pnsY=0;condX=0;condY=0;polarCX=0;polarCY=0;polarC2X=0;polarC2Y=0;jawR=1;vel=new kt(16);velOral=new kt(16);velNasal=new kt(16);outer=new kt;inner=new kt;upperLipIn=new kt(16);lowerLipIn=new kt(16);root=new kt(16);arcPts=new kt(We+1);blade=new kt(16);under=new kt(16);back=new kt(64);roof=new kt;cum=new Float64Array(Fn);tipPts=new kt(32);outline=new kt;floorX=new Float64Array(3);floorY=new Float64Array(3);lowTeethX=new Float64Array(4);lowTeethY=new Float64Array(4);tmp=new Float64Array(Ni);crossT=new Float64Array(Ni);crossExit=new Uint8Array(Ni);ray=new Float64Array(6);r=new Float64Array(8);m=new Float64Array(5);io=new Float64Array(8);fs0=0;fs1=0;phScale=1;dBX=0;dBY=0;dRR=0;dUlx=0;dUly=0;dLlx=0;dLly=0;dGlotY=0;dEpi=new Float64Array(6);tongueR=2.25;lipWB=4.6;sinPhi=0;cosPhi=1;gInX=new Float64Array(Ne);gInY=new Float64Array(Ne);gOutX=new Float64Array(Ne);gOutY=new Float64Array(Ne);gMidX=new Float64Array(Ne);gMidY=new Float64Array(Ne);gD=new Float64Array(Ne);gArea=new Float64Array(Ne);gS=new Float64Array(Ne);gRegion=new Uint8Array(Ne);gN=0;length=17;pharynxLength=8.8;teethS=16;lipS=17;lipArea=1;velumPort=0;splitIndex=-1;tipX=0;tipY=0;contactTip=1;contactBody=1;contactTipNX=0;contactTipNY=-1;contactBodyNX=0;contactBodyNY=-1;phLen=8.8;orLen=8.3;epiArt=0;ventArt=0;constructor(t){this.setBody(t.scale,t.pharynx,t.tongueRadius,t.lipWidth)}setBody(t,e,s,a){this.k=t,this.phScale=e,this.tongueR=s,this.lipWB=a;let i=this.ctlX,n=this.ctlY;for(let h=0;h<la.length/2;h++)i[h]=this.pX(la[2*h]),n[h]=this.pY(la[2*h+1]);Ln(this.pharWall,i,n,la.length/2,4);for(let h=0;h<ca.length/2;h++)i[h]=this.pX(ca[2*h]),n[h]=this.pY(ca[2*h+1]);Ln(this.palate,i,n,ca.length/2,3),this.pnsX=this.pX(1),this.pnsY=this.pY(9.75),this.condX=this.pX(-2.5),this.condY=this.pY(10.5),this.polarCX=this.pX(2.6),this.polarCY=this.pY(6.95),this.polarC2X=this.pX(5),this.polarC2Y=this.pY(6.85);let o=this.pX(6.95)-this.condX,l=this.pY(7.75)-this.condY;this.jawR=Math.sqrt(o*o+l*l)}pX(t){return(t>.5?.5+(t-.5)*.86:t)*this.k}pY(t){return(t<7?7-(7-t)*this.phScale:t)*this.k}j(t,e){let s=this.pX(t),a=this.pY(e),i=s-this.condX,n=a-this.condY;this.r[0]=this.condX+i*this.cosPhi-n*this.sinPhi,this.r[1]=this.condY+i*this.sinPhi+n*this.cosPhi}evaluate(t){let e=this.k,s=this.phScale,a=0,i=0,n=this.r,o=t[lt.larynx]*e,l=(7-7*s)*e+o,h=(i=t[lt.jaw],-(i<-.2?-.2:i>3?3:i)*e/this.jawR);this.sinPhi=Math.sin(h),this.cosPhi=Math.cos(h);let m=(i=t[lt.velum]/1.2,i<0?0:i>1?1:i),p=(194+46*m)*Na,v=2.8*e,N=Math.cos(p),u=Math.sin(p),k=this.vel,g=this.velOral,S=this.velNasal;k.n=g.n=S.n=0;for(let c=0;c<=10;c++){let P=c/10,T=Math.sin(P*Le)*e*(.3*m-.12),C=this.pnsX+v*P*N,j=this.pnsY+v*P*u-T,W=-u,Nt=N,w=(.48-.2*P)*e;g.xs[c]=C+W*w,g.ys[c]=j+Nt*w,S.xs[c]=C-W*w,S.ys[c]=j-Nt*w,k.xs[c]=C,k.ys[c]=j}k.n=g.n=S.n=11;let d=this.palate,x=d.xs[0],M=d.ys[0];for(let c=0;c<11;c++){let P=c/10/.35;if(P<1){let T=(1-P)*(1-P);g.xs[c]=g.xs[c]+(x-g.xs[c])*T,g.ys[c]=g.ys[c]+(M-g.ys[c])*T}}let f=this.outer;f.n=0;let b=g.ys[10]-.3*e,E=this.pharWall;for(let c=0;c<E.n;c++){let P=E.ys[c];if(P<b){f.xs[f.n]=E.xs[c],f.ys[f.n++]=P;continue}if(c>0){let T=E.xs[c-1],C=E.ys[c-1],j=P-C,W=(i=(b-C)/(j>1e-9?j:1e-9),i<0?0:i>1?1:i);f.xs[f.n]=T+(E.xs[c]-T)*W,f.ys[f.n++]=C+(P-C)*W}break}let O=f.n;for(let c=10;c>=0;c--)f.xs[f.n]=g.xs[c],f.ys[f.n++]=g.ys[c];for(let c=1;c<d.n;c++)f.xs[f.n]=d.xs[c],f.ys[f.n++]=d.ys[c];let H=f.n-1,I=(i=t[lt.lipProt],(i<-.2?-.2:i>1.6?1.6:i)*e),X=(i=t[lt.lipWidth],i<0?0:i>1?1:i),V=(7.85-.3*t[lt.jaw])*e,y=(i=t[lt.labiodental],i<0?0:i>1?1:i),F=t[lt.lipAp]*e,q=(8.15+.12*(1-X)>.5?.5+(8.15+.12*(1-X)-.5)*.86:8.15+.12*(1-X))*e+I*.95,R=q-.15*e,_=V+F*.35+y*.35*e,G=q-.25*e,D=V-F*.65,Z=d.xs[d.n-1],it=d.ys[d.n-1];if(y>0){let c=t[lt.lipAp]*e,P=Z+.05*e,T=it-(c>-.1?c:-.1);G=G+(P-G)*y,D=D+(T-D)*y;let C=Z+.55*e,j=it+.45*e;R=R+(C-R)*(y*.7),_=_+(j-_)*(y*.7)}{let c=6.3652*e,P=8.35*e;{let C=this.io;C[0]=c,C[1]=P,C[2]=c+(.3*e+I*.4),C[3]=P+.05*e,C[4]=R+-.35*e,C[5]=_+.12*e,C[6]=R,C[7]=_,this.bezier3(this.upperLipIn,7)}let T=this.upperLipIn;for(let C=0;C<T.n;C++)f.xs[f.n]=T.xs[C],f.ys[f.n++]=T.ys[C]}let rt=this.tongueR*e,et=(t[lt.tbX]>.5?.5+(t[lt.tbX]-.5)*.86:t[lt.tbX])*e,A=(t[lt.tbY]<7?7-(7-t[lt.tbY])*s:t[lt.tbY])*e,K=(.5+(2.9-.5)*.86)*e,Y=(7-(7-6.85)*s)*e,pt=(.5+(.75-.5)*.86)*e+(.45*(et-K)+t[lt.root]*e),At=(7-(7-3.3)*s)*e+(.3*(A-Y)+.55*o),st=.3*e+0,_t=(7-(7-2.4)*s)*e+o,ge=0*e+.35*(pt-.75*e),xe=(7-(7-4.5)*s)*e+(o*.8+.15*(A-Y)),Ot=200*Na,me=et+rt*Math.cos(Ot),pe=A+rt*Math.sin(Ot),$e=Math.sin(Ot),Ze=-Math.cos(Ot),fe=Math.sqrt((pt-me)*(pt-me)+(At-pe)*(At-pe))/3;{let c=this.io;c[0]=pt,c[1]=At,c[2]=pt+.08*e,c[3]=At+fe,c[4]=me-$e*fe,c[5]=pe-Ze*fe,c[6]=me,c[7]=pe,this.bezier3(this.root,9)}let vt=(t[lt.ttX]>.5?.5+(t[lt.ttX]-.5)*.86:t[lt.ttX])*e,ht=(t[lt.ttY]<7?7-(7-t[lt.ttY])*s:t[lt.ttY])*e;if(Math.sqrt((vt-et)*(vt-et)+(ht-A)*(ht-A))<rt*1.05){let P=vt-et,T=ht-A,C=Math.sqrt(P*P+T*T);(C===0||C!==C)&&(C=1),P/=C,T/=C,vt=et+P*(rt*1.05),ht=A+T*(rt*1.05)}let Kt;{let c=Math.sqrt((et-vt)*(et-vt)+(A-ht)*(A-ht));c<=rt*1.0001?Kt=Math.atan2(ht-A,vt-et):Kt=Math.atan2(ht-A,vt-et)+Math.acos(rt/c)}for(;Kt>Ot;)Kt-=2*Le;for(;Kt<Ot-2*Le;)Kt+=2*Le;let Rt=this.arcPts;for(let c=0;c<We;c++){let P=Ot+(Kt-Ot)*c/(We-1);Rt.xs[c]=et+rt*Math.cos(P),Rt.ys[c]=A+rt*Math.sin(P)}Rt.n=We;let ue=Rt.xs[We-1],De=Rt.ys[We-1],va=Math.sin(Kt),ba=-Math.cos(Kt),Be=Math.sqrt((ue-vt)*(ue-vt)+(De-ht)*(De-ht)),xs=(i=t[lt.ttCurl],i<0?0:i>1?1:i),ga=ue+va*(Be*.5)+0,xa=De+ba*(Be*.5)+(.18+.5*xs)*e;{let c=this.io;c[0]=ue,c[1]=De,c[2]=ga,c[3]=xa,c[4]=vt,c[5]=ht,this.bezier2(this.blade,7)}let Qe=t[lt.dorsum];if(Qe>0){let c=et,P=vt,T=P-c>1e-6?P-c:1e-6;for(let j=0;j<Rt.n;j++){let W=(Rt.xs[j]-c)/T;if(W<=0||W>=1)continue;let Nt=Math.sin(Le*Math.pow(W,.8));Rt.ys[j]=Rt.ys[j]+-Qe*.9*e*Nt*Nt}let C=this.blade;for(let j=1;j<C.n-1;j++){let W=(C.xs[j]-c)/T;if(W<=0||W>=1)continue;let Nt=Math.sin(Le*Math.pow(W,.8));C.ys[j]=C.ys[j]+-Qe*.9*e*Nt*Nt}}{let c=4.972*e,P=(7-(7-6.15)*s)*e,T=c-this.condX,C=P-this.condY;n[0]=this.condX+T*this.cosPhi-C*this.sinPhi,n[1]=this.condY+T*this.sinPhi+C*this.cosPhi}let ys=n[0],Fe=n[1];{let c=this.io;c[0]=vt,c[1]=ht,c[2]=vt+(-.3*e-xs*.4*e),c[3]=ht+-.6*e,c[4]=ys,c[5]=Fe,this.bezier2(this.under,6)}this.floorX[0]=ys,this.floorY[0]=Fe;{let c=5.402*e,P=(7-(7-6.25)*s)*e,T=c-this.condX,C=P-this.condY;n[0]=this.condX+T*this.cosPhi-C*this.sinPhi,n[1]=this.condY+T*this.sinPhi+C*this.cosPhi}this.floorX[1]=n[0],this.floorY[1]=n[1];{let c=5.617*e,P=(7-(7-6.55)*s)*e,T=c-this.condX,C=P-this.condY;n[0]=this.condX+T*this.cosPhi-C*this.sinPhi,n[1]=this.condY+T*this.sinPhi+C*this.cosPhi}this.floorX[2]=n[0],this.floorY[2]=n[1],this.lowTeethX[0]=n[0],this.lowTeethY[0]=n[1];{let c=5.8492*e,P=7.15*e,T=c-this.condX,C=P-this.condY;n[0]=this.condX+T*this.cosPhi-C*this.sinPhi,n[1]=this.condY+T*this.sinPhi+C*this.cosPhi}this.lowTeethX[1]=n[0],this.lowTeethY[1]=n[1];{let c=6.047*e,P=7.75*e,T=c-this.condX,C=P-this.condY;n[0]=this.condX+T*this.cosPhi-C*this.sinPhi,n[1]=this.condY+T*this.sinPhi+C*this.cosPhi}this.lowTeethX[2]=n[0],this.lowTeethY[2]=n[1];{let c=6.1932*e,P=7.45*e,T=c-this.condX,C=P-this.condY;n[0]=this.condX+T*this.cosPhi-C*this.sinPhi,n[1]=this.condY+T*this.sinPhi+C*this.cosPhi}this.lowTeethX[3]=n[0],this.lowTeethY[3]=n[1];{let c=n[0],P=n[1];{let T=this.io;T[0]=c,T[1]=P,T[2]=c+(.25*e+I*.3),T[3]=P+-.05*e,T[4]=G+-.3*e,T[5]=D+-.12*e,T[6]=G,T[7]=D,this.bezier3(this.lowerLipIn,7)}}let ot=this.inner;ot.n=0,ot.xs[0]=st,ot.ys[0]=_t,ot.xs[1]=ge,ot.ys[1]=xe,ot.n=2;let ws=xe+.05*e,wt=this.back,te=this.root;wt.n=0;for(let c=0;c<te.n;c++)wt.xs[wt.n]=te.xs[c],wt.ys[wt.n++]=te.ys[c];for(let c=1;c<Rt.n;c++)wt.xs[wt.n]=Rt.xs[c],wt.ys[wt.n++]=Rt.ys[c];let Ee=te.n,qt=-1;for(let c=0;c<wt.n;c++)if(wt.ys[c]>ws){qt=c;break}if(qt<0)qt=wt.n-1;else if(qt>0){let c=wt.xs[qt-1],P=wt.ys[qt-1],T=wt.xs[qt],C=wt.ys[qt],j=C-P,W=(i=(ws-P)/(j>1e-9?j:1e-9),i<0?0:i>1?1:i);ot.xs[ot.n]=c+(T-c)*W,ot.ys[ot.n++]=P+(C-P)*W}if(qt<Ee){for(let c=qt;c<Ee;c++)ot.xs[ot.n]=te.xs[c],ot.ys[ot.n++]=te.ys[c];this.appendFrom(ot,Rt,1)}else this.appendFrom(ot,Rt,qt-Ee+2);this.appendFrom(ot,this.blade,1),this.appendFrom(ot,this.under,1);for(let c=1;c<3;c++)ot.xs[ot.n]=this.floorX[c],ot.ys[ot.n++]=this.floorY[c];for(let c=1;c<4;c++)ot.xs[ot.n]=this.lowTeethX[c],ot.ys[ot.n++]=this.lowTeethY[c];this.appendFrom(ot,this.lowerLipIn,0);let Ms=0;this.gN=Ms;let ks=l+2.4*e*this.phScale,As=this.polarCY,Je=12,ye=-1;for(let c=0;c<Je;c++){let P=c/Je,T=ks+.12*e+(As-(ks+.12*e))*P,C=this.ray;C[0]=4.6*e,C[1]=T,C[2]=-1,C[3]=0,C[5]=9*e,this.measure(!1)&&this.pushSample(1)}let Rs=30;for(let c=0;c<=Rs;c++){let P=c/Rs,T=(180+-144*P)*Na,C=P<.45?0:(P-.45)/.55,j=C*C*(3-2*C),W=this.polarCX+(this.polarC2X-this.polarCX)*j,Nt=this.polarCY+(this.polarC2Y-this.polarCY)*j,w=this.ray;w[0]=W,w[1]=Nt,w[2]=Math.cos(T),w[3]=Math.sin(T),w[5]=8*e,this.measure(!0)&&(ye<0&&T<=150*Na&&(ye=this.gN),this.pushSample(ye<0?1:2))}let de=Z+.03*e,ze=(R<G?R:G)-.04*e,we=de+.3*e>ze?de+.3*e:ze,ts=6,ne=this.gN,ve=this.m;for(let c=0;c<ts;c++){let P=de+(we-de)*(c/(ts-1)),T=this.ray;if(T[0]=P,T[1]=4*e,T[2]=0,T[3]=1,T[5]=8*e,!!this.measure(!1)){if(P>G){let C=D-(P-G)*4/3,j=C<ve[3]?C:ve[3],W=(a=(y-Sn)/(1-Sn),a=a<0?0:a>1?1:a,a*a*(3-2*a)*(a=(P-G-0)/(Sh*e-0),a=a<0?0:a>1?1:a,a*a*(3-2*a))),Nt=j+(ve[3]-3.5*e-j)*W;ve[0]=P,ve[1]=Nt,ve[4]=ve[3]-Nt}this.pushSample(3)}}this.splitIndex=ye;let re=(1.1+(this.lipWB-1.1)*X)*e,Ht=this.gN,Dt=this.roof;Dt.n=0;for(let c=O;c<=H;c++)Dt.xs[Dt.n]=f.xs[c],Dt.ys[Dt.n++]=f.ys[c];let Me=this.cum;Me[0]=0;for(let c=1;c<Dt.n;c++){let P=Dt.xs[c]-Dt.xs[c-1],T=Dt.ys[c]-Dt.ys[c-1];Me[c]=Me[c-1]+Math.sqrt(P*P+T*T)}let bt=this.tipPts;bt.n=0;for(let c=2;c<this.blade.n;c++)bt.xs[bt.n]=this.blade.xs[c],bt.ys[bt.n++]=this.blade.ys[c];for(let c=1;c<3;c++)bt.xs[bt.n]=this.under.xs[c],bt.ys[bt.n++]=this.under.ys[c];this.closestApproach(bt),this.contactTip=n[4],this.contactTipNX=n[0],this.contactTipNY=n[1],this.closestApproach(Rt),this.contactBody=n[4],this.contactBodyNX=n[0],this.contactBodyNY=n[1];{let c=this.outline;c.n=0,this.appendFrom(c,te,0),this.appendFrom(c,Rt,1),this.appendFrom(c,this.blade,1),this.appendFrom(c,this.under,1);for(let W=1;W<3;W++)c.xs[c.n]=this.floorX[W],c.ys[c.n++]=this.floorY[W];c.xs[c.n]=te.xs[0],c.ys[c.n++]=te.ys[0];let T=1-(a=((this.contactTip<this.contactBody?this.contactTip:this.contactBody)- -.06*e)/(0- -.06*e),a=a<0?0:a>1?1:a,a*a*(3-2*a)),C=.1*e*(1+T),j=Me[Dt.n-1];for(let W=0;W<Ht;W++){if(this.gRegion[W]===0)continue;let Nt=this.io;Nt[0]=this.gOutX[W],Nt[1]=this.gOutY[W],this.projectOn();let w=n[2],B=n[3],$=1-(a=(B-.15*e)/(.25*e-.15*e),a=a<0?0:a>1?1:a,a*a*(3-2*a));if($<=0)continue;Nt[0]=this.gOutX[W],Nt[1]=this.gOutY[W],this.signedGap();let J=n[0];if(J-C-B<=.6*e)for(let mt=0;mt<4;mt++){let xt=Lh[mt];Nt[2]=(i=w+xt*C,i<0?0:i>j?j:i),this.pointAlong(),this.signedGap();let ut=n[0];(ut<J||ut!==ut)&&(J=ut)}let tt=(1-(a=(J-.15*e)/(.6*e-.15*e),a=a<0?0:a>1?1:a,a*a*(3-2*a)))*$,Q=(1-(a=(J-.45*e)/(.6*e-.45*e),a=a<0?0:a>1?1:a,a*a*(3-2*a)))*$;if(tt<=0&&Q<=0)continue;let at=J>0?J:0,gt=this.gD[W],ft=gt+((gt<at?gt:at)-gt)*Q;this.gD[W]=ft+(at-ft)*tt}}{let c=R<G?R:G,P=.6*e,T=(a=(y-0)/(Ah-0),a=a<0?0:a>1?1:a,a*a*(3-2*a)),C=T>=1?1/0:F+Rh*e*T/(1-T);for(let j=0;j<Ht;j++){if(this.gRegion[j]!==3||this.gMidX[j]<Z)continue;let W=c-this.gMidX[j],Nt=W>0?W:0,w=C+Nt*Nt/(2*P),B=w>0?w:0;B<this.gD[j]&&(this.gD[j]=B)}}for(let c=0;c<Ht;c++){let P=this.gD[c],T=this.gRegion[c];if(T===1)this.gArea[c]=Fh*Math.pow(P,ma);else if(T===2){let C=(a=(this.gMidX[c]-vt-0)/(.4*e-0),a=a<0?0:a>1?1:a,a*a*(3-2*a)),j=Eh*Math.pow(P,ma);this.gArea[c]=j+(Ch*Math.pow(P,ma)-j)*C}else{let C=(i=(this.gMidX[c]-Z)/(.45*e),i<0?0:i>1?1:i),j=Ph*Math.pow(P,ma),W=Le/4*P*re;this.gArea[c]=j+(W-j)*C}}for(let c=1;c<Ht-1;c++){let P=this.gArea[c-1],T=this.gArea[c+1],C=1.35*(P>T?P:T);this.gArea[c]>C&&(this.gArea[c]=C)}let es=t[lt.lateral];if(es>0){let c=es*.35*e*e;for(let P=0;P<Ht;P++){if(this.gRegion[P]<2)continue;let T=this.gMidX[P]-vt,C=this.gMidY[P]-ht;Math.sqrt(T*T+C*C)<1.4*e&&this.gArea[P]<c&&(this.gArea[P]=c)}}let ss=2.4*e*this.phScale;for(let c=0;c<Ht;c++){if(c>0){let P=this.gMidX[c]-this.gMidX[c-1],T=this.gMidY[c]-this.gMidY[c-1];ss+=Math.sqrt(P*P+T*T)}this.gS[c]=ss}let _e=Ht-1;this.teethS=ne<Ht?this.gS[ne]:this.gS[_e],this.lipS=this.gS[_e],this.pharynxLength=ye>0?this.gS[ye]:this.gS[Je],this.length=this.lipS,this.lipArea=this.gArea[_e];let Mt=t[lt.velum];this.velumPort=(Mt>0?Mt:0)*e*e,this.tipX=vt,this.tipY=ht,this.dBX=et,this.dBY=A,this.dRR=rt,this.dUlx=R,this.dUly=_,this.dLlx=G,this.dLly=D,this.dGlotY=l,this.dEpi[0]=st,this.dEpi[1]=_t,this.dEpi[2]=ge,this.dEpi[3]=xe,this.dEpi[4]=pt,this.dEpi[5]=At,this.epiArt=t[lt.epilarynx],this.ventArt=t[lt.ventricular]}resample(t,e,s,a){this.resampleInto(t,e,s,a,t.length,e.length)}resampleInto(t,e,s,a,i,n){let o=this.pharynxLength;this.fs0=0,this.fs1=o,this.fill(t,s,i),this.fs0=o,this.fs1=this.lipS,this.fill(e,a,n),this.phLen=o,this.orLen=this.lipS-o}fill(t,e,s){let a=this.fs0,i=this.fs1,n=0,o=this.k,l=2.4*o*this.phScale,h=.1*l,m=this.gN,p=this.gS,v=this.gArea,N=.95*(1-.75*(n=this.ventArt,n<0?0:n>1?1:n)),u=1.9+(.35-1.9)*(n=this.epiArt,n<0?0:n>1?1:n),k=o*o,g=(i-a)/s,S=8,d=0;for(let x=0;x<s;x++){let M=0,f=!1,b=1/0;for(let I=0;I<S;I++){let X=a+g*(x+(I+.5)/S),V;if(X<=l){let y=X/l,F=y<.3?1.3:y<.5?N:1.2+(u-1.2)*((y-.5)/.5);for(let q=0;q<2;q++){let R=q===0?.3:.5;if(Math.abs(y-R)<.03){let _=R-.03,G=R+.03,D=_<.3?1.3:_<.5?N:1.2+(u-1.2)*((_-.5)/.5),Z=G<.3?1.3:G<.5?N:1.2+(u-1.2)*((G-.5)/.5);F=D+(Z-D)*((y-(R-.03))/(2*.03))}}V=F*k,X>l-h&&(V=V+(v[0]-V)*((X-(l-h))/h))}else if(X<=p[0])V=v[0];else{let y=0,F=m-1;if(X>=p[F])V=v[F];else{for(;F-y>1;){let _=y+F>>1;p[_]<=X?y=_:F=_}let q=p[F]-p[y],R=(X-p[y])/(q>1e-9?q:1e-9);V=v[y]+(v[F]-v[y])*R}}if(V<b&&(b=V),V<=1e-5){f=!0;break}M+=1/V}let E=a+g*x,O=a+g*(x+1)+(x===s-1?1e-6:0);for(;d<m&&p[d]<E;)d++;let H=d;for(;H<m&&p[H]<=O;)v[H]<b&&(b=v[H]),v[H]<=1e-5&&(f=!0),H++;t[x]=f?0:S/M,e[x]=f?0:b<t[x]?b:t[x]}}appendFrom(t,e,s){for(let a=s<e.n?s:e.n;a<e.n;a++)t.xs[t.n]=e.xs[a],t.ys[t.n++]=e.ys[a]}bezier3(t,e){let s=this.io,a=s[0],i=s[1],n=s[2],o=s[3],l=s[4],h=s[5],m=s[6],p=s[7];for(let v=0;v<e;v++){let N=v/(e-1),u=1-N,k=u*u*u,g=3*u*u*N,S=3*u*N*N,d=N*N*N;t.xs[v]=k*a+g*n+S*l+d*m,t.ys[v]=k*i+g*o+S*h+d*p}t.n=e}bezier2(t,e){let s=this.io,a=s[0],i=s[1],n=s[2],o=s[3],l=s[4],h=s[5];for(let m=0;m<e;m++){let p=m/(e-1),v=1-p;t.xs[m]=v*v*a+2*v*p*n+p*p*l,t.ys[m]=v*v*i+2*v*p*o+p*p*h}t.n=e}rayPolyline(t,e){let s=this.ray,a=s[0],i=s[1],n=s[2],o=s[3],l=s[4],h=s[5],m=0,p=t.xs,v=t.ys;for(let N=0;N+1<t.n;N++){let u=p[N],k=v[N],g=p[N+1],S=v[N+1],d=n*(k-i)-o*(u-a)>=0,x=n*(S-i)-o*(g-a)>=0;if(d===x)continue;let M=g-u,f=S-k,b=n*f-o*M;if(Math.abs(b)<1e-15)continue;let E=((u-a)*f-(k-i)*M)/b;E>=l&&E<=h&&m<e.length&&(e[m++]=E)}return m}rayCrossings(t){let e=this.ray,s=e[0],a=e[1],i=e[2],n=e[3],o=e[4],l=e[5],h=0,m=t.xs,p=t.ys,v=this.crossT,N=this.crossExit;for(let u=0;u+1<t.n;u++){let k=m[u],g=p[u],S=m[u+1],d=p[u+1],x=i*(g-a)-n*(k-s)>=0,M=i*(d-a)-n*(S-s)>=0;if(x===M)continue;let f=S-k,b=d-g,E=i*b-n*f;if(Math.abs(E)<1e-15)continue;let O=((k-s)*b-(g-a)*f)/E;O>=o&&O<=l&&h<v.length&&(v[h]=O,N[h]=i*(p[u+1]-p[u])-n*(m[u+1]-m[u])<0?1:0,h++)}return h}measure(t){let e=this.k,s=this.ray,a=this.tmp,i=s[0],n=s[1],o=s[2],l=s[3];s[4]=0;let h=this.rayPolyline(this.outer,a);if(h===0)return!1;let m=1/0;for(let k=0;k<h;k++)a[k]<m&&(m=a[k]);let p;if(t){s[5]=m+1.5*e;let k=this.rayCrossings(this.inner),g=this.crossT,S=this.crossExit;for(let M=1;M<k;M++){let f=g[M],b=S[M],E=M-1;for(;E>=0&&g[E]>f;)g[E+1]=g[E],S[E+1]=S[E],E--;g[E+1]=f,S[E+1]=b}let d=0;if(k>0&&S[0]===1)p=g[0],d=1;else{let M=2.5*e;s[2]=-o,s[3]=-l,s[5]=M;let f=this.rayPolyline(this.inner,a),b=M;for(let E=0;E<f;E++)a[E]<b&&(b=a[E]);p=-b}let x=0;for(;d<k&&g[d]<m;){if(S[d]===1){d++;continue}let M=d+1<k?g[d+1]:m+1.5*e;x+=(M<m?M:m)-g[d],d+=2}p=p+x}else{s[5]=m+1.5*e;let k=this.rayPolyline(this.inner,a);p=-1/0;for(let g=0;g<k;g++)a[g]>p&&a[g]<m+1.5*e&&(p=a[g]);if(p===-1/0){let g=m-3.5*e;p=g>0?g:0}}let v=m-p,N=this.m,u=p<m?p:m;return N[0]=i+o*u,N[1]=n+l*u,N[2]=i+o*m,N[3]=n+l*m,N[4]=v>0?v:0,!0}pushSample(t){let e=this.gN++,s=this.m;this.gInX[e]=s[0],this.gInY[e]=s[1],this.gOutX[e]=s[2],this.gOutY[e]=s[3],this.gMidX[e]=s[0]+(s[2]-s[0])*.5,this.gMidY[e]=s[1]+(s[3]-s[1])*.5,this.gD[e]=s[4],this.gArea[e]=0,this.gS[e]=0,this.gRegion[e]=t}projectOn(){let t=this.roof,e=this.cum,s=this.r,a=this.io[0],i=this.io[1],n=1/0,o=0,l=0,h=0,m=1,p=0;for(let v=0;v+1<t.n;v++){let N=t.xs[v],u=t.ys[v],k=t.xs[v+1]-N,g=t.ys[v+1]-u,S=k*k+g*g;if(S<1e-12)continue;let d=((a-N)*k+(i-u)*g)/S;d=d<0?0:d>1?1:d;let x=N+k*d,M=u+g*d,f=Math.sqrt((a-x)*(a-x)+(i-M)*(i-M));f<n&&(n=f,o=e[v]+d*Math.sqrt(S),l=x,h=M,m=k*(i-u)-g*(a-N)<0?1:-1,p=v)}s[2]=o,s[3]=n,s[4]=m*n,s[5]=p,s[6]=l,s[7]=h}pointAlong(){let t=this.roof,e=this.cum,s=this.io[2],a=0,i=0;for(;i+2<t.n&&e[i+1]<s;)i++;let n=e[i+1]-e[i],o=n>1e-9?(a=(s-e[i])/n,a<0?0:a>1?1:a):0;this.io[0]=t.xs[i]+(t.xs[i+1]-t.xs[i])*o,this.io[1]=t.ys[i]+(t.ys[i+1]-t.ys[i])*o}signedGap(){let t=this.outline,e=this.io[0],s=this.io[1],a=1/0,i=!1,n=t.xs,o=t.ys;for(let h=0;h+1<t.n;h++){let m=n[h],p=o[h],v=n[h+1],N=o[h+1],u=v-m,k=N-p,g=u*u+k*k,S=g>1e-12?((e-m)*u+(s-p)*k)/g:0;S=S<0?0:S>1?1:S;let d=e-m-u*S,x=s-p-k*S,M=d*d+x*x;M<a&&(a=M),p>s!=N>s&&e<m+(s-p)*u/k&&(i=!i)}let l=Math.sqrt(a);this.r[0]=i?-l:l}closestApproach(t){let e=this.r,s=1/0,a=0;for(let h=0;h<t.n;h++)this.io[0]=t.xs[h],this.io[1]=t.ys[h],this.projectOn(),e[4]<s&&(s=e[4],a=e[5]|0);let i=this.roof,n=i.xs[a+1]-i.xs[a],o=i.ys[a+1]-i.ys[a],l=Math.sqrt(n*n+o*o);(l===0||l!==l)&&(l=1),e[4]=s,e[0]=o/l,e[1]=-n/l}};var Th=L.labiodental,Ke=16,Ih=70,Tt=40;function Oh(r,t,e){let s=35e3/96e3/.93,a=8.7*r*(.55+.45*t)-1.6*r,i=8.3*r-1*r;e[0]=Math.min(Tt,Math.max(8,Math.floor(a/s))),e[1]=Math.min(Tt,Math.max(8,Math.floor(i/s)))}var fa=class{ph=new Float64Array(Tt);or=new Float64Array(Tt);phMin=new Float64Array(Tt);orMin=new Float64Array(Tt);phLen=8.8;orLen=8.3;teeth=16;velum=0;lab=0;copy(t){this.ph.set(t.ph),this.or.set(t.or),this.phMin.set(t.phMin),this.orMin.set(t.orMin),this.phLen=t.phLen,this.orLen=t.orLen,this.teeth=t.teeth,this.velum=t.velum,this.lab=t.lab}},ua=class{geometry;prev=new fa;next=new fa;counts=new Int32Array(2);nPh=18;nOr=18;slew=new Ue;edge=new Float64Array(2*Tt+1);prof=new Float64Array(2*Tt);pmin=new Float64Array(2*Tt);sProf=new Float64Array(2*Tt);vProf=new Float64Array(2*Tt);sMin=new Float64Array(2*Tt);vMin=new Float64Array(2*Tt);lenIn=new Float64Array(3);sLen=new Float64Array(3);vLen=new Float64Array(3);sa=1;sb=0;sc=0;sd=1;snapped=!0;dvdt=new Float64Array(2*Tt);vol=new Float64Array(2*Tt);keyDt=.01;blockDt=0;lbMin=0;dx=0;u=0;constructor(t){this.dx=35e3/(2*t),this.lbMin=Ws(t),this.geometry=new pa({scale:1,pharynx:1,tongueRadius:2.25,lipWidth:4.6});let e=Math.max(8,Math.round(32*t/48e3))/t;this.blockDt=e,this.keyDt=Ke*e,this.slew.setStep(this.keyDt);let s=2*Math.PI*Ih,a=Math.exp(-s*e);this.sa=(1+s*e)*a,this.sb=e*a,this.sc=-s*s*e*a,this.sd=(1-s*e)*a}setBody(t,e,s,a){this.geometry.setBody(t,e,s,a),Oh(t,e,this.counts),this.nPh=this.counts[0],this.nOr=this.counts[1],this.slew.setScale(t)}key(t,e){let s=this.geometry,a=this.prev,i=this.next;a.copy(i),s.evaluate(t);let n=this.nPh,o=this.nOr;s.resampleInto(i.ph,i.or,i.phMin,i.orMin,n,o),i.phLen=s.phLen,i.orLen=s.orLen,i.teeth=s.teethS,i.velum=s.velumPort;let l=t[Th];if(i.lab=l<0?0:l>1?1:l,e)a.copy(i),this.snapped=!0;else{this.slew.limitAll(i.ph,a.ph,n),this.slew.limitAll(i.or,a.or,o),this.slew.limitAll(i.phMin,a.phMin,n),this.slew.limitAll(i.orMin,a.orMin,o);for(let h=0;h<n;h++)i.phMin[h]>i.ph[h]&&(i.phMin[h]=i.ph[h]);for(let h=0;h<o;h++)i.orMin[h]>i.or[h]&&(i.orMin[h]=i.or[h])}}toAirway(t){let e=this.u,s=1-e,a=this.prev,i=this.next,n=this.nPh,o=this.nOr,l=n+o,h=this.sa,m=this.sb,p=this.sc,v=this.sd,N=this.snapped,u=this.lenIn,k=this.sLen,g=this.vLen;u[0]=a.phLen*s+i.phLen*e,u[1]=a.orLen*s+i.orLen*e,u[2]=a.teeth*s+i.teeth*e;for(let A=0;A<3;A++)if(N)k[A]=u[A],g[A]=0;else{let K=k[A]-u[A],Y=g[A];k[A]=u[A]+h*K+m*Y,g[A]=p*K+v*Y}let S=k[0],d=k[1],x=this.edge,M=this.prof,f=this.pmin;x[0]=0;for(let A=0;A<n;A++)M[A]=a.ph[A]*s+i.ph[A]*e,f[A]=a.phMin[A]*s+i.phMin[A]*e,x[A+1]=(A+1)*S/n;for(let A=0;A<o;A++)M[n+A]=a.or[A]*s+i.or[A]*e,f[n+A]=a.orMin[A]*s+i.orMin[A]*e,x[n+A+1]=S+(A+1)*d/o;let b=this.sProf,E=this.vProf,O=this.sMin,H=this.vMin;if(N){for(let A=0;A<l;A++)b[A]=M[A],O[A]=f[A],E[A]=0,H[A]=0;this.snapped=!1}else for(let A=0;A<l;A++){let K=b[A]-M[A],Y=E[A];b[A]=M[A]+h*K+m*Y,E[A]=p*K+v*Y,K=O[A]-f[A],Y=H[A],O[A]=f[A]+h*K+m*Y,H[A]=p*K+v*Y}let I=1/this.blockDt,X=S/n,V=d/o,y=this.vol,F=this.dvdt;for(let A=0;A<l;A++){let K=b[A]>0?b[A]:0;M[A]=K;let Y=O[A]>0?O[A]:0;f[A]=Y<K?Y:K;let pt=K*(A<n?X:V);F[A]=N?0:-(pt-y[A])*I,y[A]=pt}let q=S+d,R=t.nG,_=q-R*this.dx;_<this.lbMin&&(_=this.lbMin);let G=(q-_)/R,D=0;{let A=0;for(;D<l&&x[D]<_;){let K=x[D],Y=x[D+1]<_?x[D+1]:_;if(Y>K&&(A+=(Y-K)/(M[D]>1e-6?M[D]:1e-6)),x[D+1]>_)break;D++}t.ductLen=_,t.ductArea=A>0?_/A:M[0]}let Z=t.gridIn,it=t.gridMin;for(let A=0;A<R;A++){let K=_+A*G,Y=K+G;for(;D<l-1&&x[D+1]<=K;)D++;let pt=0,At=1/0,st=D;for(;st<l&&x[st]<Y;){let ge=x[st]>K?x[st]:K,xe=x[st+1]<Y?x[st+1]:Y,Ot=M[st]>1e-6?M[st]:1e-6;xe>ge&&(pt+=(xe-ge)/Ot);let me=f[st]<Ot?f[st]:Ot;me<At&&(At=me),st++}let _t=pt>0?G/pt:M[l-1];Z[A]=_t,it[A]=At<_t?At:_t}let rt=k[2];t.teethX=(rt-_)/G,t.splitI=(S-_)/G,t.velum=a.velum*s+i.velum*e,t.labial=a.lab*s+i.lab*e;let et=t.vflow;for(let A=0;A<=R;A++)et[A]=0;for(let A=0;A<l;A++){let K=(.5*(x[A]+x[A+1])-_)/G;K=K<0?0:K>R?R:K;let Y=Math.floor(K);Y>=R&&(Y=R-1);let pt=K-Y;et[Y]+=(1-pt)*this.dvdt[A],et[Y+1]+=pt*this.dvdt[A]}}get length(){let t=this.u;return(this.prev.phLen+this.prev.orLen)*(1-t)+(this.next.phLen+this.next.orLen)*t}};var En={glide:.17,overshoot:.095,preparation:.25};function Pn(r){let t=r>0?r<.6?r:.6:0;if(!(t>1e-6))return 1;let e=Math.log(t);return-e/Math.sqrt(Math.PI*Math.PI+e*e)}function Cn(r){let t=z(r,.005,.5);return Se/(2*Math.PI*t)}var da=$s,qh=1.5,Dh=60,Bh=.25,zh=1.5,_h=.25,Tn=[1.6,1.2,.9],In=[.03,.06,.06],Hh=.01,On=[.03,0,0],qn=[70/360,50/360,50/360],Dn=[.3,.3,.3],Vh=.05,Gh=.04,Uh=.25,jh=.06,Xh=20,It=Ke/2,Bn=[4.6,4.4,4],mi=En;function Yh(r,t){let e=r[t.name];return typeof e==\\\"number\\\"&&Number.isFinite(e)?e:t.default}function zn(r,t){let e=35e3/(2*r);return Math.max(8,Math.floor((t-Ws(r))/e))}var pi=class{sr=0;air;drive;roofs;planner=new oa;bank;glide;env;vibRng;blk=0;stepEvery=0;keyEvery=0;envBuf;art=new Float64Array(U);tip=new Float64Array(2);rate=new Float64Array(U);abdAt=new Float64Array(It+1);cloAt=new Float64Array(It+1);stfAt=new Float64Array(It+1);lungAt=new Float64Array(It+1);beatOn=new Uint8Array(It+1);lungFactor=1;beatLine=0;setting={jawSet:0,tongueFront:0,tongueHigh:0,lipRound:0,lipOpen:0,larynxSet:0,nasal:0,twang:0,throat:0};setOff=new Float64Array(U);size=1;pharynxScale=1;placed=new Float64Array(2);at=0;phonemeParam=Ga;bendParam=0;body=0;tension=.55;breath=.15;vibInc=0;vibDepth=.3;vibDelay=.25;articulation=1;attack=.02;release=.15;level=1;ring=0;tuning=0;nextIn=0;live=!1;fresh=!1;released=!1;noteHz=220;vel=.8;pos=0;bi=0;intervalLeft=0;blockInInterval=0;end=1/0;pLungTarget=9;pLung=0;pCoupleHz=0;pEar=0;bLo=0;bW=0;k=1;vibPhase=0;bloomT=0;bloomFrom=0;bloomNow=0;tuneJaw=0;abduction=0;closure=0;stiffness=0;foldRest=.03;glottisModel=ps;f0Now=110;depth=0;laidK=-1;laidN=-1;laidJv=-1;laidGeoK=-1;laidPh=-1;laidTongue=-1;laidLips=-1;constructor(t,e,s){this.sr=t,this.roofs=Jt.map(a=>new ha(a)),this.air=new Xs(t,zn(t,Jt[0].minLength*1.25),s),this.drive=new ua(t),this.blk=this.air.block,this.stepEvery=2*this.blk,this.keyEvery=Ke*this.blk,this.bank=new Ts(U,t/this.stepEvery),this.glide=new Os(t/this.blk),this.env=new Ps(t),this.vibRng=s.fork(\\\"vibrato\\\"),this.envBuf=new Float32Array(this.blk),this.bi=this.blk;for(let a of _n)this.setParam(a.name,Yh(e,a))}noteOn(t,e){this.noteHz=z(Number.isFinite(t)?t:220,Xh,this.sr*.25),this.vel=z(Number.isFinite(e)?e:.8,0,1),this.live=!0,this.fresh=!0,this.released=!1,this.end=1/0,this.env.reset(),this.env.trigger(),this.vibPhase=this.vibRng(),this.bloomT=0,this.bloomFrom=0,this.bloomNow=0,this.start()}noteOff(){!this.live||this.released||(this.released=!0,this.env.release(),this.end=this.pos/this.sr,this.planner.setEnd(this.end))}get active(){return this.live}setParam(t,e){if(Number.isFinite(e))switch(t){case\\\"phoneme\\\":this.setPhoneme(e);return;case\\\"nextIn\\\":this.nextIn=z(e,0,1);return;case\\\"nextPhoneme\\\":this.setNext(e);return;case\\\"bend\\\":this.setBend(e);return;case\\\"glide\\\":this.glide.setSpeed(Cn(e));return;case\\\"overshoot\\\":this.glide.setDamping(Pn(z(e,0,.5)));return;case\\\"preparation\\\":this.glide.setPreparation(z(e,0,1));return;case\\\"body\\\":this.body=z(e,0,2),this.applyBody(),this.live&&this.fresh&&this.start();return;case\\\"tension\\\":this.tension=z(e,0,1),this.applyTension();return;case\\\"roughness\\\":this.air.glottis.setRoughness(z(e,0,1));return;case\\\"fry\\\":this.air.glottis.setFry(z(e,0,1));return;case\\\"drift\\\":this.air.glottis.setDrift(z(e,0,20));return;case\\\"glottis\\\":this.setGlottis(e);return;case\\\"breath\\\":this.breath=z(e,0,1);return;case\\\"vibratoRate\\\":this.vibInc=z(e,0,12)*this.blk/this.sr;return;case\\\"vibratoDepth\\\":this.vibDepth=z(e,0,2);return;case\\\"vibratoDelay\\\":this.vibDelay=z(e,0,1);return;case\\\"articulation\\\":this.articulation=z(e,.25,4);return;case\\\"attack\\\":this.attack=z(e,.001,1),this.env.set(this.attack,.05,1,this.release);return;case\\\"release\\\":this.release=z(e,.01,2),this.env.set(this.attack,.05,1,this.release);return;case\\\"level\\\":this.level=z(e,0,2);return;case\\\"ring\\\":this.ring=z(e,0,1);return;case\\\"mic\\\":this.air.mic=z(e,0,1);return;case\\\"cheeks\\\":this.air.cheeks=z(e,0,1);return;case\\\"piriform\\\":this.air.piriform=e>=.5?1:0;return;case\\\"size\\\":this.size=z(e,.8,1.25),this.applyBody();return;case\\\"pharynx\\\":this.pharynxScale=z(e,.8,1.25);return;case\\\"jawSet\\\":case\\\"tongueFront\\\":case\\\"tongueHigh\\\":case\\\"lipRound\\\":case\\\"lipOpen\\\":case\\\"larynxSet\\\":case\\\"throat\\\":this.setting[t]=z(e,-1,1),this.settings();return;case\\\"nasal\\\":case\\\"twang\\\":this.setting[t]=z(e,0,1),this.settings();return;case\\\"tuning\\\":this.tuning=z(e,0,1);return}}setGlottis(t){let e=z(Math.round(t),0,2);this.glottisModel=e===1?je:e===2?ps:Ys,this.live||(this.air.model=this.glottisModel),this.applyTension()}setPhoneme(t){let e=z(Math.round(t),0,da-1);this.phonemeParam=e,!(!this.live||this.released)&&(this.fresh?this.start():this.planner.addNow(e,this.pos/this.sr))}setNext(t){let e=z(Math.round(t),0,da-1);!this.live||this.released||(this.planner.addUpcoming(e,this.pos/this.sr+this.nextIn),this.fresh&&this.settle())}setBend(t){let e=z(t,-48,48);this.bendParam=e,!(!this.live||this.released)&&(this.fresh?this.glide.snap(e):e!==this.glide.target&&(this.glide.setTarget(e),this.bloomFrom=this.bloomNow,this.bloomT=0))}process(t,e,s,a){if(!this.live)return;let i=this.air,n=this.blk,o=s;for(;o<a;){this.bi===n&&(this.intervalLeft===0&&this.interval(),this.beginBlock(),this.bi=0);let l=n-this.bi,h=l<a-o?l:a-o,m=this.envBuf;this.env.fill(m,0,h),i.render(t,e,o,h,this.bi,m),this.bi+=h,this.pos+=h,this.intervalLeft-=h,o+=h}a>s&&(this.fresh=!1),this.env.active||(this.live=!1)}applyBody(){let t=this.body;this.bLo=Math.floor(t)<2?Math.floor(t):1,this.bW=t-this.bLo;let e=Jt[this.bLo],s=Jt[this.bLo+1],a=this.bW;this.k=(e.k*(1-a)+s.k*a)*this.size,this.planner.setBody(t);let i=this.bLo,n=this.air;n.foldLength=Tn[i]*(1-a)+Tn[i+1]*a,n.upperRest=On[i]*(1-a)+On[i+1]*a,n.lag=qn[i]*(1-a)+qn[i+1]*a,n.skew=Dn[i]*(1-a)+Dn[i+1]*a,n.doublePulse=Vh,this.foldRest=In[i]*(1-a)+In[i+1]*a,this.applyTension()}applyTension(){let t=z(this.tension+.35*(this.vel-.8),0,1);this.air.glottis.setTension(t);let e=this.air.model===je?Hh:this.foldRest;this.air.restOffset=e+Gh*(.5-t)}start(){this.pos=0,this.bi=this.blk;let t=Jt[this.bLo],e=Jt[this.bLo+1],s=this.bW,a=this.k,i=this.pharynxScale,n=(t.pharynxScale*(1-s)+e.pharynxScale*s)*i,o=t.tongueRadius*(1-s)+e.tongueRadius*s,l=Bn[this.bLo]*(1-s)+Bn[this.bLo+1]*s,h=(t.minLength*(1-s)+e.minLength*s)*this.size*Math.min(1,.55+.45*i),m=(t.neutralPharynx*(1-s)+e.neutralPharynx*s)*this.size*i,p=this.air,v=Math.min(p.nMax,zn(this.sr,h)),N=h-v*p.dx,u=z(Math.round((m-N)/p.dx),2,v-2);a!==this.laidK||v!==this.laidN||u!==this.laidJv?(p.configure(a,v,u),this.laidK=a,this.laidN=v,this.laidJv=u):p.reset(),(n!==this.laidPh||o!==this.laidTongue||l!==this.laidLips||a!==this.laidGeoK)&&(this.drive.setBody(a,n,o,l),this.laidGeoK=a,this.laidPh=n,this.laidTongue=o,this.laidLips=l),p.model=this.glottisModel,this.applyTension(),this.planner.clear(),this.planner.addNow(this.phonemeParam,0),this.glide.snap(this.bendParam),this.pLungTarget=z(4+6.25*this.vel,5,15),this.pLung=this.planner.silentAt(0)||this.planner.beatAt(0)?0:.94*this.pLungTarget,this.pCoupleHz=zh*(this.noteHz/120),this.pEar=0,this.tuneJaw=0,this.settle()}settle(){let t=this.bank;for(let e=0;e<U;e++)t.snap(e,Qs[e]);this.at=this.pos/this.sr;for(let e=0;e<3;e++){this.targets();for(let s=0;s<U;s++)t.snap(s,this.planner.target[s]);this.contact();for(let s=0;s<U;s++)t.snap(s,t.values[s])}this.art.set(t.values),this.drive.key(this.art,!0),this.updateGlottis();for(let e=0;e<=It;e++)this.abdAt[e]=this.abduction,this.cloAt[e]=this.closure,this.stfAt[e]=this.stiffness,this.lungAt[e]=this.lungFactor,this.beatOn[e]=this.beatLine;this.intervalLeft=0,this.blockInInterval=0}targets(){Rn(this.bank.values,this.tip);let t=this.planner;t.at=this.at,t.restX=this.tip[0],t.restY=this.tip[1],t.evaluateNow();let e=t.target,s=this.ring,a=this.tuneJaw;e[L.epilarynx]+=s,e[L.larynx]-=.6*s,e[L.root]+=.4*s,e[L.jaw]+=a,e[L.tbY]-=a,e[L.lipAp]+=.5*a;let i=this.setOff,n=t.held;for(let o=0;o<U;o++)e[o]+=i[o]*(1-n[o]);for(let o=0;o<U;o++){let l=e[o];e[o]=l<ci[o]?ci[o]:l>hi[o]?hi[o]:l}}settings(){pn(this.setting,this.setOff)}updateGlottis(){let t=this.k*this.k,e=this.breath;this.abduction=(.1*e*e+.008+.03*e)*t+this.planner.abduction*t,this.closure=this.planner.closure,this.stiffness=this.planner.stiffness,this.lungFactor=this.planner.breath,this.beatLine=this.planner.beat}step(){this.targets();let t=this.bank,e=this.planner,s=this.articulation,a=this.rate;for(let i=0;i<U;i++)a[i]=An[i]*e.speed[i]*s;t.setAll(e.target,a),t.step(),this.contact(),this.updateGlottis()}contact(){let t=this.bank;t.values[L.lipAp]<li&&(this.placed[0]=li,t.placeFrom(L.lipAp,this.placed,0));let e=this.roofs[this.bW<.5?this.bLo:this.bLo+1],a=-.1*e.k,i=this.art;i.set(t.values),e.bodyPoint(i),e.x=e.bx,e.y=e.by,e.project(),e.sd-e.r<a&&(this.depth=a-(e.sd-e.r),this.push(e,L.tbX,L.tbY)),i.set(t.values),e.tipPoint(i),e.x=e.tipX,e.y=e.tipY,e.project(),e.sd<a&&(this.depth=a-e.sd,this.push(e,L.ttX,L.ttY))}push(t,e,s){let a=t.sd,i=this.depth,n=t.x-t.qx,o=t.y-t.qy,l=Math.sqrt(n*n+o*o);if(!(l>1e-9))n=0,o=-1;else{let S=a>=0?1/l:-1/l;n*=S,o*=S}let h=this.bank,m=h.values,p=m[e],v=m[s],N=t.k,u=(p>.5?.86:1)*N,k=(v<7?t.pharynxScale:1)*N,g=this.placed;g[0]=p+n*i/u,g[1]=v+o*i/k,h.placeFrom(e,g,0),h.placeFrom(s,g,1)}interval(){let t=this.sr;this.abdAt[0]=this.abdAt[It],this.cloAt[0]=this.cloAt[It],this.stfAt[0]=this.stfAt[It],this.lungAt[0]=this.lungAt[It],this.beatOn[0]=this.beatOn[It];for(let e=1;e<=It;e++)this.at=(this.pos+e*this.stepEvery)/t,this.step(),this.abdAt[e]=this.abduction,this.cloAt[e]=this.closure,this.stfAt[e]=this.stiffness,this.lungAt[e]=this.lungFactor,this.beatOn[e]=this.beatLine;this.art.set(this.bank.values),this.drive.key(this.art,!1),this.planner.forget(this.pos/t),this.intervalLeft=this.keyEvery,this.blockInInterval=0}beginBlock(){let t=this.sr,e=this.blk,s=this.air;this.blockInInterval++;let a=this.blockInInterval,i=this.drive;i.u=a/Ke,i.toAirway(s);let n=a*It/Ke,o=Math.floor(n),l=o<It?o+1:It,h=n-o;s.agStatic=this.abdAt[o]+(this.abdAt[l]-this.abdAt[o])*h,s.closure=this.cloAt[o]+(this.cloAt[l]-this.cloAt[o])*h;let m=this.k*this.k;s.chink=(.008+.03*this.breath)*m;let p=this.stfAt[o]+(this.stfAt[l]-this.stfAt[o])*h;s.xRel=1-Bh*p;let v=this.lungAt[o]+(this.lungAt[l]-this.lungAt[o])*h,N=this.beatOn[o]|this.beatOn[l],u=(this.pos+e/2)/t,k=this.planner;k.at=u,k.queryNow(),this.glide.advance();let g=this.glide.value;this.bloomT+=e/t;let S=this.bloomT,d=.5-.5*Math.cos(Math.PI*Math.min(S/Math.max(this.vibDelay,1e-9),1)),x=this.bloomFrom*(.5+.5*Math.cos(Math.PI*Math.min(S/jh,1)));this.bloomNow=d>x?d:x;let M=this.vibPhase+this.vibInc;M>=1&&(M-=1),this.vibPhase=M;let f=Math.sin(2*Math.PI*M)*this.vibDepth*this.bloomNow,b=this.noteHz*Math.pow(2,(g+f)/12+p*Dh/1200);this.f0Now=b,this.tune();let E=s.pSupra;this.pEar+=(E-this.pEar)*(1-Math.exp(-e/t/_h)),s.model===je?s.f0=b:s.model===Ys?s.f0=b-this.pCoupleHz*Math.max(E-this.pEar,0)/he:s.f0=b+this.pCoupleHz*(Math.max(s.dpSmooth,0)-Math.max(s.pSubSmooth,0))/he;let O=u<this.end&&k.silent===0?1:0,H=N===1?.003:O?.025:.05;this.pLung+=(this.pLungTarget*O*v-this.pLung)*(1-Math.exp(-e/t/H)),s.pLung=this.pLung*he,s.gain=Uh*this.level*Math.min(this.vel/.2,1),s.beginBlock()}tune(){let t=this.f0Now;if(!(this.tuning>0)){this.tuneJaw=0;return}let e=this.planner.vowel;if(e<0){this.tuneJaw=0;return}let s=Jt[this.bLo],a=Jt[this.bLo+1],i=this.bW,n=s.tuneSlope[e]*(1-i)+a.tuneSlope[e]*i;if(n<20){this.tuneJaw=0;return}let o=s.tuneR1[e]*(1-i)+a.tuneR1[e]*i,l=s.tuneJaw[e]*(1-i)+a.tuneJaw[e]*i,h=(1.15*t-o)/n,m=2.6-l;this.tuneJaw=this.tuning*Math.min(qh,m,h>0?h:0)}},_n=[{name:\\\"phoneme\\\",min:0,max:da-1,default:Ga},{name:\\\"bend\\\",min:-48,max:48,default:0,unit:\\\"st\\\"},{name:\\\"glide\\\",min:.005,max:.5,default:mi.glide,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"body\\\",min:0,max:2,default:0},{name:\\\"tension\\\",min:0,max:1,default:.55},{name:\\\"roughness\\\",min:0,max:1,default:.02},{name:\\\"fry\\\",min:0,max:1,default:0},{name:\\\"drift\\\",min:0,max:20,default:6,unit:\\\"cents\\\"},{name:\\\"glottis\\\",min:0,max:2,default:2},{name:\\\"breath\\\",min:0,max:1,default:.15},{name:\\\"vibratoRate\\\",min:0,max:12,default:5.5,unit:\\\"Hz\\\"},{name:\\\"vibratoDepth\\\",min:0,max:2,default:.3,unit:\\\"st\\\"},{name:\\\"vibratoDelay\\\",min:0,max:1,default:.25,unit:\\\"s\\\"},{name:\\\"articulation\\\",min:.25,max:4,default:1,curve:\\\"exp\\\"},{name:\\\"attack\\\",min:.001,max:1,default:.02,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"release\\\",min:.01,max:2,default:.15,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"level\\\",min:0,max:2,default:1},{name:\\\"overshoot\\\",min:0,max:.5,default:mi.overshoot},{name:\\\"preparation\\\",min:0,max:1,default:mi.preparation},{name:\\\"ring\\\",min:0,max:1,default:0},{name:\\\"mic\\\",min:0,max:1,default:0},{name:\\\"cheeks\\\",min:0,max:1,default:0},{name:\\\"piriform\\\",min:0,max:1,default:0},{name:\\\"size\\\",min:.8,max:1.25,default:1},{name:\\\"pharynx\\\",min:.8,max:1.25,default:1},{name:\\\"jawSet\\\",min:-1,max:1,default:0},{name:\\\"tongueFront\\\",min:-1,max:1,default:0},{name:\\\"tongueHigh\\\",min:-1,max:1,default:0},{name:\\\"lipRound\\\",min:-1,max:1,default:0},{name:\\\"lipOpen\\\",min:-1,max:1,default:0},{name:\\\"larynxSet\\\",min:-1,max:1,default:0},{name:\\\"nasal\\\",min:0,max:1,default:0},{name:\\\"twang\\\",min:0,max:1,default:0},{name:\\\"throat\\\",min:-1,max:1,default:0},{name:\\\"tuning\\\",min:0,max:1,default:0},{name:\\\"nextIn\\\",min:0,max:1,default:0,unit:\\\"s\\\"},{name:\\\"nextPhoneme\\\",min:0,max:da-1,default:0}],Hn={id:\\\"vocal\\\",label:\\\"Vocal\\\",params:_n,polyphony:8,createVoice:(r,t,e)=>new pi(r,t,e)};var fi=globalThis.bellowsKernel;if(!fi||typeof fi.registerEngine!=\\\"function\\\")throw new Error(\\\"bellows-voice: the bellows kernel must load first. Use Bellows.boot({ plugins: [voice] }) or b.use(voice).\\\");fi.registerEngine(Hn);})();\\n\";\n", "/* Generated by scripts/gen-plugin.mjs from src/engines/vocal.ts. Do not edit by hand. */\nimport type { EngineInfo } from 'bellowsjs';\n\n/** The vocal engine as listEngines() describes it, without its DSP. */\n// prettier-ignore\nexport const VOCAL_ENGINE_INFO: EngineInfo = {\n \"id\": \"vocal\",\n \"label\": \"Vocal\",\n \"params\": [\n {\n \"name\": \"phoneme\",\n \"min\": 0,\n \"max\": 81,\n \"default\": 1\n },\n {\n \"name\": \"bend\",\n \"min\": -48,\n \"max\": 48,\n \"default\": 0,\n \"unit\": \"st\"\n },\n {\n \"name\": \"glide\",\n \"min\": 0.005,\n \"max\": 0.5,\n \"default\": 0.17,\n \"curve\": \"exp\",\n \"unit\": \"s\"\n },\n {\n \"name\": \"body\",\n \"min\": 0,\n \"max\": 2,\n \"default\": 0\n },\n {\n \"name\": \"tension\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0.55\n },\n {\n \"name\": \"roughness\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0.02\n },\n {\n \"name\": \"fry\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"drift\",\n \"min\": 0,\n \"max\": 20,\n \"default\": 6,\n \"unit\": \"cents\"\n },\n {\n \"name\": \"glottis\",\n \"min\": 0,\n \"max\": 2,\n \"default\": 2\n },\n {\n \"name\": \"breath\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0.15\n },\n {\n \"name\": \"vibratoRate\",\n \"min\": 0,\n \"max\": 12,\n \"default\": 5.5,\n \"unit\": \"Hz\"\n },\n {\n \"name\": \"vibratoDepth\",\n \"min\": 0,\n \"max\": 2,\n \"default\": 0.3,\n \"unit\": \"st\"\n },\n {\n \"name\": \"vibratoDelay\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0.25,\n \"unit\": \"s\"\n },\n {\n \"name\": \"articulation\",\n \"min\": 0.25,\n \"max\": 4,\n \"default\": 1,\n \"curve\": \"exp\"\n },\n {\n \"name\": \"attack\",\n \"min\": 0.001,\n \"max\": 1,\n \"default\": 0.02,\n \"curve\": \"exp\",\n \"unit\": \"s\"\n },\n {\n \"name\": \"release\",\n \"min\": 0.01,\n \"max\": 2,\n \"default\": 0.15,\n \"curve\": \"exp\",\n \"unit\": \"s\"\n },\n {\n \"name\": \"level\",\n \"min\": 0,\n \"max\": 2,\n \"default\": 1\n },\n {\n \"name\": \"overshoot\",\n \"min\": 0,\n \"max\": 0.5,\n \"default\": 0.095\n },\n {\n \"name\": \"preparation\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0.25\n },\n {\n \"name\": \"ring\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"mic\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"cheeks\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"piriform\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"size\",\n \"min\": 0.8,\n \"max\": 1.25,\n \"default\": 1\n },\n {\n \"name\": \"pharynx\",\n \"min\": 0.8,\n \"max\": 1.25,\n \"default\": 1\n },\n {\n \"name\": \"jawSet\",\n \"min\": -1,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"tongueFront\",\n \"min\": -1,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"tongueHigh\",\n \"min\": -1,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"lipRound\",\n \"min\": -1,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"lipOpen\",\n \"min\": -1,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"larynxSet\",\n \"min\": -1,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"nasal\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"twang\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"throat\",\n \"min\": -1,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"tuning\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"nextIn\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0,\n \"unit\": \"s\"\n },\n {\n \"name\": \"nextPhoneme\",\n \"min\": 0,\n \"max\": 81,\n \"default\": 0\n }\n ],\n \"polyphony\": 8\n};\n", "/*\n * The voice as a bellows plugin: the engine's worklet script and its description, plain data for\n * Bellows.boot({ plugins: [voice] }) or b.use(voice). Neither imports the engine's DSP, so a page\n * carries the voice once, inside the script, and only if it uses it.\n */\n\nimport type { BellowsPlugin } from 'bellowsjs';\nimport { workletCode } from './worklet-code.gen';\nimport { VOCAL_ENGINE_INFO } from './catalog.gen';\n\nexport { VOCAL_ENGINE_INFO };\n\nexport const voice: BellowsPlugin = {\n id: 'bellows-voice',\n worklet: workletCode,\n engines: [VOCAL_ENGINE_INFO],\n};\n", "/*\n * A singer: a bellows instrument on the 'vocal' engine, with sing() and speak(). Lyrics go through\n * the text layer (lyrics/), notes through bellows' tempo map and tuning (b.layNotes), the plan\n * through sungEvents (sing.ts), and the events into bellows through its host API\n * (b.postKernelEvents), so this module needs nothing from bellows that is not public.\n *\n * Moved from bellows' facade (Bellows.singEvents, speakEvents and Instrument.sing, speak at\n * bellowsjs 0.4.0) when the voice became its own package; what it posts is unchanged.\n */\n\nimport { EventKind, listEngines, type Bellows, type BusHandle, type FxInput, type Instrument, type KernelEvent, type NoteOptions, type NoteSpec, type NoteValue, type Scale, type TimeValue } from 'bellowsjs';\nimport type { PronouncingDictionary, SungPlan, Syllable } from './lyrics/types';\nimport { lyricsToSyllables } from './lyrics/read';\nimport { resolveAccent, type Accent } from './lyrics/accents';\nimport { speechPlan } from './lyrics/speech';\nimport { BEAT_LEAD_IN, beatLine, type BeatPattern, type BeatTiming } from './lyrics/beat';\nimport { SHAPE_PRESETS, VOICE_SETTINGS } from './engines/vocal-settings';\nimport { planSung, type PlanSungOptions } from './lyrics/sing';\nimport { sungEvents, type SungWindow } from './sing';\nimport { VOCAL_PLAN_LEAD, vocalGlideLead } from './engines/vocal-lead';\nimport { speechHzForBody, voicePreset, type VoicePreset } from './voices';\n\n/** One note of a sung line. `note: null` is a rest: it takes time and no syllable. */\nexport interface SingNote {\n note: NoteValue | null;\n /** Beats, notation ('8n', '3/8'), or { seconds }, through the tempo map. */\n dur: TimeValue | { seconds: number };\n /** Velocity 0..1, default 0.8. A phrase plays at its first note's. */\n vel?: number;\n}\n\nexport interface SingOptions {\n /**\n * Context time of the first note's beat, where its vowel lands. Left out, a live line starts as\n * soon as its opening consonants can all still sound, and a line in a clock callback replayed by\n * render() starts at the callback's tick.\n */\n at?: number;\n /** Pronouncing dictionary for this line, over the singer's. */\n dictionary?: PronouncingDictionary;\n /** Scale for { degree } notes, as note()'s third argument. Default C major. */\n scale?: Scale;\n /**\n * The accent's t and l rules on English words (General American: \"little\" sings l\u026A.\u027E\u0259\u026B), default\n * true. False keeps every /t d l/ as written, as classical diction does. IPA is sung as written\n * either way.\n */\n allophones?: boolean;\n /** Accent for this line, over the singer's: an id from ACCENTS ('southern-british', ...) or an Accent. */\n accent?: Accent | string;\n}\n\nexport interface SpeakOptions {\n /** Context time the first syllable's vowel lands. Left out, as soon as the opening consonants can sound. */\n at?: number;\n dictionary?: PronouncingDictionary;\n /** Accent, over the singer's. Its prosody sets the melody and rate. */\n accent?: Accent | string;\n /** Baseline pitch, Hz. Default the singer's speechHz: its preset's, or the norm for its body. */\n hz?: number;\n /** Rate over the accent's own, 1 normal. */\n rate?: number;\n /** The accent's t and l rules, default true. */\n allophones?: boolean;\n /** Breaths in: 'between' phrases (default), 'all' (before the first too), or 'none'. */\n breath?: 'between' | 'all' | 'none';\n}\n\n/**\n * What sing() planned and posted. `phrases` are the plan, each vowel on its beat. `leadIn` is the\n * longest any phrase starts before its own first beat, which can be more than the plan's own\n * lead-in: a phrase that opens on an aspirated p, t or k releases it early, so its vowel is voiced\n * on the beat. Live, call at least that far ahead of the first beat.\n */\nexport interface BeatboxOptions extends BeatTiming {\n /** Context time of the first step's hit. Left out, as soon as the line's lead-in can sound. */\n at?: number;\n /** A hum's pitch where its step names none: a note through the tuning, or { hz }. Default 0.75 of speechHz. */\n note?: NoteValue;\n /** Velocity 0..1: the breath behind every sound. Default 0.8. */\n vel?: number;\n}\n\nexport interface SingResult extends SungPlan {\n /** IPA the vocal engine has no phoneme for, each once; those spans keep the sound before them. */\n unknown: string[];\n /**\n * Seconds of the line left out because the instrument was still singing an earlier line there, or\n * had a later one posted already: the opening consonants that would have overlapped it, or whole\n * phrases. 0 when the instrument was free.\n */\n trimmed: number;\n}\n\nexport interface SingerOptions {\n /** Pronunciations: lowercase word to CMUdict ARPAbet, as parseCmudict() returns. None ships. */\n dictionary?: PronouncingDictionary | null;\n /** The accent lines are read in. Default 'general-american'. */\n accent?: Accent | string;\n /** Voices on the channel, as b.voice() takes it. */\n polyphony?: number;\n /** speak()'s default pitch, Hz, over the preset's and the body's norm. */\n speechHz?: number;\n}\n\n/**\n * A vocal channel's own phoneme and bend, which sung lines hand back when they end (undefined: the\n * engine's default), and the phrases sing() has posted on it, so the next line fits around them.\n */\ninterface SingState {\n restPhoneme?: number;\n restBend?: number;\n /** The channel's own glide settings, which set how early sung bends go out. */\n glide?: number;\n overshoot?: number;\n preparation?: number;\n windows: SungWindow[];\n}\n\nconst EMPTY: SingResult = { phrases: [], leadIn: 0, unknown: [], trimmed: 0 };\n\nexport class Singer {\n /** The bellows instrument underneath: notes, params, fx, sends and gain go through it. */\n readonly instrument: Instrument;\n /** Pronunciations for every line, over the letter-to-sound rules. */\n dictionary: PronouncingDictionary | null;\n /** The accent every line is read in, unless a line names its own. */\n accent: Accent | string;\n /** speak()'s default baseline pitch, Hz. */\n speechHz: number;\n /** The starter voice this singer was made from, if any. */\n readonly preset: VoicePreset | undefined;\n private readonly key: string;\n private readonly offParam: () => void;\n\n constructor(\n private readonly b: Bellows,\n voice: Record<string, number> | string | VoicePreset = {},\n opts: SingerOptions = {},\n ) {\n const preset = typeof voice === 'string' ? voicePreset(voice) : isPreset(voice) ? voice : undefined;\n if (typeof voice === 'string' && !preset) {\n throw new Error(`bellows-voice: no starter voice \"${voice}\"; see VOICE_PRESETS`);\n }\n const params: Record<string, number> = preset ? { ...preset.params } : { ...(voice as Record<string, number>) };\n this.preset = preset;\n if (!listEngines().some((e) => e.id === 'vocal')) {\n throw new Error(\n \"bellows-voice: this bellows instance has no 'vocal' engine. Load the voice first: \" +\n 'Bellows.boot({ plugins: [voice] }) or await b.use(voice). If it is loaded, the page has two ' +\n 'copies of bellowsjs (a bundler that pre-bundles bellows-voice with its own, or a CDN page ' +\n \"without an import map for 'bellowsjs'), and the voice cannot see the one that loaded it.\",\n );\n }\n this.instrument = b.voice('vocal', params, opts.polyphony !== undefined ? { polyphony: opts.polyphony } : undefined);\n this.dictionary = opts.dictionary ?? null;\n this.accent = opts.accent ?? 'general-american';\n this.speechHz = opts.speechHz ?? preset?.speechHz ?? speechHzForBody(params.body ?? 0);\n this.key = 'bellows-voice:' + this.instrument.channel;\n // what the engine itself does with a creation value that is not a number\n const own = (v: number | undefined) => (typeof v === 'number' && Number.isFinite(v) ? v : undefined);\n b.contextState<SingState>(this.key, {\n make: () => ({\n restPhoneme: own(params.phoneme),\n restBend: own(params.bend),\n glide: own(params.glide),\n overshoot: own(params.overshoot),\n preparation: own(params.preparation),\n windows: [],\n }),\n // a render starts from the channel's own values as they are now, and no lines\n fork: (live) => ({ ...live, windows: [] }),\n });\n this.offParam = b.onUntimedParam(this.instrument.channel, (name, value) => this.restOn(name, value));\n }\n\n /** The bellows channel this singer plays on. */\n get channel(): number {\n return this.instrument.channel;\n }\n\n /**\n * Sing a lyric on a melody. Notes are laid end to end from `at`, each `dur` through the tempo map\n * and each pitch through the tuning and `scale`. Each note's vowel lands on its beat; opening\n * consonants start before it. Lyrics are English (through the dictionary when set, letter-to-sound\n * rules otherwise) and IPA between slashes. A hyphen splits a word across notes, a free-standing\n * '-' or '~' holds the vowel onto the next note, and punctuation or a rest ends a phrase.\n *\n * One singer sings one line at a time, because `phoneme` and `bend` are channel parameters: give a\n * harmony its own singer. A line that would start while an earlier one is still singing starts\n * where that one ends, and `trimmed` says how much went.\n */\n sing(lyrics: string | readonly Syllable[], notes: readonly SingNote[], opts: SingOptions = {}): SingResult {\n if (this.instrument.disposed) return { ...EMPTY };\n return this.post(lyrics, notes, opts);\n }\n\n /**\n * Speak text in an accent: its vowels and consonants from the accent's rules, its rhythm\n * stress-timed and its melody from the accent's prosody, a statement falling (or, in Australian\n * and New Zealand English, rising) and a question rising.\n */\n speak(text: string, opts: SpeakOptions = {}): SingResult {\n if (this.instrument.disposed) return { ...EMPTY };\n const accent = resolveAccent(opts.accent ?? this.accent);\n const syllables: Syllable[] = [];\n const questions: boolean[] = [];\n // each sentence or clause is a phrase; its closing mark sets its tune\n for (const m of text.matchAll(/[^.!?;:,\\n]+[.!?;:,\\n]*/g)) {\n const part = lyricsToSyllables(m[0], {\n dictionary: opts.dictionary ?? this.dictionary ?? undefined,\n allophones: opts.allophones,\n accent,\n // running speech: weak function words\n reduce: true,\n });\n if (part.length === 0) continue;\n part[part.length - 1].phraseEnd = true;\n syllables.push(...part);\n questions.push(m[0].includes('?'));\n }\n const plan = speechPlan(syllables, { hz: opts.hz ?? this.speechHz, rate: opts.rate, prosody: accent.prosody, breath: opts.breath }, questions);\n const notes: SingNote[] = plan.notes.map((n) =>\n n.rest ? { note: null, dur: { seconds: n.dur } } : { note: { hz: n.hz }, dur: { seconds: n.dur } },\n );\n // spoken consonants at their full spoken length, where sung ones are shortened (durations.ts)\n return this.post(plan.syllables, notes, { at: opts.at }, { consonantScale: 1 });\n }\n\n /**\n * Beatbox a pattern ('B . t . | Pf . t .', see parseBeat and BEAT_PRESETS): each sound made on the\n * voice's own tract with a beatboxer's airstream (an ejective kick, an inward snare, clicks, a hummed\n * bass). One throat, so a pattern is monophonic, and the whole of it is one breath group.\n */\n beatbox(pattern: BeatPattern | string, opts: BeatboxOptions = {}): SingResult {\n const line = beatLine(pattern, opts);\n const humDefault: NoteValue = opts.note ?? { hz: 0.75 * this.speechHz };\n let pitch: NoteValue = humDefault;\n const notes: SingNote[] = line.steps.map((step, i) => {\n if (step !== null && step.id === 'm') pitch = step.note ?? humDefault;\n return { note: pitch, dur: { seconds: line.durs[i] }, vel: opts.vel };\n });\n const at = opts.at === undefined ? undefined : opts.at - BEAT_LEAD_IN;\n return this.post(line.syllables, notes, { at });\n }\n\n /**\n * Shape the mouth: voice settings and anatomy (VOICE_SETTINGS: jawSet, lipRound, larynxSet, nasal,\n * twang, throat, cheeks, size, pharynx, ...) as values, or a SHAPE_PRESETS id ('smile', 'operatic',\n * 'giant'). Settings left out go back to neutral. Size and pharynx take effect from the next line.\n */\n shape(values: Record<string, number> | string): this {\n const v = typeof values === 'string' ? SHAPE_PRESETS.find((p) => p.id === values)?.values : values;\n if (!v) throw new Error(`bellows-voice: no mouth shape '${String(values)}' (see SHAPE_PRESETS)`);\n for (const s of VOICE_SETTINGS) {\n const x = v[s.param];\n this.param(s.param, typeof x === 'number' && Number.isFinite(x) ? x : (s.neutral ?? 0));\n }\n return this;\n }\n\n /** Play a note on the voice's own phoneme (an \"ah\" unless `phoneme` is set), as the instrument's note() does. */\n note(note: NoteValue, opts: NoteOptions = {}): this {\n this.instrument.note(note, opts);\n return this;\n }\n\n /** Set an engine parameter, as the instrument's param() does. */\n param(name: string, value: number, at?: number): this {\n this.instrument.param(name, value, at);\n return this;\n }\n\n /** Sustain a note on the voice's own phoneme; returns an id for off(). */\n on(note: NoteValue, vel = 0.8, at?: number): number {\n return this.instrument.on(note, vel, at);\n }\n\n off(noteId: number, at?: number): this {\n this.instrument.off(noteId, at);\n return this;\n }\n\n /** Insert effects on the voice's channel, as the instrument's fx() does. */\n fx(...fx: FxInput[]): this {\n this.instrument.fx(...fx);\n return this;\n }\n\n /** Send the voice to a bus. */\n send(bus: BusHandle, level: number): this {\n this.instrument.send(bus, level);\n return this;\n }\n\n gain(value: number): this {\n this.instrument.gain(value);\n return this;\n }\n\n pan(value: number): this {\n this.instrument.pan(value);\n return this;\n }\n\n /** Release the channel. */\n dispose(opts: { releaseSeconds?: number } = {}): void {\n this.offParam();\n this.instrument.dispose(opts);\n }\n\n private state(): SingState {\n return this.b.contextState<SingState>(this.key, { make: () => ({ windows: [] }) })!;\n }\n\n private post(\n lyrics: string | readonly Syllable[],\n notes: readonly SingNote[],\n opts: SingOptions,\n planOpts: PlanSungOptions = {},\n ): SingResult {\n const b = this.b;\n const channel = this.instrument.channel;\n const syllables =\n typeof lyrics === 'string'\n ? lyricsToSyllables(lyrics, {\n dictionary: opts.dictionary ?? this.dictionary ?? undefined,\n allophones: opts.allophones,\n accent: opts.accent ?? this.accent,\n })\n : lyrics;\n const state = this.state();\n const rendering = b.rendering;\n const now = b.now();\n // live, a phrase that has ended can no longer meet a new one: its events are spent\n if (!rendering) state.windows = state.windows.filter((w) => w.end >= now);\n const plan1 = (at: number) => {\n const plan = planSung(b.layNotes(notes as readonly NoteSpec[], at, opts.scale), syllables, planOpts);\n const posted = sungEvents(plan, {\n channel,\n phonemeParam: b.paramIndex('phoneme'),\n bendParam: b.paramIndex('bend'),\n nextPhonemeParam: b.paramIndex('nextPhoneme'),\n nextInParam: b.paramIndex('nextIn'),\n planLead: VOCAL_PLAN_LEAD,\n bendLead: vocalGlideLead(state.glide, state.overshoot, state.preparation),\n firstNoteId: b.reserveNoteIds(0),\n restPhoneme: state.restPhoneme,\n restBend: state.restBend,\n busy: state.windows,\n // a stop released before the render starts, or before now, never sounds\n notBefore: rendering ? 0 : now,\n });\n return { plan, posted };\n };\n let { plan, posted } = plan1(opts.at ?? (rendering ? now : now + 0.005));\n // live with no `at`, the first beat goes after the opening consonants, as soon as they can all\n // still sound, instead of losing them to the past\n if (opts.at === undefined && !rendering && posted.leadIn > 0) ({ plan, posted } = plan1(now + 0.005 + posted.leadIn));\n b.reserveNoteIds(plan.phrases.length);\n b.postKernelEvents(posted.events);\n state.windows = state.windows.concat(posted.windows).sort((a, c) => a.start - c.start);\n return { phrases: plan.phrases, leadIn: posted.leadIn, unknown: posted.unknown, trimmed: posted.trimmed };\n }\n\n /**\n * An untimed phoneme or bend becomes the channel's own, which sung lines hand back when they end.\n * A line already posted would still hand back the old value at its end, so the new one is posted\n * there too, after that line's resets, unless another line opens at that moment and owns the\n * channel.\n */\n private restOn(name: string, value: number): void {\n if (!Number.isFinite(value)) return;\n const state = this.b.contextState<SingState>(this.key);\n if (!state) return;\n if (name === 'glide' || name === 'overshoot' || name === 'preparation') {\n state[name] = value;\n return;\n }\n if (name !== 'phoneme' && name !== 'bend') return;\n if (name === 'phoneme') state.restPhoneme = value;\n else state.restBend = value;\n const now = this.b.now();\n const idx = this.b.paramIndex(name);\n const fixes: KernelEvent[] = [];\n for (const w of state.windows) {\n if (!w.resets || w.end < now) continue;\n if (state.windows.some((o) => o.start === w.end)) continue;\n fixes.push({ time: w.end, kind: EventKind.Param, target: this.instrument.channel, a: idx, b: value, c: 0 });\n }\n if (fixes.length > 0) this.b.postKernelEvents(fixes);\n }\n}\n\n/**\n * A singer on bellows instance `b`: b.voice('vocal', ...) with sing() and speak(). `voice` is the\n * engine's params, or a starter voice by id ('soprano', 'narrator-female'; see VOICE_PRESETS) or\n * as the preset itself.\n */\nexport function singer(b: Bellows, voice: Record<string, number> | string | VoicePreset = {}, opts: SingerOptions = {}): Singer {\n return new Singer(b, voice, opts);\n}\n\nfunction isPreset(v: unknown): v is VoicePreset {\n return typeof v === 'object' && v !== null && 'params' in v && 'speechHz' in v && 'group' in v;\n}\n", "/*\n * A sung plan as kernel events: how a lyric reaches the vocal engine.\n *\n * planSung (lyrics/sing.ts) times phonemes in seconds and pitches in Hz\n * and knows nothing about engines. The vocal engine (engines/vocal.ts)\n * knows a phoneme only as an index on its `phoneme` parameter, and a pitch\n * inside a note only as `bend` in semitones. This file is the join. One\n * phrase becomes one note with ordinary Param events inside it, so nothing\n * in the kernel knows a phoneme exists, and realtime playback, offline\n * rendering and b.render() replays all sing the same way (docs/VOICE.md,\n * \"The design as built\").\n *\n * Each phrase, in this order:\n *\n * bend 0 at start\n * phoneme at start, the first span\n * NoteOn at start, with the phrase's first Hz and its velocity\n * phoneme at each later span start where the sound changes\n * bend at each later pitch time (less bendLead), 12 log2(hz / first Hz)\n * nextIn, nextPhoneme planLead before each later sound (see below)\n * NoteOff at end\n * bend and phoneme at end, back to the channel's own (restBend, restPhoneme)\n *\n * The Params at `start` go before the NoteOn at the same time. The kernel\n * keeps insertion order for equal times (kernel/engine.ts, pushEvent), and\n * the voice snaps every tracked value at note-on, so the phrase opens on\n * its own sound and pitch instead of gliding in from the channel's last\n * ones. The vocal engine also snaps a phoneme or bend that arrives after\n * its note-on but before it renders, so for that engine the order is a\n * second guarantee rather than the only one.\n *\n * While a phrase sings, `bend` belongs to it: 0 on its first note, so a\n * channel's own bend does not transpose a sung line, whose pitches already\n * came through the caller's tuning exactly. The resets at `end` go after\n * the NoteOff at the same time. A released vocal voice ignores phoneme and\n * bend (the pool sends every Param to every voice, and a tail must not be\n * reshaped by what follows), so they do not touch the phrase's tail. They\n * put back the phoneme and bend the channel had of its own, which the\n * caller passes in, so a plain note() after a sung line sings what it sang\n * before the line, at its own pitch, not the line's last consonant a fifth\n * away.\n *\n * ONE PHRASE AT A TIME ON A CHANNEL\n *\n * Because phoneme and bend are channel parameters, two phrases that\n * overlap on one channel reshape each other: the later one's opening\n * consonants reach the earlier one's live voice, and the earlier one's\n * resets land on the later one. planSung keeps the phrases of one plan\n * apart; `busy` carries the phrases earlier calls posted. A phrase that\n * would start inside one starts where it ends instead, dropping or\n * shortening its opening sounds; a phrase that would run into a later one\n * already posted ends where that one starts, and posts no resets there,\n * since they would land after the later phrase's opening events at the\n * same time. What is left out is counted in `trimmed`. The earlier phrase\n * wins because its events are already in the kernel and cannot be taken\n * back.\n *\n * EARLY RELEASES\n *\n * The vocal engine releases a stop when the next sound's phoneme arrives,\n * and after an aspirated release (p t k, not after /s/) voicing waits for\n * the glottis to close again; the formant voice held it off for the stop's\n * VOT, 58 to 80 ms, and the rule below was set for that. Posted at the vowel's own beat, the\n * vowel then started 70 to 91 ms late (MEASURED, 110 Hz). So the release\n * goes out early by lead = VOT + VOICING_LAG, the time from the release to\n * the voicing's half level: the stop starts `lead` before its span (but\n * not before the middle of the sound ahead of it, which keeps half its\n * time) and the vowel at its beat minus `lead` (but at least MIN_CLOSURE\n * after the stop starts). A phrase that opens on such a stop moves its\n * NoteOn back with it, and `leadIn` counts that. Measured on the posted\n * events, the vowel after /p t k/ moved from 70, 81, 91 ms after its beat\n * to 2, 4, 5. The plan's spans keep their times, vowel on the beat;\n * only the events that sing them move. At sixteenths the VOT outlasts a\n * short vowel whatever the release time; that needs a shorter VOT, which\n * nothing here can ask the engine for.\n *\n * SOUNDS AHEAD AND EARLY BENDS\n *\n * The articulatory vocal engine plans like a singer: a stop closes 22 to\n * 31 ms before its own time, a nasal lowers the velum 20 ms early, the next\n * vowel ramps in through the consonants before it, and a closure releases\n * before the sound after it. So with `planLead` each sound after a phrase's\n * first is also announced that far ahead (but not before the NoteOn, after\n * which the announcements at the NoteOn's time go): `nextIn`, the seconds\n * until it starts, then `nextPhoneme`, the sound. Its `phoneme` event still\n * goes at its own time and confirms it. With `bendLead` each bend goes out\n * that much early (not before the NoteOn), the time the engine's glide\n * takes to be half way, so its preparation lands before the note and its\n * overshoot after. Both default to 0, the old events exactly; the facade\n * passes VOCAL_PLAN_LEAD and vocalGlideLead() of the channel's glide,\n * overshoot and preparation.\n *\n * bend is a unit conversion, not a tuning. The Hz came through the\n * caller's tuning layer, and 12 log2 of a frequency ratio is that ratio in\n * semitones whatever divided the octave; test/integration/sing.test.ts\n * checks that a 19-EDO line comes back from its bends to 1e-12 of each\n * note's Hz. The engine's bend spans 48 semitones either way, four octaves\n * from the phrase's first note, and clamps beyond that.\n *\n * A span whose IPA the engine has no phoneme for (vocalPhonemeIndex gives\n * -1: typed IPA can ask for \u00E7 or \u028D) keeps the sound before it, which at a\n * phrase's start is the silence of the breath before it. That invents no\n * sound and keeps every later span on its time. The symbols are reported,\n * once each, rather than thrown, so one exotic letter does not cost a\n * caller the whole line.\n *\n * A planner, run off the audio thread; it allocates.\n */\n\nimport type { KernelEvent } from 'bellowsjs';\nimport { EventKind } from 'bellowsjs';\nimport type { SungPhrase, SungPlan } from './lyrics/types';\nimport {\n VOCAL_ACOUSTICS,\n VOCAL_DEFAULT_PHONEME,\n vocalPhonemeIndex,\n vocalReleaseAspirated,\n vocalReleaseVot,\n} from './engines/vocal-phonemes';\nimport { BEAT_PREFIX, beatTokenIndex, vocalIsBeat } from './engines/vocal-beats';\n\n/** The silence a phrase opens from, '_' in VOCAL_PHONEMES. */\nconst SILENCE = vocalPhonemeIndex('_');\n\n/**\n * Seconds from the end of a VOT to the voicing's half level in the vocal\n * engine at articulation 1: its VOICING_TIME is 30 ms to 98 percent, and a\n * critically damped step is half way at 0.29 of that, 8.6 ms; release to\n * half voicing measured 79, 65 and 88 ms after /t p k/ for VOTs of 70, 58\n * and 80.\n */\nconst VOICING_LAG = 0.01;\n/** The shortest closure an early release leaves a stop, in seconds. */\nconst MIN_CLOSURE = 0.02;\n\n/** One phrase as posted on a channel: from its first event to its NoteOff. */\nexport interface SungWindow {\n start: number;\n end: number;\n /** Whether the phrase put the channel's own phoneme and bend back at `end`. */\n resets: boolean;\n}\n\nexport interface SungEventOptions {\n /** Kernel channel the vocal instrument plays on. */\n channel: number;\n /** Interned index of the engine's `phoneme` parameter: internParam('phoneme'). */\n phonemeParam: number;\n /** Interned index of `bend`: internParam('bend'). */\n bendParam: number;\n /**\n * Interned indices of `nextPhoneme` and `nextIn`. With planLead > 0, each\n * sound after a phrase's first is also posted planLead early (but not\n * before the phrase's NoteOn) as nextIn, the seconds until it starts,\n * then nextPhoneme, the sound: the engine's planner then starts the\n * gestures that lead a sound before it (engines/vocal-planner.ts).\n */\n nextPhonemeParam?: number;\n nextInParam?: number;\n /** Seconds each sound is announced ahead. Default 0, none. */\n planLead?: number;\n /**\n * Seconds each bend goes out early (but not before the NoteOn), so the\n * engine's pitch glide, with its preparation and overshoot, is half way\n * on the note: vocalGlideLead() of the channel's settings. Default 0.\n */\n bendLead?: number;\n /** Note id of the first phrase; phrase k plays as firstNoteId + k. Default 1. */\n firstNoteId?: number;\n /** The phoneme index the channel returns to after each phrase, its own. Default VOCAL_DEFAULT_PHONEME. */\n restPhoneme?: number;\n /** The bend the channel returns to after each phrase, its own. Default 0. */\n restBend?: number;\n /** Phrases earlier calls posted on this channel, in time order. New phrases fit between them. */\n busy?: readonly SungWindow[];\n /**\n * The earliest time an early release may move a stop to: 0 in an offline\n * render, the context's time live. A stop moved before it would never sound.\n */\n notBefore?: number;\n}\n\nexport interface SungEvents {\n /** In time order, ready for a kernel `events` message. */\n events: KernelEvent[];\n /** IPA the engine has no phoneme for, each once, in order of first use. */\n unknown: string[];\n /** Each phrase as posted, in time order: what the caller adds to `busy` for the next call. */\n windows: SungWindow[];\n /** The longest time a posted phrase starts before its first note's beat, early releases included. */\n leadIn: number;\n /** Seconds of the plan left out where phrases would have overlapped `busy` or each other. */\n trimmed: number;\n}\n\n/**\n * The kernel events that sing a plan on one channel running the vocal\n * engine: one note per phrase, with `phoneme` and `bend` Param events\n * inside it. Never throws on a plan planSung produced; an unknown IPA\n * symbol keeps the sound before it and is listed in `unknown`.\n */\nexport function sungEvents(plan: SungPlan, opts: SungEventOptions): SungEvents {\n const result: SungEvents = { events: [], unknown: [], windows: [], leadIn: 0, trimmed: 0 };\n const busy = (opts.busy ?? []).slice().sort((a, b) => a.start - b.start);\n const first = opts.firstNoteId ?? 1;\n plan.phrases.forEach((phrase, k) => phraseEvents(phrase, first + k, opts, busy, result));\n return result;\n}\n\nfunction isVowel(idx: number): boolean {\n // a beat (engines/vocal-beats.ts) sits past the phoneme table\n return VOCAL_ACOUSTICS[idx]?.cls === 'vowel';\n}\n\nfunction phraseEvents(phrase: SungPhrase, noteId: number, opts: SungEventOptions, busy: SungWindow[], result: SungEvents): void {\n /* planSung never makes these; a plan built by hand might. */\n if (phrase.spans.length === 0 || phrase.pitches.length === 0) return;\n if (!validHz(phrase.pitches[0].hz)) return;\n\n const ch = opts.channel;\n const param = (time: number, index: number, value: number): KernelEvent => ({\n time,\n kind: EventKind.Param,\n target: ch,\n a: index,\n b: value,\n c: 0,\n });\n const unknown = result.unknown;\n const lookup = (ipa: string): number => {\n const idx = ipa.startsWith(BEAT_PREFIX) ? beatTokenIndex(ipa) : vocalPhonemeIndex(ipa);\n if (idx < 0 && !unknown.includes(ipa)) unknown.push(ipa);\n return idx;\n };\n\n /* The sound at each span start where it changes. */\n const times: number[] = [];\n const sounds: number[] = [];\n let sound = SILENCE;\n phrase.spans.forEach((span, s) => {\n const idx = lookup(span.ipa);\n if (s === 0) sound = idx < 0 ? SILENCE : idx;\n // a beat strikes again on its own; a phoneme that repeats is the same sound held\n else if (idx < 0 || (idx === sound && !vocalIsBeat(idx))) return;\n else sound = idx;\n times.push(s === 0 ? phrase.start : span.start);\n sounds.push(sound);\n });\n\n /* Aspirated releases go out early, so the vowel's voicing lands on its beat. */\n for (let k = 0; k + 1 < sounds.length; k++) {\n const next = sounds[k + 1];\n // the engine sees the sound before the note's first one as none\n const prev = k > 0 ? sounds[k - 1] : -1;\n if (!isVowel(next) || !vocalReleaseAspirated(sounds[k], prev)) continue;\n const lead = vocalReleaseVot(sounds[k], prev, next) + VOICING_LAG;\n // never back past the middle of the sound before, a phrase already\n // posted on the channel (fitting would cut the stop away), or now\n const floor = k > 0 ? (times[k - 1] + times[k]) / 2 : Math.min(times[0], openingFloor(busy, times[0], opts.notBefore));\n const stop = Math.max(times[k] - lead, floor);\n const beat = times[k + 1];\n times[k] = stop;\n times[k + 1] = Math.min(beat, Math.max(stop + MIN_CLOSURE, beat - lead));\n }\n\n /* Fit the phrase between the ones already posted on the channel. */\n const start0 = times[0];\n const end0 = phrase.end;\n let start = start0;\n for (const w of busy) if (w.start <= start && w.end > start) start = w.end;\n let end = end0;\n let meets = false;\n for (const w of busy) {\n if (w.start >= start && w.start <= end) {\n end = w.start;\n meets = true;\n break;\n }\n }\n if (!(end > start)) {\n result.trimmed += end0 - start0;\n return;\n }\n result.trimmed += start - start0 + (end0 - end);\n\n /* What is sounding, and at what pitch, where the fitted phrase opens. */\n let open = 0;\n while (open + 1 < times.length && times[open + 1] <= start) open++;\n let p0 = 0;\n while (p0 + 1 < phrase.pitches.length && phrase.pitches[p0 + 1].time <= start) p0++;\n let openHz = phrase.pitches[p0].hz;\n if (!validHz(openHz)) openHz = phrase.pitches[0].hz;\n\n /* Inside the note: [time, rank, event], merged by time and, at a tie, by rank, then posting order. */\n const inner: Array<[number, number, KernelEvent]> = [];\n for (let k = open + 1; k < times.length; k++) if (times[k] < end) inner.push([times[k], 0, param(times[k], opts.phonemeParam, sounds[k])]);\n const lead = opts.bendLead !== undefined && opts.bendLead > 0 ? opts.bendLead : 0;\n let bend = 0;\n for (let p = p0 + 1; p < phrase.pitches.length; p++) {\n const t = phrase.pitches[p].time;\n if (t >= end) break;\n const st = 12 * Math.log2(phrase.pitches[p].hz / openHz);\n if (st === bend || !Number.isFinite(st)) continue;\n bend = st;\n // the first change waits at least half its note: posted at the NoteOn it reached a fresh voice, which\n // snaps, and a short opening note under a long glide was sung at the second note's pitch (MEASURED:\n // 100 ms at 220 Hz then 330 Hz with glide 0.5 sang 330 throughout)\n const floor = p === p0 + 1 ? phrase.pitches[p0].time + 0.5 * (t - phrase.pitches[p0].time) : start;\n const at = Math.max(start, floor, t - lead);\n inner.push([at, 1, param(at, opts.bendParam, st)]);\n }\n const ahead = opts.planLead !== undefined && opts.planLead > 0 ? opts.planLead : 0;\n if (ahead > 0 && opts.nextPhonemeParam !== undefined && opts.nextInParam !== undefined) {\n for (let k = open + 1; k < times.length; k++) {\n if (!(times[k] < end)) continue;\n const at = Math.max(start, times[k] - ahead);\n inner.push([at, 2, param(at, opts.nextInParam, times[k] - at)]);\n inner.push([at, 2, param(at, opts.nextPhonemeParam, sounds[k])]);\n }\n }\n const order = inner.map((_, i) => i);\n order.sort((a, b) => inner[a][0] - inner[b][0] || inner[a][1] - inner[b][1] || a - b);\n\n const out = result.events;\n out.push(param(start, opts.bendParam, 0));\n out.push(param(start, opts.phonemeParam, sounds[open]));\n out.push({ time: start, kind: EventKind.NoteOn, target: ch, a: noteId, b: openHz, c: phrase.vel });\n /* At a tie the phoneme goes first, then the bend, then what is announced ahead. */\n for (const i of order) out.push(inner[i][2]);\n /* Meeting a later phrase, the NoteOff sorts ahead of that phrase's opening\n events at the same time, or this voice would take its sound before it\n releases; a nanosecond is inside the same frame at any sample rate. */\n out.push({ time: meets ? end - 1e-9 : end, kind: EventKind.NoteOff, target: ch, a: noteId, b: 0, c: 0 });\n if (!meets) {\n out.push(param(end, opts.bendParam, opts.restBend ?? 0));\n out.push(param(end, opts.phonemeParam, opts.restPhoneme ?? VOCAL_DEFAULT_PHONEME));\n }\n\n const window: SungWindow = { start, end, resets: !meets };\n result.windows.push(window);\n let at = busy.length;\n while (at > 0 && busy[at - 1].start > start) at--;\n busy.splice(at, 0, window);\n\n const firstVowel = phrase.spans.find((s) => s.kind === 'nucleus');\n const beat = firstVowel ? firstVowel.start : phrase.start;\n if (beat - start > result.leadIn) result.leadIn = beat - start;\n}\n\n/** The latest end of a posted phrase at or before `t`, or `notBefore`, whichever is later. */\nfunction openingFloor(busy: readonly SungWindow[], t: number, notBefore = -Infinity): number {\n let floor = notBefore;\n for (const w of busy) if (w.start <= t && w.end > floor) floor = w.end;\n return floor;\n}\n\nfunction validHz(hz: number): boolean {\n return hz > 0 && Number.isFinite(hz);\n}\n"],
|
|
5
|
-
"mappings": ";stBAEO,IAAMA,GAAsB,2g5JCG5B,IAAMC,EAAgC,CAC3C,GAAM,QACN,MAAS,QACT,OAAU,CACR,CACE,KAAQ,UACR,IAAO,EACP,IAAO,GACP,QAAW,CACb,EACA,CACE,KAAQ,OACR,IAAO,IACP,IAAO,GACP,QAAW,EACX,KAAQ,IACV,EACA,CACE,KAAQ,QACR,IAAO,KACP,IAAO,GACP,QAAW,IACX,MAAS,MACT,KAAQ,GACV,EACA,CACE,KAAQ,OACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,UACR,IAAO,EACP,IAAO,EACP,QAAW,GACb,EACA,CACE,KAAQ,YACR,IAAO,EACP,IAAO,EACP,QAAW,GACb,EACA,CACE,KAAQ,MACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,QACR,IAAO,EACP,IAAO,GACP,QAAW,EACX,KAAQ,OACV,EACA,CACE,KAAQ,UACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,SACR,IAAO,EACP,IAAO,EACP,QAAW,GACb,EACA,CACE,KAAQ,cACR,IAAO,EACP,IAAO,GACP,QAAW,IACX,KAAQ,IACV,EACA,CACE,KAAQ,eACR,IAAO,EACP,IAAO,EACP,QAAW,GACX,KAAQ,IACV,EACA,CACE,KAAQ,eACR,IAAO,EACP,IAAO,EACP,QAAW,IACX,KAAQ,GACV,EACA,CACE,KAAQ,eACR,IAAO,IACP,IAAO,EACP,QAAW,EACX,MAAS,KACX,EACA,CACE,KAAQ,SACR,IAAO,KACP,IAAO,EACP,QAAW,IACX,MAAS,MACT,KAAQ,GACV,EACA,CACE,KAAQ,UACR,IAAO,IACP,IAAO,EACP,QAAW,IACX,MAAS,MACT,KAAQ,GACV,EACA,CACE,KAAQ,QACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,YACR,IAAO,EACP,IAAO,GACP,QAAW,IACb,EACA,CACE,KAAQ,cACR,IAAO,EACP,IAAO,EACP,QAAW,GACb,EACA,CACE,KAAQ,OACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,MACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,SACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,WACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,OACR,IAAO,GACP,IAAO,KACP,QAAW,CACb,EACA,CACE,KAAQ,UACR,IAAO,GACP,IAAO,KACP,QAAW,CACb,EACA,CACE,KAAQ,SACR,IAAO,GACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,cACR,IAAO,GACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,aACR,IAAO,GACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,WACR,IAAO,GACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,UACR,IAAO,GACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,YACR,IAAO,GACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,QACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,QACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,SACR,IAAO,GACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,SACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,SACR,IAAO,EACP,IAAO,EACP,QAAW,EACX,KAAQ,GACV,EACA,CACE,KAAQ,cACR,IAAO,EACP,IAAO,GACP,QAAW,CACb,CACF,EACA,UAAa,CACf,EC1OO,IAAMC,GAAuB,CAClC,GAAI,gBACJ,QAASC,GACT,QAAS,CAACC,CAAiB,CAC7B,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,CAAC,EAC9B,QAAWV,KAAKH,EAAM,QAChB,CAACG,EAAE,QAAUA,EAAE,IAAMD,GACrBF,EAAM,QAAQ,KAAMc,GAAMA,EAAE,QAAUX,EAAE,GAAG,GAC/CU,EAAM,KAAK,CAAE,KAAMV,EAAE,IAAK,KAAMY,GAAU,MAAO,OAAQ,KAAK,WAAW,QAAS,EAAGH,EAAK,EAAGjD,EAAO,EAAG,CAAE,CAAC,EAExGkD,EAAM,OAAS,GAAG,KAAK,EAAE,iBAAiBA,CAAK,CACrD,CACF,EAOO,SAASG,GAAOnE,EAAYC,EAAuD,CAAC,EAAGC,EAAsB,CAAC,EAAW,CAC9H,OAAO,IAAIH,EAAOC,EAAGC,EAAOC,CAAI,CAClC,CAEA,SAASG,GAASM,EAA8B,CAC9C,OAAO,OAAOA,GAAM,UAAYA,IAAM,MAAQ,WAAYA,GAAK,aAAcA,GAAK,UAAWA,CAC/F",
|
|
4
|
+
"sourcesContent": ["/* Generated by scripts/gen-plugin.mjs. Do not edit by hand. */\n// prettier-ignore\nexport const workletCode: string = \"/*! 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 */\\n\\\"use strict\\\";(()=>{function Vn(r){return 440*Math.pow(2,(r-69)/12)}function z(r,t,e){return r>=t?r<=e?r:e:t}function Gn(r){let t=1779033703^r.length;for(let e=0;e<r.length;e++)t=Math.imul(t^r.charCodeAt(e),3432918353),t=t<<13|t>>>19;return function(){return t=Math.imul(t^t>>>16,2246822507),t=Math.imul(t^t>>>13,3266489909),(t^=t>>>16)>>>0}}function Un(r){return function(){r|=0,r=r+1831565813|0;let t=Math.imul(r^r>>>15,1|r);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}function wi(r){let t=Un(Gn(r)()),e=(()=>t());return e.label=r,e.fork=s=>wi(r+\\\"::\\\"+s),e.int=s=>t()*s|0,e.pick=s=>s[t()*s.length|0],e.range=(s,a)=>s+t()*(a-s),e.chance=s=>t()<s,e.shuffle=s=>{let a=s.slice();for(let i=a.length-1;i>0;i--){let n=t()*(i+1)|0,o=a[i];a[i]=a[n],a[n]=o}return a},e.gauss=()=>(t()+t()+t()+t()-2)*Math.SQRT2*.875,e.weighted=s=>{let a=0;for(let n=0;n<s.length;n++)a+=s[n];let i=t()*a;for(let n=0;n<s.length;n++)if(i-=s[n],i<=0)return n;return s.length-1},e}var bi=class r{size;periodCents;refFreq;refIndex;degreeCents;constructor(t,e,s,a){if(t.length<1)throw new Error(\\\"Tuning: needs at least one degree\\\");if(!Number.isFinite(e)||e<=0)throw new Error(\\\"Tuning: period must span a positive number of cents\\\");if(!Number.isFinite(s)||s<=0)throw new Error(\\\"Tuning: reference frequency must be positive\\\");if(!Number.isInteger(a))throw new Error(\\\"Tuning: reference index must be an integer\\\");for(let i of t)if(!Number.isFinite(i)&&!Number.isNaN(i))throw new Error(\\\"Tuning: degree cents must be finite or NaN\\\");this.degreeCents=t.slice(),this.size=t.length,this.periodCents=e,this.refFreq=s,this.refIndex=a}static edo(t,e=440,s=69){if(!Number.isInteger(t)||t<1)throw new Error(\\\"Tuning.edo: n must be a positive integer\\\");let a=new Array(t);for(let i=0;i<t;i++)a[i]=1200*i/t;return new r(a,1200,e,s)}static ji(t,e=440,s=69,a=2){if(t.length<1)throw new Error(\\\"Tuning.ji: needs at least one ratio\\\");if(!(a>1))throw new Error(\\\"Tuning.ji: period ratio must be greater than 1\\\");let i=new Array(t.length);for(let n=0;n<t.length;n++){let o=t[n];if(!Number.isFinite(o)||o<=0)throw new Error(\\\"Tuning.ji: ratios must be positive\\\");i[n]=1200*Math.log2(o)}return new r(i,1200*Math.log2(a),e,s)}static fromCents(t,e=1200,s=440,a=69){return new r(t,e,s,a)}static default12=r.edo(12);centsOf(t){if(Number.isInteger(t))return this.centsAt(t);let e=Math.floor(t),s=t-e,a=this.centsAt(e);return a+s*(this.centsAt(e+1)-a)}freqOf(t){return this.refFreq*Math.pow(2,this.centsOf(t)/1200)}midiToFreq(t){return this.freqOf(t)}transposeCents(t){if(!Number.isFinite(t))throw new Error(\\\"Tuning.transposeCents: cents must be finite\\\");return new r(this.degreeCents,this.periodCents,this.refFreq*Math.pow(2,t/1200),this.refIndex)}transposeRatio(t){if(!Number.isFinite(t)||t<=0)throw new Error(\\\"Tuning.transposeRatio: ratio must be positive\\\");return new r(this.degreeCents,this.periodCents,this.refFreq*t,this.refIndex)}transposeSteps(t){if(!Number.isInteger(t))throw new Error(\\\"Tuning.transposeSteps: steps must be an integer\\\");return new r(this.degreeCents,this.periodCents,this.refFreq,this.refIndex-t)}centsAt(t){let e=t-this.refIndex,s=Math.floor(e/this.size),a=e-s*this.size;return s*this.periodCents+this.degreeCents[a]}};var gi=1.5,jn=Math.log(3),xi=Math.log(100),yi=1e-4,Ps=class{sampleRate;stage=0;lvl=0;sus=1;aCoef=1;dCoef=1;rCoef=1;constructor(t){this.sampleRate=t,this.set(.01,.1,.7,.2)}coef(t,e){return t>0?1-Math.exp(-e/(t*this.sampleRate)):1}set(t,e,s,a){!Number.isFinite(t)||!Number.isFinite(e)||!Number.isFinite(s)||!Number.isFinite(a)||(this.aCoef=this.coef(t,jn),this.dCoef=this.coef(e,xi),this.rCoef=this.coef(a,xi),this.sus=z(s,0,1))}trigger(){this.stage=1}release(){this.stage!==0&&(this.stage=4)}next(){switch(this.stage){case 0:return 0;case 1:return this.lvl+=this.aCoef*(gi-this.lvl),this.lvl>=1&&(this.lvl=1,this.stage=2),this.lvl;case 2:return this.lvl+=this.dCoef*(this.sus-this.lvl),Math.abs(this.lvl-this.sus)<1e-4&&(this.lvl=this.sus,this.stage=3),this.lvl;case 3:return this.lvl=this.sus,this.lvl;case 4:return this.lvl-=this.rCoef*this.lvl,this.lvl<yi&&(this.lvl=0,this.stage=0),this.lvl}}fill(t,e,s){let a=this.lvl,i=this.stage;for(let n=e;n<s;n++)i===1?(a+=this.aCoef*(gi-a),a>=1&&(a=1,i=2)):i===2?(a+=this.dCoef*(this.sus-a),Math.abs(a-this.sus)<1e-4&&(a=this.sus,i=3)):i===3?a=this.sus:i===4?(a-=this.rCoef*a,a<yi&&(a=0,i=0)):a=0,t[n]=a;this.lvl=a,this.stage=i}get active(){return this.stage!==0}get level(){return this.lvl}reset(){this.stage=0,this.lvl=0}};var Yh=Math.PI/2;var Wh=Math.PI*2,Xn=16,Yn=64;var Kh=2*Xn*Yn+1;var Wn=6;var Kn=[1,.6,.5,.4,.4,.3];function $n(){let r=[{name:\\\"ops\\\",min:2,max:6,default:4},{name:\\\"algorithm\\\",min:1,max:8,default:1},{name:\\\"feedback\\\",min:0,max:1,default:0},{name:\\\"brightness\\\",min:0,max:2,default:.5},{name:\\\"attack\\\",min:0,max:10,default:.003,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"decay\\\",min:0,max:10,default:.3,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"sustain\\\",min:0,max:1,default:.7},{name:\\\"release\\\",min:0,max:10,default:.3,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"mAttack\\\",min:0,max:10,default:.002,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"mDecay\\\",min:0,max:10,default:.4,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"mSustain\\\",min:0,max:1,default:.5},{name:\\\"mRelease\\\",min:0,max:10,default:.2,curve:\\\"exp\\\",unit:\\\"s\\\"}];for(let t=1;t<=Wn;t++)r.push({name:\\\"ratio\\\"+t,min:0,max:16,default:1}),r.push({name:\\\"level\\\"+t,min:0,max:1,default:Kn[t-1]}),r.push({name:\\\"fixed\\\"+t,min:0,max:1e4,default:0,unit:\\\"Hz\\\"});return r}var $h=$n();var Zn=32,Zh=Math.PI*2;function Qn(){let r=[{name:\\\"morph\\\",min:0,max:1,default:0},{name:\\\"inharm\\\",min:0,max:.02,default:0},{name:\\\"decay\\\",min:.01,max:20,default:2,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"rolloff\\\",min:.3,max:1,default:.8},{name:\\\"attack\\\",min:0,max:10,default:.002,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"release\\\",min:0,max:10,default:.3,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"gain\\\",min:0,max:2,default:1}];for(let t=1;t<=Zn;t++)r.push({name:\\\"partial\\\"+t,min:0,max:1,default:1/t}),r.push({name:\\\"target\\\"+t,min:0,max:1,default:t===1?1:0}),r.push({name:\\\"detune\\\"+t,min:-100,max:100,default:0,unit:\\\"cents\\\"});return r}var Qh=Qn();var Jh=Math.PI*2;var tl=Math.PI*2,el=Math.log(1e3);var sl=2**30-4;var al=Math.PI*2;var il=Math.PI*2;var Jn=7;var Ve=17,nl=Jn+Ve,tr=new Float64Array(Ve),er=new Float64Array(Ve),sr=new Float64Array(Ve);{let r=wi(\\\"string-body-forest\\\");for(let t=0;t<Ve;t++){let e=800*Math.pow(10,t/(Ve-1));tr[t]=e*(1+(2*r()-1)*.12),er[t]=8+17*r(),sr[t]=(.15+.25*r())*(t%2===0?1:-1)}}var ar=.9,ir=1.3,rl=1/(1+ar)*ir;var ol=Math.PI*2;var nr=33,rr=16,wa=16;function or(){let r=new Float64Array(wa),t=0;for(let s=0;s<wa;s++){let a=2*s+1,i=a-rr,n=Math.PI*i/2,o=Math.sin(n)/n,l=2*Math.PI*a/(nr-1),h=.42-.5*Math.cos(l)+.08*Math.cos(2*l);r[s]=.5*o*h,t+=r[s]}let e=.5/t;for(let s=0;s<wa;s++)r[s]*=e;return r}var hl=or();var Ma=64,Es=1024,ka=Math.PI*2,Ls=null;function hr(){if(Ls===null){Ls=new Float32Array(Es);for(let r=0;r<Es;r++)Ls[r]=.5*(1-Math.cos(ka*r/(Es-1)))}return Ls}function lr(){return{live:!1,pos:0,step:0,age:0,dur:0,amp:0,gl:0,gr:0}}function oe(r,t,e){let s=r[t];return typeof s==\\\"number\\\"&&Number.isFinite(s)?s:e}var Aa=class{sr;rng;buffer;bufferRate;window;grains;liveGrains=0;gate=!1;vel=1;rateBase=1;countdown=0;grainSize;density;position;spray;pitch;pitchJitter;spread;reverse;baseNote;level;constructor(t,e,s,a,i){this.sr=t,this.rng=s,this.buffer=a,this.bufferRate=i,this.window=hr(),this.grains=[];for(let n=0;n<Ma;n++)this.grains.push(lr());this.grainSize=oe(e,\\\"grainSize\\\",80),this.density=oe(e,\\\"density\\\",20),this.position=oe(e,\\\"position\\\",.25),this.spray=oe(e,\\\"spray\\\",.05),this.pitch=oe(e,\\\"pitch\\\",1),this.pitchJitter=oe(e,\\\"pitchJitter\\\",0),this.spread=oe(e,\\\"spread\\\",.5),this.reverse=oe(e,\\\"reverse\\\",0),this.baseNote=oe(e,\\\"baseNote\\\",69),this.level=oe(e,\\\"level\\\",.9)}noteOn(t,e){this.vel=z(e,0,1),this.gate=!0,this.rateBase=t/Vn(this.baseNote)*(this.bufferRate/this.sr),this.countdown=0;for(let s of this.grains)s.live=!1;this.liveGrains=0}noteOff(){this.gate=!1}spawn(){let t=2*this.rng()-1,e=2*this.rng()-1,s=this.rng(),a=2*this.rng()-1,i=null;for(let p=0;p<Ma;p++)if(!this.grains[p].live){i=this.grains[p];break}if(i===null)return;let n=z(this.grainSize,10,500)/1e3,o=Math.max(2,Math.round(n*this.sr)),l=z(this.position+z(this.spray,0,1)*t,0,1),h=this.rateBase*z(this.pitch,.25,4);h*=Math.pow(2,z(this.pitchJitter,0,12)*e/12),s<z(this.reverse,0,1)&&(h=-h);let m=(.5+.5*z(this.spread,0,1)*a)*Math.PI/2;i.live=!0,i.pos=l*(this.buffer.length-2),i.step=h,i.age=0,i.dur=o,i.amp=this.vel/Math.sqrt(Math.max(1,this.density*n)),i.gl=Math.cos(m),i.gr=Math.sin(m),this.liveGrains++}process(t,e,s,a){if(!this.gate&&this.liveGrains===0)return;let i=this.buffer,n=i.length-2,o=this.window,l=Es-1,h=this.level;for(let m=s;m<a;m++){if(this.gate)for(this.countdown-=1;this.countdown<=0;)this.spawn(),this.countdown+=this.sr/z(this.density,.5,400);let p=0,v=0;for(let N=0;N<Ma;N++){let u=this.grains[N];if(!u.live)continue;let k=u.age/u.dur*l,g=k|0,S=k-g,d=o[g]+S*(o[g+1]-o[g]),x=u.pos|0,M=u.pos-x,f=(i[x]+M*(i[x+1]-i[x]))*d*u.amp;p+=f*u.gl,v+=f*u.gr,u.pos+=u.step,u.age++,(u.age>=u.dur-1||u.pos<0||u.pos>=n)&&(u.live=!1,this.liveGrains--)}t[m]+=p*h,e[m]+=v*h}}setParam(t,e){switch(t){case\\\"grainSize\\\":this.grainSize=e;break;case\\\"density\\\":this.density=e;break;case\\\"position\\\":this.position=e;break;case\\\"spray\\\":this.spray=e;break;case\\\"pitch\\\":this.pitch=e;break;case\\\"pitchJitter\\\":this.pitchJitter=e;break;case\\\"spread\\\":this.spread=e;break;case\\\"reverse\\\":this.reverse=e;break;case\\\"baseNote\\\":this.baseNote=e;break;case\\\"level\\\":this.level=e;break}}get active(){return this.gate||this.liveGrains>0}},cr=[{name:\\\"grainSize\\\",min:10,max:500,default:80,curve:\\\"exp\\\",unit:\\\"ms\\\"},{name:\\\"density\\\",min:.5,max:400,default:20,curve:\\\"exp\\\",unit:\\\"Hz\\\"},{name:\\\"position\\\",min:0,max:1,default:.25},{name:\\\"spray\\\",min:0,max:1,default:.05},{name:\\\"pitch\\\",min:.25,max:4,default:1,curve:\\\"exp\\\"},{name:\\\"pitchJitter\\\",min:0,max:12,default:0,unit:\\\"st\\\"},{name:\\\"spread\\\",min:0,max:1,default:.5},{name:\\\"reverse\\\",min:0,max:1,default:0},{name:\\\"baseNote\\\",min:24,max:96,default:69},{name:\\\"level\\\",min:0,max:1,default:.9}];function Nr(r,t,e=\\\"granular\\\"){return{id:e,label:\\\"Granular\\\",params:cr,polyphony:8,createVoice:(s,a,i)=>new Aa(s,a,i,r,t)}}var Ra=44100,Fs=null;function mr(){if(Fs===null){let r=Ra;Fs=new Float32Array(r);let t=Math.round(.01*r);for(let e=0;e<r;e++){let s=e/Ra,a=1;e<t?a=e/t:e>r-t&&(a=(r-e)/t),Fs[e]=a*(.7*Math.sin(ka*220*s)+.2*Math.sin(ka*440*s))}}return Fs}var ll=Nr(mr(),Ra);var cl=Math.PI*2;var pr=-96,Nl=Math.pow(10,pr/20),ml=Math.LN10/20;var pl=Math.PI*2,fr=[.6923877778065,.9360654322959,.988229522686,.9987488452737],ur=[.4021921162426,.856171088242,.9722909545651,.9952884791278],fl=new Float64Array(fr.map(r=>r*r)),ul=new Float64Array(ur.map(r=>r*r));var dr=6;var vr=[80,250,800,2500,6e3,12e3],br=[.707,1,1,1,1,.707];function gr(){let r=[];for(let t=0;t<dr;t++)r.push({name:\\\"b\\\"+t+\\\"freq\\\",min:20,max:2e4,default:vr[t],curve:\\\"exp\\\",unit:\\\"Hz\\\"}),r.push({name:\\\"b\\\"+t+\\\"gain\\\",min:-24,max:24,default:0,unit:\\\"dB\\\"}),r.push({name:\\\"b\\\"+t+\\\"q\\\",min:.1,max:12,default:br[t]}),r.push({name:\\\"b\\\"+t+\\\"enabled\\\",min:0,max:1,default:1});return r}var dl=gr();var vl=2*Math.PI;var bl=Object.freeze({stages:5,hz:5300,bw:1500}),gl=Object.freeze({stages:5,hz:5400,bw:1500}),xl=Object.freeze({stages:4,hz:5500,bw:1e3}),yl=Object.freeze({stages:2,hz:4700,bw:750}),wl=Object.freeze({stages:1,hz:4600,bw:500}),Ml=Object.freeze({stages:0,hz:4500,bw:1e3});var xr=new Uint32Array(256);for(let r=0;r<256;r++){let t=r<<24;for(let e=0;e<8;e++)t=((t&2147483648)!==0?t<<1^79764919:t<<1)>>>0;xr[r]=t}var kl=16*1024*1024;var Al=8*1024*1024;function as(r){let t={};for(let e=1;e<=32;e++){let s=r[e-1]??0;t[\\\"partial\\\"+e]=s,t[\\\"target\\\"+e]=s}return t}var yr=[{id:\\\"nylon-guitar\\\",label:\\\"NYLON GUITAR\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.5,pickPos:.32,exciteType:.6,decay:2.2,level:.9},gain:.85},{id:\\\"steel-guitar\\\",label:\\\"STEEL GUITAR\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.24,pickPos:.18,exciteType:.2,decay:3.5,level:.85}},{id:\\\"twelve-string\\\",label:\\\"TWELVE STRING\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.26,pickPos:.16,exciteType:.2,decay:3.2,level:.8},fx:[{effectId:\\\"chorus\\\",params:{rate:.8,depth:.35,mix:.55,feedback:0}}]},{id:\\\"muted-electric\\\",label:\\\"MUTED ELECTRIC\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.78,pickPos:.12,exciteType:.35,decay:.35,level:.95},gain:.9},{id:\\\"clean-electric\\\",label:\\\"CLEAN ELECTRIC\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.3,pickPos:.14,exciteType:.15,decay:3,level:.85},fx:[{effectId:\\\"tapeDelay\\\",params:{time:.115,feedback:.12,mix:.22,wow:.06,flutter:.08,saturation:.3,tone:5500,hiss:0}}]},{id:\\\"bass-guitar\\\",label:\\\"BASS GUITAR\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.55,pickPos:.25,exciteType:.45,decay:2.2,level:.95},gain:.9,octave:-2},{id:\\\"banjo\\\",label:\\\"BANJO\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.12,pickPos:.08,exciteType:.55,decay:1.1,level:.8}},{id:\\\"sitar-drone\\\",label:\\\"SITAR DRONE\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.18,pickPos:.04,exciteType:.3,decay:6,level:.75}},{id:\\\"koto\\\",label:\\\"KOTO\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.42,pickPos:.42,exciteType:.75,decay:1.8,level:.85}},{id:\\\"harp\\\",label:\\\"HARP\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.4,pickPos:.5,exciteType:.5,decay:4.5,level:.85}},{id:\\\"clavinet\\\",label:\\\"CLAVINET\\\",family:\\\"guitars\\\",engineId:\\\"pluck\\\",params:{damp:.3,pickPos:.07,exciteType:1,decay:.9,level:.9}},{id:\\\"violin\\\",label:\\\"VIOLIN\\\",family:\\\"strings\\\",engineId:\\\"string\\\",params:{damp:.18,sustain:.85,dispersion:0,bow:.8,bowPressure:.55,bowSpeed:.6,bowPos:.11,body:.8,bodySize:0,bowNoise:.35,attackBite:.5,vibRate:6.1,vibDepth:22,vibOnset:.3,dynamics:.7,polDetune:2,glide:.035,legatoScratch:.2,level:.8},fx:[{effectId:\\\"plate\\\",params:{decay:.42,predelay:.02,mix:.14}}],gain:.94},{id:\\\"viola\\\",label:\\\"VIOLA\\\",family:\\\"strings\\\",engineId:\\\"string\\\",params:{damp:.28,sustain:.85,dispersion:0,bow:.8,bowPressure:.6,bowSpeed:.55,bowPos:.115,body:.8,bodySize:.18,bowNoise:.35,attackBite:.45,vibRate:5.6,vibDepth:20,vibOnset:.3,dynamics:.7,polDetune:2,glide:.04,legatoScratch:.2,level:.8},fx:[{effectId:\\\"plate\\\",params:{decay:.42,predelay:.02,mix:.14}}],gain:1},{id:\\\"cello\\\",label:\\\"CELLO\\\",family:\\\"strings\\\",engineId:\\\"string\\\",params:{damp:.38,sustain:.9,dispersion:0,bow:.85,bowPressure:.65,bowSpeed:.45,bowPos:.125,body:.8,bodySize:.62,bowNoise:.4,attackBite:.55,vibRate:5,vibDepth:16,vibOnset:.35,dynamics:.7,polDetune:1.8,glide:.05,legatoScratch:.2,level:.8},fx:[{effectId:\\\"plate\\\",params:{decay:.42,predelay:.025,mix:.15}}],gain:.94,octave:-1},{id:\\\"double-bass\\\",label:\\\"DOUBLE BASS\\\",family:\\\"strings\\\",engineId:\\\"string\\\",params:{damp:.5,sustain:.9,dispersion:.05,bow:.85,bowPressure:.7,bowSpeed:.35,bowPos:.14,body:.7,bodySize:1,bowNoise:.45,attackBite:.6,vibRate:4.5,vibDepth:10,vibOnset:.4,dynamics:.7,polDetune:1.5,glide:.06,legatoScratch:.2,level:.85},fx:[{effectId:\\\"plate\\\",params:{decay:.42,predelay:.025,mix:.12}}],gain:.66,octave:-2},{id:\\\"pizzicato-strings\\\",label:\\\"PIZZICATO STRINGS\\\",family:\\\"strings\\\",engineId:\\\"string\\\",params:{damp:.45,sustain:.3,dispersion:0,bow:0,body:.6,bodySize:.3,level:.9},gain:1},{id:\\\"concert-flute\\\",label:\\\"CONCERT FLUTE\\\",family:\\\"winds\\\",engineId:\\\"harmonic\\\",params:{brightness:.32,evenOdd:.5,noiseMix:.18,noiseColor:4,attack:.06,release:.2,level:.85},octave:1},{id:\\\"pan-flute\\\",label:\\\"PAN FLUTE\\\",family:\\\"winds\\\",engineId:\\\"harmonic\\\",params:{brightness:.25,evenOdd:.5,noiseMix:.35,noiseColor:3,attack:.05,release:.15,level:.85},octave:1},{id:\\\"clarinet\\\",label:\\\"CLARINET\\\",family:\\\"winds\\\",engineId:\\\"tube\\\",params:{breath:.85,noise:.05,glide:.02,legatoScratch:0,level:.8}},{id:\\\"recorder\\\",label:\\\"RECORDER\\\",family:\\\"winds\\\",engineId:\\\"tube\\\",params:{breath:.7,noise:.12,glide:.02,legatoScratch:0,level:.75},octave:1},{id:\\\"ocarina\\\",label:\\\"OCARINA\\\",family:\\\"winds\\\",engineId:\\\"harmonic\\\",params:{brightness:.08,evenOdd:.5,noiseMix:.1,noiseColor:1,attack:.04,release:.12,level:.9},octave:1},{id:\\\"shakuhachi\\\",label:\\\"SHAKUHACHI\\\",family:\\\"winds\\\",engineId:\\\"harmonic\\\",params:{brightness:.35,evenOdd:.5,noiseMix:.4,noiseColor:2.5,attack:.09,release:.3,level:.85}},{id:\\\"trumpet\\\",label:\\\"TRUMPET\\\",family:\\\"brass\\\",engineId:\\\"harmonic\\\",params:{brightness:.72,evenOdd:.5,formantShift:1.8,noiseMix:.04,attack:.04,release:.15,level:.8}},{id:\\\"trombone\\\",label:\\\"TROMBONE\\\",family:\\\"brass\\\",engineId:\\\"harmonic\\\",params:{brightness:.55,evenOdd:.5,formantShift:.9,noiseMix:.05,attack:.07,release:.2,level:.85},octave:-1},{id:\\\"brass-section\\\",label:\\\"BRASS SECTION\\\",family:\\\"brass\\\",engineId:\\\"harmonic\\\",params:{brightness:.62,evenOdd:.5,formantShift:1.4,noiseMix:.06,attack:.09,release:.25,level:.85},fx:[{effectId:\\\"chorus\\\",params:{rate:.5,depth:.3,mix:.4,feedback:0}}]},{id:\\\"fm-horn\\\",label:\\\"FM HORN\\\",family:\\\"brass\\\",engineId:\\\"fm\\\",params:{ops:2,algorithm:1,ratio1:1,level1:1,ratio2:1,level2:.55,feedback:.25,brightness:.8,attack:.06,decay:.25,sustain:.85,release:.25,mAttack:.09,mDecay:.5,mSustain:.65,mRelease:.2}},{id:\\\"dx-epiano\\\",label:\\\"DX E-PIANO\\\",family:\\\"keys\\\",engineId:\\\"fm\\\",params:{ops:4,algorithm:5,ratio1:1,level1:1,ratio2:1,level2:.4,ratio3:1,level3:.55,ratio4:14,level4:.1,feedback:.1,brightness:.9,attack:.002,decay:1.4,sustain:.2,release:.35,mAttack:.001,mDecay:.3,mSustain:0,mRelease:.2},fx:[{effectId:\\\"chorus\\\",params:{rate:.7,depth:.3,mix:.3,feedback:0}}]},{id:\\\"drawbar-organ\\\",label:\\\"DRAWBAR ORGAN\\\",family:\\\"keys\\\",engineId:\\\"additive\\\",params:{...as([1,.85,.65,.5,.18,.4,.08,.3]),inharm:0,decay:20,rolloff:1,attack:.004,release:.08,gain:1}},{id:\\\"church-organ\\\",label:\\\"CHURCH ORGAN\\\",family:\\\"keys\\\",engineId:\\\"additive\\\",params:{...as([1,.75,.4,.6,.15,.35,.08,.3,0,.12,0,.18]),inharm:0,decay:20,rolloff:1,attack:.04,release:.3,gain:1}},{id:\\\"harpsichord\\\",label:\\\"HARPSICHORD\\\",family:\\\"keys\\\",engineId:\\\"pluck\\\",params:{damp:.2,pickPos:.06,exciteType:1,decay:1.6,level:.85}},{id:\\\"celesta\\\",label:\\\"CELESTA\\\",family:\\\"keys\\\",engineId:\\\"additive\\\",params:{...as([1,.2,.05,.12]),inharm:.001,decay:1.8,rolloff:.55,attack:.001,release:.4,gain:1},octave:1},{id:\\\"music-box\\\",label:\\\"MUSIC BOX\\\",family:\\\"keys\\\",engineId:\\\"additive\\\",params:{...as([1,0,.5,0,.22,0,.1]),inharm:.004,decay:1.3,rolloff:.45,attack:.001,release:.3,gain:1},octave:2},{id:\\\"marimba\\\",label:\\\"MARIMBA\\\",family:\\\"mallets\\\",engineId:\\\"modal\\\",params:{material:0,decay:.4,brightness:.45,strikeHardness:.5,level:.75}},{id:\\\"vibraphone\\\",label:\\\"VIBRAPHONE\\\",family:\\\"mallets\\\",engineId:\\\"modal\\\",params:{material:0,decay:3.5,brightness:.4,strikeHardness:.35,level:.65},fx:[{effectId:\\\"tremolo\\\",params:{rate:4.5,depth:.4,shape:0,phase:0}}]},{id:\\\"glockenspiel\\\",label:\\\"GLOCKENSPIEL\\\",family:\\\"mallets\\\",engineId:\\\"modal\\\",params:{material:0,decay:1.6,brightness:.8,strikeHardness:.85,level:.5},octave:2},{id:\\\"tubular-bells\\\",label:\\\"TUBULAR BELLS\\\",family:\\\"mallets\\\",engineId:\\\"modal\\\",params:{material:2,decay:5,brightness:.5,strikeHardness:.7,level:.55}},{id:\\\"kalimba\\\",label:\\\"KALIMBA\\\",family:\\\"mallets\\\",engineId:\\\"modal\\\",params:{material:0,decay:.9,brightness:.22,strikeHardness:.4,level:.8}},{id:\\\"steel-drum\\\",label:\\\"STEEL DRUM\\\",family:\\\"mallets\\\",engineId:\\\"modal\\\",params:{material:2,decay:1.1,brightness:.62,strikeHardness:.45,level:.7}},{id:\\\"woodblock\\\",label:\\\"WOODBLOCK\\\",family:\\\"mallets\\\",engineId:\\\"modal\\\",params:{material:4,decay:2,brightness:.6,strikeHardness:.9,level:.85}},{id:\\\"timpani\\\",label:\\\"TIMPANI\\\",family:\\\"mallets\\\",engineId:\\\"modal\\\",params:{material:1,decay:3,brightness:.15,strikeHardness:.3,level:.8},octave:-2},{id:\\\"choir-aah\\\",label:\\\"CHOIR AAH\\\",family:\\\"voices\\\",engineId:\\\"formant\\\",params:{vowel:0,breath:.15,vibratoRate:4.5,vibratoDepth:.2,shape:0,level:1},fx:[{effectId:\\\"chorus\\\",params:{rate:.4,depth:.45,mix:.5,feedback:0}}]},{id:\\\"voice-ooh\\\",label:\\\"VOICE OOH\\\",family:\\\"voices\\\",engineId:\\\"formant\\\",params:{vowel:3.2,breath:.12,vibratoRate:5,vibratoDepth:.25,shape:0,level:1.1}},{id:\\\"whistle\\\",label:\\\"WHISTLE\\\",family:\\\"voices\\\",engineId:\\\"additive\\\",params:{...as([1]),inharm:0,decay:20,rolloff:1,attack:.04,release:.12,gain:.9},octave:2},{id:\\\"analog-lead\\\",label:\\\"ANALOG LEAD\\\",family:\\\"synth\\\",engineId:\\\"va\\\",params:{shape:0,detune:9,sub:.2,cutoff:3200,resonance:.35,filterType:0,envAmount:1.5,attack:.004,decay:.15,sustain:.85,release:.18,fAttack:.002,fDecay:.25,fSustain:.45,fRelease:.2,drift:.25}},{id:\\\"fat-saw-pad\\\",label:\\\"FAT SAW PAD\\\",family:\\\"synth\\\",engineId:\\\"va\\\",params:{shape:0,detune:18,sub:.35,cutoff:1600,resonance:.12,filterType:0,envAmount:1,attack:.6,decay:.4,sustain:.85,release:1.1,fAttack:.9,fDecay:.5,fSustain:.6,fRelease:.8,drift:.4},gain:.75},{id:\\\"acid-bass\\\",label:\\\"ACID BASS\\\",family:\\\"synth\\\",engineId:\\\"va\\\",params:{shape:0,detune:0,sub:0,cutoff:320,resonance:.85,filterType:0,envAmount:3,attack:.002,decay:.25,sustain:.55,release:.12,fAttack:.001,fDecay:.18,fSustain:.05,fRelease:.1,drift:.1},octave:-1},{id:\\\"sub-bass\\\",label:\\\"SUB BASS\\\",family:\\\"synth\\\",engineId:\\\"va\\\",params:{shape:3,detune:0,sub:0,cutoff:900,resonance:0,envAmount:0,attack:.004,decay:.1,sustain:1,release:.12,drift:0},gain:.95,octave:-2},{id:\\\"west-coast-pluck\\\",label:\\\"WEST COAST PLUCK\\\",family:\\\"synth\\\",engineId:\\\"westcoast\\\",params:{foldAmount:.55,foldStages:2,foldEnv:.8,lpgColor:.85,lpgDecay:.3,level:.85}},{id:\\\"motion-pad\\\",label:\\\"MOTION PAD\\\",family:\\\"synth\\\",engineId:\\\"wavetable\\\",params:{position:.25,scanRate:.2,scanDepth:.35,envToPosition:.25,attack:.7,decay:.4,sustain:.85,release:1.2,filter:1,cutoff:3800,resonance:.15},gain:.75},{id:\\\"fm-bell-lead\\\",label:\\\"FM BELL LEAD\\\",family:\\\"synth\\\",engineId:\\\"fm\\\",params:{ops:2,algorithm:1,ratio1:1,level1:1,ratio2:3.53,level2:.45,feedback:.15,brightness:1,attack:.002,decay:2,sustain:0,release:.6,mAttack:.001,mDecay:1.1,mSustain:0,mRelease:.5}}],wr=new Map;for(let r of yr)wr.set(r.id,r);var Is=6;function is(r,t=.98){let e=i=>{let n=1,o=1;for(let l=1;l<r;l++)n*=i/l,o+=n;return Math.exp(-i)*o},s=0,a=10*r+50;for(let i=0;i<200;i++){let n=.5*(s+a);e(n)>1-t?s=n:a=n}return .5*(s+a)}var Sa=is(Is),Cs=1e15,Mr=.001,Mi=1e9,kr=1e-30,Ts=class{channels;order;values;x;goal;rate;c;h;settle;constructor(t,e,s=Is){if(!(Number.isInteger(t)&&t>0&&t<=65536))throw new RangeError(`channel count must be an integer from 1 to 65536, got ${t}`);if(!(Number.isInteger(s)&&s>=1&&s<=12))throw new RangeError(`order must be an integer from 1 to 12, got ${s}`);if(!(e>=.001&&e<=1e9))throw new RangeError(`step rate must be within [1e-3, 1e9] Hz, got ${e}`);this.channels=t,this.order=s,this.h=1/e,this.values=new Float64Array(t),this.x=new Float64Array(t*s),this.goal=new Float64Array(t),this.rate=new Float64Array(t),this.c=new Float64Array(t*s),this.settle=is(s);for(let a=0;a<t;a++)this.setRate(a,this.settle/.1)}setRate(t,e){if(!Number.isFinite(e))return;let s=z(e,Mr,Mi);s!==this.rate[t]&&(this.rate[t]=s,this.coefficients(t))}setTime(t,e){if(!Number.isFinite(e))return;let s=z(e,0,Number.MAX_VALUE);this.setRate(t,s>0?this.settle/s:Mi)}setTarget(t,e){Number.isFinite(e)&&(this.goal[t]=z(e,-Cs,Cs))}snap(t,e){if(!Number.isFinite(e))return;let s=z(e,-Cs,Cs);this.goal[t]=s,this.values[t]=s;let a=this.order;for(let i=0;i<a;i++)this.x[t*a+i]=s}place(t,e){if(e-e!==0)return;let s=e<-1e15?-1e15:e>1e15?1e15:e;this.x[t*this.order+this.order-1]=s,this.values[t]=s}placeFrom(t,e,s){this.place(t,e[s])}velocity(t){let e=this.order,s=t*e+e-1;return e>1?(this.x[s-1]-this.x[s])*this.rate[t]:(this.goal[t]-this.x[s])*this.rate[t]}stage(t,e){return this.x[t*this.order+e]}target(t){return this.goal[t]}setAll(t,e){for(let s=0;s<this.channels;s++){let a=t[s];a-a===0&&(this.goal[s]=a<-1e15?-1e15:a>1e15?1e15:a);let i=e[s];if(i-i!==0)continue;let n=i<.001?.001:i>1e9?1e9:i;n!==this.rate[s]&&(this.rate[s]=n,this.coefficients(s))}}step(){let t=this.order,e=this.x,s=this.c,a=this.goal;for(let i=0;i<this.channels;i++){let n=i*t,o=a[i],l=0;for(let h=t-1;h>=0;h--){let m=0;for(let p=0;p<=h;p++)m+=s[n+h-p]*(e[n+p]-o);e[n+h]=o+m,m>l?l=m:-m>l&&(l=-m)}if(l<kr)for(let h=0;h<t;h++)e[n+h]=o;this.values[i]=e[n+t-1]}}coefficients(t){let e=this.order,s=this.h*this.rate[t],a=Math.exp(-s);for(let i=0;i<e;i++)this.c[t*e+i]=a,a*=s/(i+1)}};var Ar=.2,Rr=1,Os=class{h;x=0;v=0;goal=0;w=2*Math.PI*5.5;zeta=.6;prep=0;a=1;b=0;c=0;d=1;constructor(t){if(!(t>=10&&t<=1e7))throw new RangeError(`PitchGlide step rate ${t} Hz is outside [10, 1e7]`);this.h=1/t,this.update()}setSpeed(t){Number.isFinite(t)&&(this.w=2*Math.PI*z(t,.1,200),this.update())}setDamping(t){Number.isFinite(t)&&(this.zeta=z(t,Ar,1),this.update())}setPreparation(t){Number.isFinite(t)&&(this.prep=z(t,0,Rr))}setTarget(t){if(!Number.isFinite(t))return;let e=t-this.goal;this.goal=t,e!==0&&this.prep>0&&(this.v-=this.w*this.prep*e)}snap(t){Number.isFinite(t)&&(this.x=this.goal=t,this.v=0)}step(){return this.advance(),this.x}advance(){let t=this.x-this.goal,e=this.v;this.x=this.goal+this.a*t+this.b*e,this.v=this.c*t+this.d*e}get value(){return this.x}get velocity(){return this.v}get target(){return this.goal}leadTime(){let t=0,e=10/this.w;for(let s=0;s<60;s++){let a=.5*(t+e);this.stepResponse(a)<.5?t=a:e=a}return .5*(t+e)}stepResponse(t){let e=this.w,s=this.zeta,a=-1,i=-e*this.prep,n=Math.exp(-s*e*t);if(s>=1-1e-9)return 1+n*(a+(i+e*a)*t);let o=e*Math.sqrt(1-s*s);return 1+n*(a*Math.cos(o*t)+(i+s*e*a)/o*Math.sin(o*t))}update(){let t=this.w,e=this.zeta,s=this.h,a=Math.exp(-e*t*s);if(e>=1-1e-9){this.a=(1+t*s)*a,this.b=s*a,this.c=-t*t*s*a,this.d=(1-t*s)*a;return}let i=t*Math.sqrt(1-e*e),n=Math.cos(i*s),o=Math.sin(i*s);this.a=a*(n+e*t/i*o),this.b=a*o/i,this.c=-a*t*t*o/i,this.d=a*(n-e*t/i*o)}};var he=980.665,Qt={m:1.5,r:2e3,k:1e5},qs={m:1.5,r:800,k:66667},ki={m:.6,r:1e3,k:1e6},Ai={m:1,r:3e3,k:1e6};var Sr=.00114*35e3,Lr=Math.sqrt(.00114*186e-6*2*Math.PI*700/2),dt=256,Ri=dt-1,ns=class{nn=0;D;F;B;Z;area;rv;wS;gam;ibq;wV;wY;U;wCm=0;wK=0;wIb=0;T=0;sG;sCm;sK;sQ;sY;sP;constructor(t){let e=t-1;this.D=new Int32Array(e),this.F=new Float64Array(e*dt),this.B=new Float64Array(e*dt),this.Z=new Float64Array(e),this.area=new Float64Array(e),this.rv=new Float64Array(t),this.wS=new Float64Array(t),this.gam=new Float64Array(t).fill(1),this.ibq=new Float64Array(t),this.wV=new Float64Array(t),this.wY=new Float64Array(t),this.U=new Float64Array(t),this.sG=new Float64Array(t),this.sCm=new Float64Array(t),this.sK=new Float64Array(t),this.sQ=new Float64Array(t),this.sY=new Float64Array(t),this.sP=new Float64Array(t)}addResonator(t,e,s,a){!(t>=1&&t<this.nn-1)||!(e>0)||(this.sG[t]=.5*e,this.sCm[t]=s*e,this.sK[t]=a*e,this.refresh(t))}refresh(t){let e=this.Z[t-1],s=1/(1+e*(this.wS[t]*this.wIb+this.sG[t]));this.gam[t]=s,this.ibq[t]=1/(e*s+this.Z[t]+this.rv[t])}configure(t,e,s,a,i,n,o,l,h){this.nn=a,this.T=1/h;let m=a-1;for(let N=0;N<m;N++){let u=s[N],k=s[N+1];this.D[N]=k-u>>1;let g=0;for(let S=u;S<k;S++)g+=1/t[S];this.area[N]=(k-u)/g,this.Z[N]=Sr/this.area[N]}let p=i.m*h+.5*i.r;this.wCm=i.m*h-.5*i.r,this.wK=i.k,this.wIb=1/p,this.rv.fill(0),this.wS.fill(0);let v=n*2*Math.sqrt(Math.PI)*l*o;for(let N=1;N<e;N++){let u=-1,k=1/0;for(let d=1;d<a-1;d++){let x=s[d]>N?s[d]-N:N-s[d];x<k&&(k=x,u=d)}if(u<0)continue;let g=t[N-1],S=t[N];this.rv[u]+=.25*Lr*v*(Math.pow(g,-1.5)+Math.pow(S,-1.5)),this.wS[u]+=n*2*Math.sqrt(Math.PI*.5*(g+S))*l}this.sG.fill(0),this.sCm.fill(0),this.sK.fill(0);for(let N=1;N<a-1;N++)this.refresh(N);this.reset()}reset(){this.F.fill(0),this.B.fill(0),this.wV.fill(0),this.wY.fill(0),this.U.fill(0),this.sQ.fill(0),this.sY.fill(0),this.sP.fill(0)}interior(t){let e=this.F,s=this.B,a=this.D,i=this.Z,n=this.wCm,o=this.wK,l=this.wIb,h=this.T,m=this.nn;for(let p=1;p<m-1;p++){let v=(p-1)*dt,N=p*dt,u=e[v+(t-a[p-1]&Ri)],k=s[N+(t-a[p]&Ri)],g=i[p-1],S=this.wV[p],d=this.wY[p],x=n*S-o*d,M=this.sG[p],f=M>0?M*this.sP[p]+this.sCm[p]*this.sQ[p]-this.sK[p]*this.sY[p]:0,b=-this.wS[p]*x*l-f,E=this.gam[p],O=(2*u*E-2*k+g*E*b)*this.ibq[p],H=(2*u-g*(O-b))*E,I=(x+H)*l;if(this.wV[p]=I,this.wY[p]=d+h*I,M>0){let X=M*H+f;this.sY[p]+=.5*h*(X+this.sQ[p]),this.sQ[p]=X,this.sP[p]=H}s[v+t]=H-u,e[N+t]=k+i[p]*O,this.U[p]=O}}};function Si(r,t,e){let s=0;e[s++]=0;for(let a=1;a<=t;a++){let i=2*Math.round(a*r/(t+1)/2);i>e[s-1]&&i<r&&(e[s++]=i)}return e[s++]=r,s}var La=.00114;function Li(r,t,e,s){let a=2*Math.PI*t,i=2*s*Math.tan(a/(2*s)),n=i*i*r,o=a*r/e;return[1/(r*s+.5*o+n/(4*s)),r*s-.5*o-n/(4*s),n]}var Fr=2.5,Er=1.8,Pr=10;function Fi(r,t){let e=Er*r,s=Fr*r*r*r/e,a=e+.61*Math.sqrt(s/2/Math.PI);return Li(La*a/(2*s),35e3/(4*a),Pr,t)}var Cr=30,Tr=.2,Ir=1,Or=8;function Ei(r,t){let e=Cr*r*r*r,s=La*Ir*r/(Tr*r*r),a=Math.sqrt(La*35e3*35e3/e/s)/(2*Math.PI);return Li(s,a,Or,t)}var Ue=class{openR=45;sealR=5;lo=.03;hi=.4;ease=.03;dt=0;setScale(t){let e=t*t;this.openR=45*e,this.sealR=5*e,this.lo=.03*e,this.hi=.4*e,this.ease=.03*e}setStep(t){this.dt=t}closeRate(t){if(t<this.ease)return this.sealR*Math.sqrt((t>0?t:0)/this.ease);let e=t<=this.lo?0:t>=this.hi?1:(t-this.lo)/(this.hi-this.lo);return this.sealR+(this.openR-this.sealR)*e*e*(3-2*e)}limit(t,e,s){let a=t-e;if(a>0){let n=(this.openR+40*t)*s;return a>n?e+n:t}let i=(this.closeRate(e)+40*e)*s;return a<-i?e-i:t}limitAll(t,e,s){let a=this.dt,i=this.openR,n=this.sealR,o=this.lo,l=this.hi-this.lo,h=this.ease;for(let m=0;m<s;m++){let p=e[m],v=t[m]-p;if(v>0){let k=(i+40*t[m])*a;v>k&&(t[m]=p+k);continue}let N;if(p<h)N=n*Math.sqrt((p>0?p:0)/h);else{let k=(p-o)/l;k=k<0?0:k>1?1:k,N=n+(i-n)*k*k*(3-2*k)}let u=(N+40*p)*a;v<-u&&(t[m]=p-u)}}};var Fa=1/(Math.sqrt(1/3)*Math.SQRT2*.875),Lt=Math.PI/2,Ti=Lt,Ii=-Ti*Lt*Lt/6,Oi=-Ii*Lt*Lt/20,qi=-Oi*Lt*Lt/42,Di=-qi*Lt*Lt/72,Bi=-Di*Lt*Lt/110,zi=-Bi*Lt*Lt/156,qr=-zi*Lt*Lt/210;function Dr(r){let t=r*r;return r*(Ti+t*(Ii+t*(Oi+t*(qi+t*(Di+t*(Bi+t*(zi+t*qr)))))))}var Ta=.08,Br=1/Ta,zr=1/8.43,_r=500,Ea=.3,Hr=1.4,Vr=100,Pi=48,Gr=.28,rs=.38,Ur=.8,jr=.55,Xr=.37,Yr=.2,Wr=.6,Pa=2,Ci=1,Kr=.25,$r=.25;function Ca(r,t,e,s,a,i,n){if(r>=t)return 0;let o=r*e,l=o<s,h=Dr(l?o*a:1-(o-s)*i),m=h*h;return l?m:m+(h-m)*n}var os=class{sampleRate;invSampleRate;maxHz;cycleRng;driftRng;chaosRng;cycleS=1;driftS=1;driftInterval;driftPole0;driftPole1;driftPole2;driftIn0;driftIn1;driftIn2;hz=110;targetOq=.6;targetSkew=.64;targetSharp=.2;targetFry=0;jitter=0;shimmer=0;diplophonia=0;chaos=0;driftCents=6;fry=0;oq=.6;invOq=1/.6;skew=.64;invSkew=1/.64;invFall=1/.36;sharp=.2;fryGain=0;oq2=0;invOq2=0;end2=0;closeFirst=Pa;closeSecond=Pa;phase=0;odd=!1;scale=1;amp=1;ampPrev=1;chaosX=Xr;inc=0;drift0=0;drift1=0;drift2=0;driftCountdown=0;pitchFactor=1;u=0;uOut=0;pending=0;y=0;aOut=0;constructor(t,e){this.sampleRate=t,this.invSampleRate=1/t,this.maxHz=t*Kr,this.cycleRng=e.fork(\\\"jitter\\\"),this.driftRng=e.fork(\\\"drift\\\"),this.chaosRng=e.fork(\\\"chaos\\\"),this.driftInterval=Math.max(1,Math.round(t/_r));let s=t/this.driftInterval;this.driftPole0=Math.exp(-2*Math.PI*Ea/s),this.driftPole1=Math.exp(-2*Math.PI*Ea*3/s),this.driftPole2=Math.exp(-2*Math.PI*Ea*9/s),this.driftIn0=Math.sqrt(1-this.driftPole0*this.driftPole0),this.driftIn1=Math.sqrt(1-this.driftPole1*this.driftPole1),this.driftIn2=Math.sqrt(1-this.driftPole2*this.driftPole2),this.setTension(.5),this.setRoughness(.1),this.reset()}reset(){this.phase=0,this.odd=!1,this.scale=1,this.amp=1,this.ampPrev=1,this.chaosX=Yr+Wr*this.chaosRng(),this.cycleS=this.cycleRng()*4294967296|0,this.driftS=this.driftRng()*4294967296|0,this.drift0=0,this.drift1=0,this.drift2=0,this.driftCountdown=0,this.pitchFactor=1,this.u=0,this.uOut=0,this.pending=0,this.aOut=0,this.latch(),this.inc=this.hz*this.invSampleRate}setFreq(t){t===t&&(this.hz=Math.min(Math.max(t,Ci),this.maxHz))}setFreqFrom(t,e){let s=t[e];s===s&&(this.hz=Math.min(Math.max(s,Ci),this.maxHz))}setTension(t){let e=z(t,0,1);this.targetOq=z(.78-.36*e,.25,.98),this.targetSkew=z(.56+.16*e,.3,.9),this.targetSharp=z(.4*e+1.375*Math.max(0,e-.6),0,1),this.phase===0&&this.latch()}setRoughness(t){let e=z(t,0,1);this.jitter=.0021+.0245*e,this.shimmer=.02+.22*e,this.diplophonia=e>.5?(e-.5)*1.4:0}setFry(t){this.targetFry=z(t,0,1),this.phase===0&&this.latch()}setDrift(t){this.driftCents=z(t,0,Vr)}setJitter(t){this.jitter=z(t,0,$r)}setShimmer(t){this.shimmer=z(t,0,1)}setDiplophonia(t){this.diplophonia=z(t,0,1)}setChaos(t){this.chaos=z(t,0,1)}get flow(){return this.u}get openArea(){return this.aOut}nextArea(){--this.driftCountdown<=0&&this.stepDrift();let t=this.hz*this.pitchFactor;this.fry>0&&(t=this.fryPull(t)),t>this.maxHz&&(t=this.maxHz);let e=t*this.invSampleRate/this.scale;this.inc=e;let s=this.phase+e;s>=1&&(s-=1,this.startCycle()),this.phase=s,this.aOut=this.area(s)}processArea(t,e,s){for(let a=e;a<s;a++)this.nextArea(),t[a]=this.aOut}nextPhase(){--this.driftCountdown<=0&&this.stepDrift();let t=this.hz*this.pitchFactor;this.fry>0&&(t=this.fryPull(t)),t>this.maxHz&&(t=this.maxHz);let e=t*this.invSampleRate/this.scale;this.inc=e;let s=this.phase+e;s>=1&&(s-=1,this.ampPrev=this.amp,this.startCycle()),this.phase=s}processPhase(t,e,s){for(let a=e;a<s;a++)this.nextPhase(),t[a]=this.phase}get f0(){return this.inc*this.sampleRate}next(){return this.step(),this.y}process(t,e,s){for(let a=e;a<s;a++)this.step(),t[a]=this.y}step(){--this.driftCountdown<=0&&this.stepDrift();let t=this.hz*this.pitchFactor;this.fry>0&&(t=this.fryPull(t)),t>this.maxHz&&(t=this.maxHz);let e=t*this.invSampleRate/this.scale;this.inc=e;let s=this.phase+e;s>=1&&(s-=1,this.startCycle()),this.phase=s;let a=this.area(s),i=0;if(a>0){let o=e*Br,l=this.u+o;i=2*l/(1+Math.sqrt(1+4*o*l/(a*a)))}let n=i+this.pending;this.pending=0,s+e>=this.closeFirst&&s<this.closeFirst&&(n+=this.cornerFirst(s,e)),s+e>=this.closeSecond&&s<this.closeSecond&&(n+=this.cornerSecond(s,e)),this.y=(n-this.uOut)*zr/e,this.uOut=n,this.u=i}fryPull(t){let e=this.fry;return t*(1-e)+(t<Pi?t:Pi)*e}area(t){let e=this.amp,s=e*Ca(t,this.oq,this.invOq,this.skew,this.invSkew,this.invFall,this.sharp);return this.fryGain>0&&t>rs&&(s+=e*this.fryGain*Ca(t-rs,this.oq2,this.invOq2,this.skew,this.invSkew,this.invFall,this.sharp)),s}cornerFirst(t,e){let s=this.oq,a=1;this.fryGain>0&&s>rs&&(a=1/(1+this.amp*this.fryGain*Ca(s-rs,this.oq2,this.invOq2,this.skew,this.invSkew,this.invFall,this.sharp)*Ta/(2*e)));let i=this.amp*this.sharp*Lt*this.invFall*this.invOq;return this.corner(t,e,s,i,a)}cornerSecond(t,e){let s=this.amp*this.fryGain*this.sharp*Lt*this.invFall*this.invOq2;return this.corner(t,e,this.end2,s,1)}corner(t,e,s,a,i){let n=Ta*a,o=.5*a*(n+Math.sqrt(n*n+4)),l=i*o*e,h=(s-t)/e,m=1-h;return this.pending+=l*h*h*h/6,l*m*m*m/6}startCycle(){this.latch(),this.odd=!this.odd;let t=this.odd?1:-1,e=0,s=0,a=this.chaos;if(a>0){let N=(2.9+1.1*a)*this.chaosX*(1-this.chaosX);N>0&&N<1||(N=.37),this.chaosX=N;let u=N-.5;e=.45*a*u,s=1.1*a*u}let i=this.cycleS,n=0,o=0;for(let v=0;v<8;v++){i=i+1831565813|0;let N=Math.imul(i^i>>>15,i|1);N^=N+Math.imul(N^N>>>7,N|61);let u=((N^N>>>14)>>>0)/4294967296;v<4?n+=u:o+=u}this.cycleS=i;let l=(n-2)*Math.SQRT2*.875*Fa,h=(o-2)*Math.SQRT2*.875*Fa,m=1+this.jitter*l+this.diplophonia*.08*t+e;this.scale=m<.55?.55:m>1.8?1.8:m;let p=1+this.shimmer*h-(this.odd?this.diplophonia*.35:0)+s;this.amp=p>.12?p:.12}stepDrift(){this.driftCountdown=this.driftInterval;let t=this.driftS,e=0,s=0,a=0;for(let o=0;o<12;o++){t=t+1831565813|0;let l=Math.imul(t^t>>>15,t|1);l^=l+Math.imul(l^l>>>7,l|61);let h=((l^l>>>14)>>>0)/4294967296;o<4?e+=h:o<8?s+=h:a+=h}this.driftS=t;let i=Math.SQRT2*.875*Fa;this.drift0=this.driftPole0*this.drift0+this.driftIn0*(e-2)*i,this.drift1=this.driftPole1*this.drift1+this.driftIn1*(s-2)*i,this.drift2=this.driftPole2*this.drift2+this.driftIn2*(a-2)*i;let n=(this.drift0+this.drift1/2+this.drift2/3)/Hr;this.pitchFactor=Math.pow(2,this.driftCents*n/1200)}latch(){let t=this.targetFry;this.fry=t;let e=t>0?this.targetOq*(1-t)+Gr*t:this.targetOq;this.oq=e,this.invOq=1/e,this.skew=this.targetSkew,this.invSkew=1/this.targetSkew,this.invFall=1/(1-this.targetSkew),this.sharp=this.targetSharp;let s=this.sharp>0;if(this.closeFirst=s?e:2,t>.3){let a=z((t-.3)/.5,0,1);this.fryGain=jr*a*a*(3-2*a),this.oq2=e*Ur,this.invOq2=1/this.oq2,this.end2=rs+this.oq2,this.closeSecond=s?this.end2:2}else this.fryGain=0,this.end2=0,this.closeSecond=Pa}};var ke=Math.PI,Bs=1/ke,Zr=2/ke,_i=2*ke,Vi=.1/Math.sqrt(8e3),hs=256,zs=new Float64Array(hs+2),_s=new Float64Array(hs+2);(function(){for(let t=0;t<=hs+1;t++){let e=Math.min(1,t/hs),s=ke*(1-e*e),a=1e-12,i=1;for(let o=0;o<80;o++){let l=.5*(a+i);Math.sin(ke*l)/l>s?a=l:i=l}let n=.5*(a+i);zs[t]=n,_s[t]=Math.cos(ke*n)}})();var ee=new Float64Array(3);function Hi(){let r=ee[0],t=ee[1];if(t>=0&&r>=0||t<0&&r>=-ke*t){ee[2]=.5*r+Zr*t;return}if(!(t>0&&-r<ke*t||t<0&&r>0)){ee[2]=0;return}let s=1- -r/t*Bs;s=s>0?Math.sqrt(s):0;let a=s*hs,i=a|0,n=a-i,o=zs[i]+(zs[i+1]-zs[i])*n,l=_s[i]+(_s[i+1]-_s[i])*n,h=1-o,m=r*(h-.5*h*h)+t*Bs*l;ee[2]=t>0?.5*r+t*Bs-m:m+t*Bs}var Hs=class{xRest1=.03;xRest2=.06;chink=.01;xMax=0;length=1.6;lag=70/360;skew=0;doublePulse=.05;area1=0;area2=0;r1=.03;r2=.06;ch=.01;xm=0;first=!0;reset(){this.first=!0,this.area1=this.area2=0}process(t,e,s,a){this.first&&(this.r1=this.xRest1,this.r2=this.xRest2,this.ch=this.chink,this.xm=this.xMax,this.first=!1);let i=a-s;if(i<=0)return;let n=1/i,o=this.r1,l=this.r2,h=this.ch,m=this.xm,p=this.xRest1-o,v=this.xRest2-l,N=this.chink-h,u=this.xMax-m,k=2*this.length,g=this.skew;g=g<-.9?-.9:g>.9?.9:g;let S=.25*(1+g),d=.25/S,x=.25/(.5-S),M=this.lag;M=M<0?0:M>.5?.5:M;let f=this.doublePulse;f=f<0?0:f>1?1:f;let b=1-.5*f,E=0,O=0;for(let H=s;H<a;H++){t.nextPhase();let I=(H-s+1)*n,X=m+u*I,V=t.phase,y=V<S?V*d:V<.5?.25+(V-S)*x:V,L=Math.sin(_i*y);t.odd&&(L=b*(L+1)-1);let q=V-M,R=t.odd,_=t.amp;q<0&&(q+=1,R=!R,_=t.ampPrev),y=q<S?q*d:q<.5?.25+(q-S)*x:q;let G=Math.sin(_i*y);R&&(G=b*(G+1)-1);let D=h+N*I;ee[0]=o+p*I,ee[1]=X*t.amp*L,Hi(),E=k*ee[2]+D,ee[0]=l+v*I,ee[1]=X*_*G,Hi(),O=k*ee[2]+D,e[H]=E<O?E:O}this.area1=E,this.area2=O,this.r1=this.xRest1,this.r2=this.xRest2,this.ch=this.chink,this.xm=this.xMax}};var Qr=1200/Math.LN2,Vs=1.6,Jr=3,Gs=class{target=110;measured=110;correction=1;tau=.04;pending=0;deep=1;onset=1;weight=1;restart=0;lastLog=0;farRun=0;farSide=0;reset(){this.correction=1,this.measured=this.target,this.pending=0,this.lastLog=0,this.farRun=0,this.farSide=0}cycle(){if(this.pending===0)return;this.pending=0;let t=this.measured,e=this.target;if(!(t>0)||!(e>0))return;let s=e/t,a=0;if(s>Vs||s<1/Vs){let v=s>1?1:-1;if(this.farRun=this.deep===0?0:v===this.farSide?this.farRun+1:1,this.farSide=v,this.farRun<Jr)return;s=Math.min(Math.max(s,1/Vs),Vs),a=1}else this.farRun=0;this.restart!==0&&(this.restart=0,this.lastLog=0);let i=Math.log(s),n=this.lastLog;this.lastLog=i;let o=i*n>0?1:0,l=i<0?-i:i,h=n<0?-n:n,m=this.deep*o*(this.onset|a)*(l<h?l:h)*Qr,p=1-Math.exp(-this.weight*(1+m/40)/(t*this.tau));this.correction=Math.min(Math.max(this.correction*Math.pow(s,p),.5),2)}};var Gi=.125,Ui=.025,ji=8e4,Xi=8e3,Yi=25e3,to=.1,eo=.6,so=.25,ao=.05,Wi=3,Ki=1,$i=158,Ia=.25,io=.2,no=.03,qa=1.6,ro=.05,Oa=12,Us=class{ps=0;pe=0;rest1=.01;rest2=.01;chink=.01;length=1.4;rest1To=.01;rest2To=.01;chinkTo=.01;lengthTo=1.4;rampLeft=0;perturb=1;free=1;servo=new Gs;area=0;area1=0;area2=0;x1=0;x2=0;v1=0;v2=0;cycles=0;dt=0;rate=0;m1=Gi;m2=Ui;k1=ji;k2=Xi;kc=Yi;b1=0;b2=0;bh1=0;bh2=0;q=1;stale=1;n=0;lastV1=0;lastT=-1;lastVoiced=-1;onsetEnd=-1;sinceTurn=1e9;aLo=1e9;aHi=0;constructor(t){this.rate=t,this.dt=1/t}reset(){this.x1=this.x2=this.v1=this.v2=0,this.ps=this.pe=0,this.area=this.area1=this.area2=0,this.n=0,this.lastV1=0,this.lastT=-1,this.lastVoiced=-1,this.onsetEnd=-1,this.sinceTurn=1e9,this.aLo=1e9,this.aHi=0,this.cycles=0,this.rampLeft=0,this.servo.reset(),this.tune()}tune(){this.stale=1}get tension(){if(!this.stale)return this.q;let t=this.servo.target/$i*this.servo.correction*this.perturb;return t<Ia?Ia:t>Oa?Oa:t===t?t:1}step(){if(this.rampLeft>0){let D=1/this.rampLeft;this.rest1+=(this.rest1To-this.rest1)*D,this.rest2+=(this.rest2To-this.rest2)*D,this.chink+=(this.chinkTo-this.chink)*D,this.length+=(this.lengthTo-this.length)*D,this.rampLeft--}if(this.stale){this.stale=0;let D=this.servo.target/$i*this.servo.correction*this.perturb,Z=Math.min(Math.max(D===D?D:1,Ia),Oa);this.q=Z;let it=Math.sqrt(Z),rt=1/(Z*it);this.m1=Gi*rt,this.m2=Ui*rt,this.k1=ji*it,this.k2=Xi*it,this.kc=Yi*it,this.b1=2*to*Math.sqrt(this.m1*this.k1),this.b2=2*eo*Math.sqrt(this.m2*this.k2),this.bh1=2*Ki*Math.sqrt(this.m1*this.k1),this.bh2=2*Ki*Math.sqrt(this.m2*this.k2)}let t=this.length,e=2*t,s=this.rest1>0?this.rest1:0,a=this.rest2>0?this.rest2:0,i=this.x1,n=this.x2,o=0,l=0,h=0;i>=0?o=.5*s+i:s+i>0?(o=(s+i)*(s+i)/(2*s),l=i*i/(2*s),h=-i/s):(l=-(.5*s+i),h=1);let m=0,p=0,v=0;n>=0?m=.5*a+n:a+n>0?(m=(a+n)*(a+n)/(2*a),p=n*n/(2*a),v=-n/a):(p=-(.5*a+n),v=1);let N=e*o,u=e*m,k=this.ps,g=this.pe,S=k,d=g;if(N>0&&u>0)if(N>=u){let D=u/N;S=k-(k-g)*D*D}else S=g;else N>0&&(d=k);let x=this.free<0?0:this.free>1?1:this.free,M=this.k1,f=this.k2,b=this.kc,E=this.m1,O=this.m2,H=this.dt,I=x*S*t*so-M*i-b*(i-n)+Wi*M*l,X=x*d*t*ao-f*n-b*(n-i)+Wi*f*p,V=this.b1+this.bh1*h,y=this.b2+this.bh2*v,L=(this.v1+H*I/E)/(1+H*V/E),q=(this.v2+H*X/O)/(1+H*y/O);this.v1=L,this.v2=q,this.x1=i+H*L,this.x2=n+H*q;let R=this.chink>0?this.chink:0;this.area1=N+R,this.area2=u+R,this.area=(N<u?N:u)+R,this.n++;let _=this.area;this.aLo=Math.min(this.aLo,_),this.aHi=Math.max(this.aHi,_);let G=this.lastV1;if(this.lastV1=L,G>0&&L<=0){let D=this.n-1+G/(G-L),Z=D-this.lastT,it=this.aHi-this.aLo,rt=.5*(this.aHi+this.aLo);if(this.lastT>=0&&Z>1&&it>no*rt){let et=it>io*rt?1:0;et&&((this.lastVoiced<0||D-this.lastVoiced>qa*this.rate/this.servo.target)&&(this.onsetEnd=D+ro*this.rate,this.servo.restart=1),this.lastVoiced=D),this.servo.measured=this.rate/Z,this.servo.deep=et,this.servo.onset=D<this.onsetEnd?1:0,this.servo.pending=1,this.cycles++}this.lastT=D,this.aLo=1e9,this.aHi=0}this.sinceTurn=this.lastVoiced>=0?this.n-this.lastVoiced:1e9,this.servo.cycle()}};var ls=2e3,oo=4*he*10,Da=.7,ho=.006,lo=.006,js=class{pressure=0;halfWidth=0;drive=1;onset=ls;offset=Da*ls;on=0;level=0;cOn=0;cOff=0;constructor(t){this.cOn=1-Math.exp(-t/ho),this.cOff=1-Math.exp(-t/lo)}reset(){this.on=0,this.level=0,this.onset=ls,this.offset=Da*ls}step(){let t=this.halfWidth>0?this.halfWidth:0,e=ls+oo*t;this.onset=e,this.offset=Da*e;let s=this.pressure;this.on===0?s>e&&(this.on=1):s<this.offset&&(this.on=0);let a=this.drive;a=a<0?0:a>1?1:a;let i=this.on*a,n=i>this.level?this.cOn:this.cOff;this.level+=n*(i-this.level)}};var Ys=0,je=1,ps=2,Ft=.00114,le=.00114*35e3,cs=1/le,co=Math.sqrt(le),Zi=Math.sqrt(Ft*186e-6*2*Math.PI*700/2),Ae=2e-4,No=55e-8,Qi=.002,Ji=.003,nt=5,Ns=3,ms=4,be=16,Ce=512,tn=7,mo=18,po=25,fo=3,uo=.3,vo=6,bo=3e-9,go=10,xo=3,yo=3.5,wo=2/Math.sqrt(Math.PI)*(.00114/186e-6),Mo=1e3,ko=1/1e3,Ao=500,Ro=25,Ba=.15,en=3500,za=1,So=.2,sn=2,Lo=3,Fo=.5,_a=.25,an=.15,Eo=1.5,Po=.5,Ha=.004,Co=.5,nn=.3,To=1.4,Io=.37,Oo=1,qo=.3,rn=.8,Do=25,Bo=2,zo=70,_o=18e3,Ho=60,on=4,hn=6,ln=1.25,cn=.25;function Ws(r){let t=35e3/(2*r);return ln>3.2*t?ln:3.2*t}var Vo=.1,Go=.2,Uo=.03,jo=.05,Xo=os.prototype.processArea,Xs=class{rate=0;block=0;dx=0;nMax=0;nG=0;jv=2;k=1;T=0;gridIn;gridMin;vflow;ductLen=2;ductArea=3;velum=0;pLung=0;mic=0;cheeks=0;branches=!0;piriform=0;pJa=-1;wCmA;wKsA;wIbsA;wallCheeks=-1;wallSplit=-1;pJ=-1;pG=0;pCm=0;pK=0;pDi=0;pQ=0;pY=0;pP=0;micX=0;micY=0;micC=0;agStatic=.02;closure=0;model=ps;chink=.01;foldLength=1.6;upperRest=.03;lag=70/360;skew=0;doublePulse=.05;xRel=1;restOffset=0;f0=110;teethX=30;labial=0;splitI=20;gain=1;voicing=0;dpGlottis=0;pTrans=0;pSupra=0;dpAcc=0;paAcc=0;dpSmooth=0;pSubSmooth=0;pSub=0;uLips=0;uNose=0;glottis;geometric=new Hs;folds;threshold;noiseLevel=new Float64Array(nt);noiseVelocity=new Float64Array(nt);noiseArea=new Float64Array(nt);noiseGain=new Float64Array(nt);noisePlace=new Float64Array(nt).fill(-1);R;L;sZ;isZ;Zs;area;dArea;aMin;dAMin;iaMin;viscC;perimF;wallK;moving;nMoving=0;tgt;tgtMin;slew=new Ue;kf;kb;rv;U;pn;wS;gw;wV;wY;jmList;nJm=0;gamA;ibA;bqA;dv1;dv2;dvRaw;dvCoef=0;wCm=0;wKs=0;wIbs=0;tr;na;secScratch;nodeScratch=new Int32Array(16);fBuf=new Float64Array(dt);bBuf=new Float64Array(dt);pos=0;ductTau=2;dTau=0;ductSZ=1;dDuctSZ=0;ductA=1;areaBuf;areaArgs;agSt=.02;agSt0=.02;aVib=0;aVib0=0;uG=0;momG=0;lG=0;ag=1e-4;agAcc=0;agMean=.05;agLast=0;pL=0;pL0=0;visc0=0;ldG=0;vel=0;vel0=0;velNow=0;uV=0;momV=0;lV=0;velLen=1;ulLips=0;lrLips=0;ulNose=0;pLipsOld=0;pNoseOld=0;radPrev=0;wallRadAcc=0;hpX=0;hpY=0;hpC=0;lb0=0;lb1=0;la1=0;la2=0;lx1=0;lx2=0;ly1=0;ly2=0;w=0;f0Buf=new Float64Array(1);srcExit=new Int32Array(nt).fill(-1);srcUJ=new Int32Array(nt);srcSec=new Int32Array(nt);srcCmd0=new Float64Array(nt);srcCmd1=new Float64Array(nt);nTap=new Int32Array(nt);tapJ=new Int32Array(nt*be);tapW0=new Float64Array(nt*be);tapW1=new Float64Array(nt*be);velW0=0;velW1=0;pnV=0;vF=new Float64Array(nt);vS=new Float64Array(nt);aF=new Float64Array(nt);nL=new Float64Array(nt);nL2=new Float64Array(nt);cLp2=new Float64Array(nt).fill(1);cLp=new Float64Array(nt);vAcc=new Float64Array(nt);lvAcc=new Float64Array(nt);tau0=new Float64Array(nt);tau1=new Float64Array(nt);modOn=new Float64Array(nt);ring=new Float64Array(nt*Ce);ringPos=0;tx=0;tw=0;tShare=0;vMax=0;runLo=new Int32Array(3);runHi=new Int32Array(3);runMin=new Int32Array(3);conLo=new Int32Array(3);conHi=new Int32Array(3);runSlot=new Int32Array(3);cVc=0;cVs=0;noiseScale=0;rng;seed=1;blocks=0;constructor(t,e,s){this.rate=t,this.T=1/t,this.block=Math.max(8,Math.round(32*t/48e3)),this.dx=35e3/(2*t),this.nMax=e,this.rng=s.fork(\\\"noise\\\");let a=e,i=a+1;this.gridIn=new Float64Array(a).fill(3),this.gridMin=new Float64Array(a).fill(3),this.vflow=new Float64Array(i),this.R=new Float64Array(a),this.L=new Float64Array(a),this.sZ=new Float64Array(a),this.isZ=new Float64Array(a),this.Zs=new Float64Array(a),this.area=new Float64Array(a),this.dArea=new Float64Array(a),this.aMin=new Float64Array(a),this.dAMin=new Float64Array(a),this.iaMin=new Float64Array(a),this.viscC=new Float64Array(a),this.perimF=new Float64Array(a),this.wallK=new Float64Array(a),this.moving=new Int32Array(a),this.tgt=new Float64Array(a),this.tgtMin=new Float64Array(a),this.kf=new Float64Array(i),this.kb=new Float64Array(i),this.rv=new Float64Array(i),this.U=new Float64Array(i),this.pn=new Float64Array(i),this.wS=new Float64Array(i),this.gw=new Float64Array(i),this.wCmA=new Float64Array(i),this.wKsA=new Float64Array(i),this.wIbsA=new Float64Array(i),this.wV=new Float64Array(i),this.wY=new Float64Array(i),this.jmList=new Int32Array(i),this.gamA=new Float64Array(i).fill(1),this.ibA=new Float64Array(i),this.bqA=new Float64Array(i),this.dv1=new Float64Array(i),this.dv2=new Float64Array(i),this.dvRaw=new Float64Array(i),this.dvCoef=1-Math.exp(-2*Math.PI*Ho/t),this.wCm=Qt.m*t-.5*Qt.r,this.wKs=Qt.k,this.wIbs=1/(Qt.m*t+.5*Qt.r),this.tr=new ns(on+2),this.na=new ns(hn+5),this.secScratch=new Float64Array(Math.ceil(14*1.2/this.dx)+4),this.glottis=new os(t,s.fork(\\\"glottis\\\")),this.folds=new Us(t),this.threshold=new js(this.block/t),this.areaBuf=new Float64Array(this.block),this.areaArgs=[this.areaBuf,0,this.block],this.hpC=Math.exp(-2*Math.PI*Do/t),this.micC=Math.exp(-2*Math.PI*zo/t);let n=Math.min(_o,.45*t),o=Math.tan(Math.PI*n/t),l=Math.SQRT1_2,h=1/(1+o/l+o*o);this.lb0=o*o*h,this.lb1=2*this.lb0,this.la1=2*(o*o-1)*h,this.la2=(1-o/l+o*o)*h,this.noiseScale=bo*Math.sqrt(t/48e3),this.cVc=1-Math.exp(-2*Math.PI*Ao/t),this.cVs=1-Math.exp(-2*Math.PI*Ro/t),this.configure(1,Math.min(a,30),12)}configure(t,e,s){this.k=t;let a=t*t,i=this.dx;this.nG=e<this.nMax?e:this.nMax,this.jv=s,this.slew.setScale(t),this.slew.setStep(this.block/this.rate),this.visc0=12*186e-6*nn*t*(To*t)**2,this.ldG=Ft*nn*t,this.velLen=Oo*t;let n=this.secScratch,o=this.nodeScratch,l=Math.max(6,Math.round(12*t/i));l%2&&l++,l>n.length&&(l=n.length-n.length%2);for(let N=0;N<l;N++)n[N]=2.5*a;let h=Si(l,on,o);this.tr.configure(n,l,o,h,ki,1,1,i,this.rate);let m=Math.max(8,Math.round(11.4*t/i));m%2&&m++,m>n.length&&(m=n.length-n.length%2);for(let N=0;N<m;N++){let u=(N+.5)/m,k=u<.18?2.6:u<.75?2-.6*(u-.18):u<.9?1.4:1;n[N]=k*a}h=0,o[h++]=0,o[h++]=2*Math.round(.18*m/2);let p=hn-3;for(let N=1;N<=p;N++)o[h++]=2*Math.round((.18+(.75-.18)*N/(p+1))*m/2);o[h++]=2*Math.round(.75*m/2),o[h++]=2*Math.round(.9*m/2),o[h++]=m;let v=1;for(let N=1;N<h;N++)o[N]>o[v-1]&&(o[v++]=o[N]);if(this.na.configure(n,m,o,v,Ai,3.2,2.5,i,this.rate),this.branches){let N=Ei(t,this.rate);this.na.addResonator(v>>1,N[0],N[1],N[2]);let u=Fi(t,this.rate);this.pJ=2<this.nG-1&&s!==2?2:-1,this.pDi=u[0],this.pG=.5*u[0],this.pCm=u[1],this.pK=u[2]}else this.pJ=-1;this.wallCheeks=-1;for(let N=0;N<this.nMax;N++)this.perimF[N]=N<s?1.25:1.5,this.wallK[N]=2*this.perimF[N]*2*Math.sqrt(Math.PI)*i,this.viscC[N]=.25*Zi*this.perimF[N]*2*Math.sqrt(Math.PI)*i/Math.pow(le,1.5);this.reset(),this.updateWalls()}updateWalls(){let t=this.cheeks<0?0:this.cheeks>1?1:this.cheeks,e=Math.ceil(this.splitI);if(t===this.wallCheeks&&e===this.wallSplit)return;this.wallCheeks=t,this.wallSplit=e;let s=this.rate,a=this.wCmA.length;for(let i=0;i<a;i++){let n=i>=e?t:0,o=Qt.m+(qs.m-Qt.m)*n,l=Qt.r+(qs.r-Qt.r)*n,h=Qt.k+(qs.k-Qt.k)*n;this.wCmA[i]=o*s-.5*l,this.wKsA[i]=h,this.wIbsA[i]=1/(o*s+.5*l)}}reset(){let t=this.k*this.k;this.tr.reset(),this.na.reset(),this.glottis.reset(),this.geometric.reset(),this.folds.reset(),this.threshold.reset(),this.pTrans=this.dpAcc=0,this.pSupra=this.paAcc=0,this.R.fill(0),this.L.fill(0),this.U.fill(0),this.pn.fill(0),this.wV.fill(0),this.wY.fill(0),this.dv1.fill(0),this.dv2.fill(0),this.dvRaw.fill(0),this.area.fill(3*t),this.aMin.fill(3*t),this.fBuf.fill(0),this.bBuf.fill(0),this.pos=0,this.uG=this.momG=this.lG=0,this.uV=this.momV=this.lV=0,this.ulLips=this.lrLips=this.ulNose=0,this.pLipsOld=this.pNoseOld=0,this.radPrev=this.wallRadAcc=0,this.hpX=this.hpY=0,this.lx1=this.lx2=this.ly1=this.ly2=0,this.voicing=0,this.dpGlottis=this.dpSmooth=0,this.pSub=this.pSubSmooth=0,this.uLips=this.uNose=0,this.micX=this.micY=0,this.pQ=this.pY=this.pP=0,this.aVib=this.aVib0=0,this.agAcc=0,this.agMean=.05,this.agLast=0,this.ag=1e-4,this.srcExit.fill(-1),this.srcUJ.fill(0),this.srcSec.fill(0),this.srcCmd0.fill(0),this.srcCmd1.fill(0),this.nTap.fill(0),this.vF.fill(0),this.vS.fill(0),this.aF.fill(0),this.nL.fill(0),this.nL2.fill(0),this.vAcc.fill(0),this.lvAcc.fill(0),this.noiseLevel.fill(0),this.noiseVelocity.fill(0),this.noiseArea.fill(0),this.noiseGain.fill(0),this.noisePlace.fill(-1),this.tau0.fill(0),this.tau1.fill(0),this.ring.fill(0),this.ringPos=0,this.velW0=this.velW1=this.pnV=0,this.seed=this.rng()*4294967296|0||1,this.blocks=0}beginBlock(){this.updateWalls(),this.pJa=this.piriform>0?this.pJ:-1;let t=this.blocks===0;this.blocks++;let e=this.block,s=this.k,a=s*s,i=this.nG,n=this.area,o=this.dArea,l=this.tgt,h=this.tgtMin,m=e/this.rate;for(let y=0;y<i;y++){let L=this.gridIn[y];l[y]=L>1e-4?L:1e-4;let q=this.gridMin[y];h[y]=q>1e-4?q:1e-4}t||(this.slew.limitAll(l,n,i),this.slew.limitAll(h,this.aMin,i));for(let y=0;y<i;y++){l[y]<1e-4&&(l[y]=1e-4);let L=h[y];L>l[y]&&(L=l[y]),h[y]=L<1e-4?1e-4:L}if(this.splitI>=0){let y=Math.floor(this.splitI-1);y=y<2?2:y>i-2?i-2:y;let L=this.vel<=Ae&&this.velum<=Ae&&this.uV<1&&this.uV>-1;(t||L)&&(this.jv=y)}let p=0;for(let y=0;y<i;y++){let L=l[y];t&&(n[y]=L);let q=L-n[y],R=q<0?-q:q,_=h[y];t&&(this.aMin[y]=_);let G=_-this.aMin[y],D=G<0?-G:G;if(R>Ji*.5*(L+n[y])||D>Ji*.5*(_+this.aMin[y])||G!==0&&_<.5*a)o[y]=q/e,this.dAMin[y]=G/e,this.moving[p++]=y;else{this.dAMin[y]=0,this.aMin[y]=_,this.iaMin[y]=1/_,o[y]=0,n[y]=L;let Z=Math.sqrt(le/L);this.sZ[y]=Z,this.isZ[y]=1/Z,this.Zs[y]=Z*Z}}this.nMoving=p;let v=0,N=this.dx;for(let y=1;y<i;y++){let L=y-1,q=y,R=o[L]!==0||o[q]!==0||this.dAMin[L]!==0||this.dAMin[q]!==0;R&&(this.jmList[v++]=y);let _=l[L],G=l[q],D=1/h[L]-1/G,Z=1/h[q]-1/_,it=1/h[q]-1/_,rt=1/h[L]-1/G;this.kf[y]=.5*Ft*((D>0?D*D:0)+(it>0?.1*it*it:0)),this.kb[y]=.5*Ft*((Z>0?Z*Z:0)+(rt>0?.1*rt*rt:0));let et=le/_,A=le/G,K=this.viscC[L]*et*Math.sqrt(et)+this.viscC[q]*A*Math.sqrt(A);this.rv[y]=K;let Y=.5*(_+G),pt=(y&1)===0&&Y>Ae?this.wallK[L]*Math.sqrt(Y-Ae):0;this.wS[y]=pt;let At=pt*this.wIbsA[y]+(y===this.pJa?this.pG:0);if(this.gw[y]=At,!R){let st=1/(1+et*At);this.gamA[y]=st;let _t=et*st+A+K;this.bqA[y]=_t,this.ibA[y]=1/_t}}this.nJm=v;let u=this.dvRaw;if(u.fill(0),!t)for(let y=0;y<=i;y++){let L=(y&1)===0?y:y+1<=i?y+1:y-1;u[L]+=this.vflow[y]}for(let y=0;y<=i;y++){let L=y>0?l[y-1]:this.ductArea,q=y<i?l[y]:1,R=((L>q?L:q)-.02*a)/(.1*a);R=R<0?0:R>1?1:R*R*(3-2*R),u[y]*=R}let k=this.ductLen*this.rate/35e3;t&&(this.ductTau=k),this.dTau=(k-this.ductTau)/e;let g=this.ductArea>1e-6?this.ductArea:1e-6,S=Math.sqrt(le/g);t&&(this.ductSZ=S),this.dDuctSZ=(S-this.ductSZ)/e,this.ductA=g,this.vel0=t?this.velum:this.vel,this.vel=this.velum,this.pL0=t?this.pLung:this.pL,this.pL=this.pLung;let d=this.closure<0?0:this.closure>1?1:this.closure,x=this.agStatic*(1-.92*d);this.agSt0=t?x:this.agSt,this.agSt=x;let M=1-Math.exp(-2*Math.PI*30*m);this.dpSmooth+=M*(this.dpGlottis-this.dpSmooth),this.pSubSmooth+=M*(this.pSub-this.pSubSmooth);let f=2.5*he,b=(this.dpSmooth-f*.8)/(f*.8);b=b<0?0:b>1?1:b*b*(3-2*b);let E=(this.agStatic-.0125*a-.08)/.14;E=E<0?0:E>1?1:E*E*(3-2*E);let O=1-E,H=this.model;H===ps&&(this.voicing+=(1-Math.exp(-2*Math.PI*25*m))*(b*O*(1-d)-this.voicing));let I=(this.pLung/he-3)/10;I=I<0?0:I>1?1:I,this.aVib0=this.aVib,this.aVib=.17*a*(.45+.75*I)*this.voicing,t&&(this.aVib0=this.aVib),this.placeSources(),this.agAcc=0,this.f0Buf[0]=this.f0,this.glottis.setFreqFrom(this.f0Buf,0),this.areaArgs[2]=e;let X=t?0:this.dpAcc/e,V=t?0:this.paAcc/e;this.dpAcc=0,this.paAcc=0,this.pTrans+=M*(X-this.pTrans),this.pSupra+=M*(V-this.pSupra),H===Ys?this.geometricBlock(d):H===je?this.foldBlock(d):this.pulseBlock()}pulseBlock(){Reflect.apply(Xo,this.glottis,this.areaArgs);let t=this.areaBuf,e=this.block,s=1/e,a=t[e-1];for(let i=e-1;i>=0;i--){let n=(i+1)*s,o=this.agSt0+(this.agSt-this.agSt0)*n,l=this.aVib0+(this.aVib-this.aVib0)*n,h=o+l*.5*(t[i]+(i>0?t[i-1]:this.agLast));h<1e-7&&(h=1e-7),t[i]=h}this.agLast=a}geometricBlock(t){let e=this.geometric,s=this.foldLength>.1?this.foldLength:.1,a=1-.92*t,i=(this.chink>0?this.chink:0)*a,n=this.agSt-i,o=(n>0?n:0)/s+this.restOffset,l=o+this.upperRest*a;e.length=s,e.chink=i,e.xRest1=o,e.xRest2=l,e.lag=this.lag,e.skew=this.skew,e.doublePulse=this.doublePulse;let h=this.threshold;h.pressure=this.pTrans,h.halfWidth=.25*(o+l),h.drive=1-t,h.step(),this.voicing=h.level;let m=this.pTrans>0?this.pTrans:0;e.xMax=Vi*this.xRel*Math.sqrt(m)*h.level,e.process(this.glottis,this.areaBuf,0,this.block)}foldBlock(t){let e=this.folds,s=this.foldLength>.1?this.foldLength:.1,a=1-.92*t,i=(this.chink>0?this.chink:0)*a,n=this.agSt-i,o=(n>0?n:0)/s+this.restOffset;o=o>0?o:0,this.blocks===1&&(e.rest1=o,e.rest2=o,e.chink=i,e.length=s),e.rest1To=o,e.rest2To=o,e.chinkTo=i,e.lengthTo=s,e.rampLeft=this.block,e.free=1-t,this.glottis.processPhase(this.areaBuf,0,this.block),e.servo.target=this.f0*this.glottis.pitchFactor;let l=this.pSupra/Math.max(this.pSubSmooth,he),h=Math.min(Math.max((l-Vo)/Go,0),1),m=h*h*(3-2*h),p=Math.min(Math.max((this.agSt/(this.k*this.k)-Uo)/jo,0),1),v=p*p*(3-2*p);e.servo.weight=(1-m)*(1-v),e.perturb=1/this.glottis.scale,e.tune();let N=this.f0>20?this.rate/this.f0:this.rate/20,u=e.sinceTurn<qa*N?1:0;this.voicing+=(1-Math.exp(-2*Math.PI*25*this.block/this.rate))*(u-this.voicing)}placeSources(){let t=this.pLung>0?this.pLung:-this.pLung;this.vMax=1.2*Math.sqrt(2*t/Ft)+100;let e=this.k,s=e*e,a=this.nG,i=this.tgtMin,n=this.dx,o=this.rate,l=this.block,h=this.tapW0,m=this.tapW1;for(let d=0;d<nt;d++){let x=d*be,M=0,f=0;for(let b=0;b<this.nTap[d];b++)M+=m[x+b],f+=m[x+b]*this.tapJ[x+b],h[x+b]=m[x+b],m[x+b]=0;d===ms&&(M=this.velW1),this.noiseLevel[d]=this.lvAcc[d]/l,this.noiseVelocity[d]=this.vAcc[d]/l,this.noiseArea[d]=this.aF[d],this.noiseGain[d]=M,this.noisePlace[d]=d===ms?M>0?this.jv:-1:M>0?f/M:-1,this.lvAcc[d]=0}let p=this.runLo,v=this.runHi,N=this.conLo,u=this.conHi,k=za*s,g=0;for(let d=0;d<3;d++){let x=za*s,M=-1;for(let O=0;O<a;O++){let H=i[O];if(H>=x)continue;let I=!0;for(let X=0;X<g;X++)O>=N[X]&&O<=u[X]&&(I=!1);I&&(x=H,M=O)}if(M<0)break;let f=x+So*s,b=M,E=M;for(;;){let O=b-1;if(O<0||i[O]>=f)break;let H=!0;for(let I=0;I<g;I++)O>=N[I]&&O<=u[I]&&(H=!1);if(!H)break;b=O}for(;;){let O=E+1;if(O>=a||i[O]>=f)break;let H=!0;for(let I=0;I<g;I++)O>=N[I]&&O<=u[I]&&(H=!1);if(!H)break;E=O}for(p[g]=b,v[g]=E,this.runMin[g]=M;b>0&&i[b-1]<k;)b--;for(;E<a-1&&i[E+1]<k;)E++;N[g]=b,u[g]=E,g++}let S=0;for(let d=0;d<g;d++){let x=v[d]+1,M=-1,f=4;for(let b=0;b<3;b++){if(S>>b&1||this.srcExit[b]<0)continue;let E=this.srcExit[b]>x?this.srcExit[b]-x:x-this.srcExit[b];E<f&&(f=E,M=b)}if(M<0)for(let b=0;b<3&&M<0;b++)!(S>>b&1)&&this.srcExit[b]<0&&this.nTap[b]===0&&(M=b);if(M<0)for(let b=0;b<3&&M<0;b++)!(S>>b&1)&&this.srcExit[b]<0&&(M=b);if(M<0)for(let b=0;b<3&&M<0;b++)S>>b&1||(M=b);S|=1<<M,this.runSlot[d]=M}for(let d=0;d<3;d++)S>>d&1||(this.srcExit[d]=-1);for(let d=0;d<g;d++){let x=this.runSlot[d],M=this.runMin[d],f=v[d]+1,b=i[M],E=this.nTap[x]===0;E&&this.freshSource(x,M),this.srcExit[x]=f,this.srcUJ[x]=M+1,this.srcSec[x]=M;let O=1e9;for(let K=N[d];K<=u[d];K++)this.gridMin[K]<O&&(O=this.gridMin[K]);this.srcCmd0[x]=E?O:this.srcCmd1[x],this.srcCmd1[x]=O;let H=(this.teethX-f)*n/e,I=H/Fo;I=I<=0?1:I>=1?0:1-I*I*(3-2*I);let X=this.labial<0?0:this.labial>1?1:this.labial,V=M+1-this.teethX;V=V<=0?0:V>=1?1:V*V*(3-2*V);let y=I*X,L=(1-y)*V;I=y+L;let q=(H-sn)/(Lo-sn);q=q<0?0:q>1?1:q*q*(3-2*q);let R=H/uo;R=R<=0?0:R>=1?1:R*R*(3-2*R),this.tx=f+_a*e/n,this.tw=(1-I)*(q*tn+(1-q)*(1-R)*vo),this.addAt(x),this.tx=this.teethX,this.tw=(1-I)*(1-q)*R*mo,this.addAt(x),this.tx=f+an*e/n,this.tw=y*po+L*fo,this.addAt(x);let _=this.vAcc[x]/l,G=2*Math.sqrt((b>1e-4?b:1e-4)/Math.PI),D=Ba*_/G;D=D<200?200:D>.45*o?.45*o:D,this.cLp[x]=1-Math.exp(-2*Math.PI*D/o);let Z=(1-I)*(1-q)*R,it=en*Math.exp(Z*Math.log(.45*o/en));it=it>.45*o?.45*o:it,this.cLp2[x]=1-Math.exp(-2*Math.PI*it/o);let rt=H>0?H*e:0,et=(1-I)*(q*_a*e+(1-q)*(R*rt+(1-R)*_a*e))+I*an*e,A=_>1?et/(Po*_):Ha;A=(A<Ha?A:Ha)*o,this.tau0[x]=this.tau1[x],this.tau1[x]=A,this.modOn[x]=1}{let d=Ns;this.nTap[d]===0&&this.freshSource(d,0);let x=(Eo*e-this.ductLen)/n;x=x<0?0:x>a?a:x,this.tx=x;let M=this.voicing;this.tw=go*(1-M)+xo*Math.pow(e,yo)*M,this.addAt(d);let f=this.agMean>1e-4?this.agMean:1e-4,b=Ba*(this.vAcc[d]/l)/(2*Math.sqrt(f/Math.PI));b=b<200?200:b>.45*o?.45*o:b,this.cLp[d]=1-Math.exp(-2*Math.PI*b/o),this.modOn[d]=0}{let d=ms,x=this.velum;this.velW0=this.velW1,this.velW1=x>Ae&&x<za*s?tn:0,this.velW0===0&&this.velW1>0&&this.freshSource(d,0);let M=2*Math.sqrt((x>1e-4?x:1e-4)/Math.PI),f=Ba*(this.vAcc[d]/l)/M;f=f<200?200:f>.45*o?.45*o:f,this.cLp[d]=1-Math.exp(-2*Math.PI*f/o),this.modOn[d]=0}for(let d=0;d<nt;d++)this.vAcc[d]=0;for(let d=0;d<nt;d++){let x=d*be,M=0;for(let f=0;f<this.nTap[d];f++)h[x+f]===0&&m[x+f]===0||(this.tapJ[x+M]=this.tapJ[x+f],h[x+M]=h[x+f],m[x+M]=m[x+f],M++);this.nTap[d]=M}}freshSource(t,e){this.vF[t]=0,this.vS[t]=0,this.nL[t]=0,this.nL2[t]=0,this.aF[t]=t<3?this.tgtMin[e]:t===Ns?this.ag:this.velum>1e-4?this.velum:1e-4,this.tau0[t]=this.tau1[t]=0,this.ring.fill(0,t*Ce,(t+1)*Ce)}addAt(t){if(!(this.tw>0))return;let s=this.nG,a=this.tx;a=a<0?0:a>s?s:a;let i=Math.floor(a),n=a-i;this.tShare=1-n,this.addTap(t,i),n>0&&i<s&&(this.tShare=n,this.addTap(t,i+1))}addTap(t,e){let s=t*be,a=this.nTap[t],i=this.tw*this.tShare;for(let n=0;n<a;n++)if(this.tapJ[s+n]===e){this.tapW1[s+n]+=i;return}a>=be||(this.tapJ[s+a]=e,this.tapW0[s+a]=0,this.tapW1[s+a]=i,this.nTap[t]=a+1)}render(t,e,s,a,i,n){let o=this.T,l=this.rate,h=this.nG,m=this.jv,p=this.R,v=this.L,N=this.sZ,u=this.isZ,k=this.Zs,g=this.area,S=this.dArea,d=this.U,x=this.pn,M=this.kf,f=this.kb,b=this.rv,E=this.viscC,O=this.wallK,H=this.gw,I=this.wV,X=this.wY,V=this.wS,y=this.moving,L=this.nMoving,q=this.jmList,R=this.nJm,_=this.gamA,G=this.ibA,D=this.bqA,Z=this.dv1,it=this.dv2,rt=this.dvRaw,et=this.dvCoef,A=this.aMin,K=this.dAMin,Y=this.iaMin,pt=this.wIbsA,At=this.wCmA,st=this.wKsA,_t=this.pJa,ge=this.pG,xe=this.pCm,Ot=this.pK,me=this.pDi,pe=this.pQ,$e=this.pY,Ze=this.pP,fe=this.fBuf,vt=this.bBuf,ht=this.tr,Kt=this.na,Rt=this.areaBuf,ue=this.folds,De=this.model===je,va=this.visc0,ba=this.ldG,Be=this.block,xs=1/Be,ga=this.gain,xa=this.mic*35e3/(2*Bo),Qe=this.micC,ys=.5*le/ht.area[0],Fe=ht.nn-2,ot=Fe*dt,ws=ht.D[Fe],wt=ht.Z[Fe],te=ht.area[Fe],Ee=this.ring,qt=this.tapJ,Ms=this.tapW0,ks=this.tapW1,As=this.cVc,Je=this.cVs,ye=this.noiseScale,Rs=this.voicing,de=this.vMax,ze=0;for(let we=0;we<a;we++){let ts=i+we,ne=(ts+1)*xs;this.w=ne;for(let w=0;w<L;w++){let B=y[w],$=g[B]+S[B];g[B]=$,$<1e-4&&($=1e-4);let J=A[B]+K[B];A[B]=J,J>$&&(J=$),J<1e-4&&(J=1e-4),Y[B]=1/J;let tt=Math.sqrt($)/co,Q=1/tt;N[B]=Q,u[B]=tt,k[B]=Q*Q}for(let w=0;w<R;w++){let B=q[w],$=k[B-1],J=k[B],tt=Y[B-1]-J*cs,Q=Y[B]-$*cs,at=Y[B]-$*cs,gt=Y[B-1]-J*cs;M[B]=.5*Ft*((tt>0?tt*tt:0)+(at>0?.1*at*at:0)),f[B]=.5*Ft*((Q>0?Q*Q:0)+(gt>0?.1*gt*gt:0));let ft=E[B-1]*$*N[B-1]+E[B]*J*N[B];if(b[B]=ft,(B&1)===0){let Bt=.5*(g[B-1]+g[B]),$t=Bt>Ae?O[B-1]*Math.sqrt(Bt-Ae):0;V[B]=$t,H[B]=$t*pt[B]+(B===_t?ge:0)}let mt=$*H[B],xt=mt<.001?1-mt:1/(1+mt);_[B]=xt;let ut=$*xt+J+ft;D[B]=ut,G[B]=1/ut}this.ductTau+=this.dTau,this.ductSZ+=this.dDuctSZ;let ve=this.pL0+(this.pL-this.pL0)*ne;this.velNow=this.vel0+(this.vel-this.vel0)*ne;let re;De?(ue.step(),re=ue.area):re=Rt[ts],re<1e-7&&(re=1e-7),this.ag=re,this.agAcc+=re;let Ht=this.ringPos;for(let w=0;w<nt;w++){let B=this.nTap[w],$=w===ms;if(B===0&&!($&&(this.velW0>0||this.velW1>0)))continue;let J,tt,Q;w<3?(J=d[this.srcUJ[w]],tt=A[this.srcSec[w]],tt>g[this.srcSec[w]]&&(tt=g[this.srcSec[w]]),Q=this.srcCmd0[w]+(this.srcCmd1[w]-this.srcCmd0[w])*ne,Q>tt&&(Q=tt)):w===Ns?(J=this.uG,tt=re,Q=tt):(J=this.uV,tt=this.velNow,Q=tt);let at=(Q-2e-4)*1250;at=w===Ns?1:at<=0?0:at>=1?1:at*at*(3-2*at),tt<1e-4&&(tt=1e-4),Q<1e-4&&(Q=1e-4);let gt=this.aF[w]+As*(Q-this.aF[w]);this.aF[w]=gt;let ft=J/tt;ft=ft>de?de:ft<-de?-de:ft;let mt=this.vF[w]+As*(ft-this.vF[w]);this.vF[w]=mt;let xt=mt<0?-mt:mt;this.vAcc[w]+=xt;let ut=w*Ce;Ee[ut+Ht]=xt;let Bt=this.tau0[w]+(this.tau1[w]-this.tau0[w])*ne,$t=Bt|0,Ct=Bt-$t,zt=Ee[ut+(Ht-$t&Ce-1)]*(1-Ct)+Ee[ut+(Ht-$t-1&Ce-1)]*Ct,Vt=zt*zt*zt,Gt=this.vS[w]+Je*(Vt-this.vS[w]);this.vS[w]=Gt;let Zt=this.modOn[w]*Rs;if(Zt>0){let jt=Gt>1?Vt/Gt-1:0;jt=jt/(1+(jt<0?-jt:jt)*(1/Co)),Vt=(1-Zt)*Vt+Zt*Gt*(1+jt)}let St=this.seed+1831565813|0;this.seed=St,St=Math.imul(St^St>>>15,St|1),St^=St+Math.imul(St^St>>>7,St|61);let He=(((St^St>>>14)>>>0)/4294967296*2-1)*1.7320508075688772,Ut=this.nL[w]+this.cLp[w]*(He-this.nL[w]);this.nL[w]=Ut;let fi=this.nL2[w]+this.cLp2[w]*(Ut-this.nL2[w]);this.nL2[w]=fi;let Hn=fi,ui=Math.sqrt(gt),Pe=(xt*ui*wo-Mo)*ko;Pe=w===Ns?1:Pe<=0?0:Pe>=1?1:Pe*Pe*(3-2*Pe);let di=at*Pe*Vt*ui;this.lvAcc[w]+=di;let vi=ye*di*Hn*mt/(xt+1);if($){this.pnV=vi*(this.velW0+(this.velW1-this.velW0)*ne);continue}let Ss=w*be;for(let jt=0;jt<B;jt++)x[qt[Ss+jt]]+=vi*(Ms[Ss+jt]+(ks[Ss+jt]-Ms[Ss+jt])*ne)}this.ringPos=Ht+1&Ce-1;let Dt=this.ductTau-.5,Me=Math.floor(Dt),bt=Dt-Me,es=-bt*(bt-1)*(bt-2)/6,ya=(bt+1)*(bt-1)*(bt-2)/2,ss=-(bt+1)*bt*(bt-2)/2,_e=(bt+1)*bt*(bt-1)/6,Mt=this.pos;{let w=ht.B[Mt-ht.D[0]&dt-1],B=ht.Z[0],$=(ve-2*w)/(ys+B);ht.F[Mt]=w+B*$}ht.interior(Mt);{let w=ht.F[ot+(Mt-ws&dt-1)],B=Mt-(Me+1)&dt-1,$=this.ductSZ,J=(es*vt[B+1&dt-1]+ya*vt[B]+ss*vt[B-1&dt-1]+_e*vt[B-2&dt-1])*$,tt=$*$,Q=1/re,at=ba*Q,gt=va*Q*Q*Q,ft=Q-tt*cs,mt=Q-1/te,xt=Io*.5*Ft*Q*Q,ut=xt+.5*Ft*(ft>0?ft*ft:0),Bt=xt+.5*Ft*(mt>0?mt*mt:0),$t=at<this.lG?at*this.uG:this.momG;this.lG=at;let Ct=2*(w-J)+$t*l,zt=wt+tt+gt+at*l,Vt=Ct>=0?2*Ct/(zt+Math.sqrt(zt*zt+4*ut*Ct)):2*Ct/(zt+Math.sqrt(zt*zt-4*Bt*Ct));this.uG=Vt,this.momG=at*Vt;let Gt=2*w-wt*Vt,Zt=2*J+tt*Vt;this.dpGlottis=Gt-Zt,this.dpAcc+=Gt-Zt,this.paAcc+=Zt,ue.ps=Gt,ue.pe=Zt,this.pSub=Gt,ht.B[ot+Mt]=Gt-w,fe[Mt]=(Zt-J)/$}for(let w=1;w<h;w+=2){if(w===m)continue;let B=w-1,$=k[B],J=k[w],tt=p[B]*N[B],Q=v[w]*N[w],at=2*(tt-Q)+x[w],gt=G[w],ft=at>=0?M[w]:f[w],mt=at<0?-at:at,xt=4*ft*mt*gt*gt,ut;if(xt<Qi)ut=at*gt*(1-.25*xt);else{let Bt=D[w];ut=2*at/(Bt+Math.sqrt(Bt*Bt+4*ft*mt))}d[w]=ut,v[B]=(tt-$*ut)*u[B],p[w]=(Q+J*ut)*u[w]}(m&1)===1&&(this.velumNode(Mt),Kt.interior(Mt),this.nostrils(Mt)),(h&1)===1&&this.lips();for(let w=2;w<h;w+=2){if(w===m)continue;let B=w-1,$=k[B],J=k[w],tt=p[B]*N[B],Q=v[w]*N[w],at=V[w],gt=At[w]*I[w]-st[w]*X[w],ft=pt[w],mt=w===_t?(.5*Ze+xe*pe-Ot*$e)*me:0,xt=Z[w]+et*(rt[w]-Z[w]);Z[w]=xt;let ut=it[w]+et*(xt-it[w]);it[w]=ut;let Bt=ut-at*gt*ft-mt,$t=_[w],Ct=2*tt*$t-2*Q+$*$t*Bt+x[w],zt=G[w],Vt=Ct>=0?M[w]:f[w],Gt=Ct<0?-Ct:Ct,Zt=4*Vt*Gt*zt*zt,St;if(Zt<Qi)St=Ct*zt*(1-.25*Zt);else{let Ut=D[w];St=2*Ct/(Ut+Math.sqrt(Ut*Ut+4*Vt*Gt))}d[w]=St;let He=(2*tt-$*(St-Bt))*$t;if(w===_t){let Ut=ge*He+mt;$e+=.5*o*(Ut+pe),pe=Ut,Ze=He}if(at>0){let Ut=(gt+He)*ft;I[w]=Ut,X[w]+=o*Ut,ze+=at*Ut*cn}v[B]=(He-tt)*u[B],p[w]=(Q+J*St)*u[w]}(m&1)===0&&(this.velumNode(Mt),Kt.interior(Mt),this.nostrils(Mt));{let w=this.ductSZ,B=w*w,$=Mt-Me&dt-1,J=(es*fe[$+1&dt-1]+ya*fe[$]+ss*fe[$-1&dt-1]+_e*fe[$-2&dt-1])*w,tt=k[0],Q=v[0]*N[0],at=Z[0]+et*(rt[0]-Z[0]);Z[0]=at;let gt=it[0]+et*(at-it[0]);it[0]=gt;let ft=gt,mt=2*J-2*Q+B*ft+x[0];x[0]=0;let xt=mt/(B+tt);d[0]=xt;let ut=2*J-B*(xt-ft);vt[Mt]=(ut-J)/w,p[0]=(Q+tt*xt)*u[0]}(h&1)===0&&this.lips();for(let w=0;w<ms;w++){let B=w*be;for(let $=0;$<this.nTap[w];$++)x[qt[B+$]]=0}this.pnV=0,this.pos=Mt+1&dt-1;let c=this.uLips+this.uNose+this.wallRadAcc+ze;this.wallRadAcc=0,ze=0;let P=xa*c,T=P-this.micX+Qe*this.micY;this.micX=P,this.micY=T;let C=((c-this.radPrev)*l+T)*No;this.radPrev=c;let j=C-this.hpX+this.hpC*this.hpY;this.hpX=C,this.hpY=j;let W=this.lb0*(j+this.lx2)+this.lb1*this.lx1-this.la1*this.ly1-this.la2*this.ly2;this.lx2=this.lx1,this.lx1=j,this.ly2=this.ly1,this.ly1=W;let Nt=W*ga*n[we];t[s+we]+=Nt,e[s+we]+=Nt}this.pQ=pe,this.pY=$e,this.pP=Ze,i+a>=Be&&(this.agMean=this.agAcc/Be)}lips(){let t=this.nG-1,e=this.Zs[t],s=this.R[t]*this.sZ[t],a=this.area[t]>1e-4?this.area[t]:1e-4,i=8*Ft/(3*Math.PI*Math.sqrt(Math.PI*a)),n=128*le/(9*Math.PI*Math.PI*a),o=this.ulLips,l=this.lrLips;l>0&&i>l&&(o*=l/i);let h=this.T/(2*i),m=this.pLipsOld,p=this.pn[this.nG];this.pn[this.nG]=0;let v=(2*s+p-e*(o+h*m))/(1+e*(h+1/n)),N=o+h*(m+v),u=N+v/n;this.pLipsOld=v,this.U[this.nG]=u,this.L[t]=(v-p-s)*this.isZ[t],this.ulLips=N,this.lrLips=i,this.uLips=u}nostrils(t){let e=this.na,s=e.nn-2,a=e.Z[s],i=e.F[s*dt+(t-e.D[s]&dt-1)],n=e.area[s],o=8*Ft/(3*Math.PI*Math.sqrt(Math.PI*n)),l=128*le/(9*Math.PI*Math.PI*n),h=this.T/(2*o),m=this.pNoseOld,p=(2*i-a*(this.ulNose+h*m))/(1+a*(h+1/l)),v=this.ulNose+h*(m+p);this.ulNose=v,this.pNoseOld=p,this.uNose=v+p/l,e.B[s*dt+t]=p-i}velumNode(t){let e=this.jv,s=this.R,a=this.L,i=this.sZ,n=this.isZ,o=this.Zs,l=e-1,h=e,m=this.na,p=o[l],v=o[h],N=m.Z[0],u=s[l]*i[l],k=a[h]*i[h],g=m.B[t-m.D[0]&dt-1],S=this.gw[e],d=this.dv1[e]+this.dvCoef*(this.dvRaw[e]-this.dv1[e]);this.dv1[e]=d;let x=this.dv2[e]+this.dvCoef*(d-this.dv2[e]);this.dv2[e]=x;let M=x;S>0&&(M-=this.wS[e]*(this.wCmA[e]*this.wV[e]-this.wKsA[e]*this.wY[e])*this.wIbsA[e]);let f=1/(1/p+S),b=2*u/p+M,E=this.pn[e];this.pn[e]=0;let O=this.kf[e],H=this.kb[e],I=f+v+this.rv[e],X=f*b-2*k+E,V=this.U[e],y=0,L=this.velNow;if(L>Ae){let R=1/L,_=Ft*this.velLen*R,G=Zi*2*Math.sqrt(Math.PI)*this.velLen*Math.sqrt(L)*R*R,D=R-1/m.area[0],Z=this.area[l]<this.area[h]?this.area[l]:this.area[h],it=R-1/Z,rt=qo*.5*Ft*R*R,et=rt+rn*.5*Ft*(D>0?D*D:0),A=rt+rn*.5*Ft*(it>0?it*it:0),K=_<this.lV?_*this.uV:this.momV;this.lV=_;let Y=f+N+G+_*this.rate,pt=f*b-2*g+K*this.rate+this.pnV;y=this.uV;for(let At=0;At<3;At++){let st=X-f*y;st>=0?V=O>0?2*st/(I+Math.sqrt(I*I+4*O*st)):st/I:V=H>0?2*st/(I+Math.sqrt(I*I-4*H*st)):st/I,st=pt-f*V,st>=0?y=et>0?2*st/(Y+Math.sqrt(Y*Y+4*et*st)):st/Y:y=A>0?2*st/(Y+Math.sqrt(Y*Y-4*A*st)):st/Y}this.momV=_*y}else{this.momV=0,this.lV=0;let R=X;R>=0?V=O>0?2*R/(I+Math.sqrt(I*I+4*O*R)):R/I:V=H>0?2*R/(I+Math.sqrt(I*I-4*H*R)):R/I}this.uV=y;let q=f*(b-V-y);if(S>0){let R=(this.wCmA[e]*this.wV[e]+q-this.wKsA[e]*this.wY[e])*this.wIbsA[e];this.wV[e]=R,this.wY[e]+=this.T*R,this.wallRadAcc+=this.wS[e]*R*cn}this.U[e]=V,a[l]=(q-u)*n[l],s[h]=(k+v*V)*n[h],m.F[t]=g+N*y}};var Ks=[\\\"_\\\",\\\"\\\\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\\\"],Yo={\\\\u025A:\\\"\\\\u025D\\\",\\\\u0261:\\\"g\\\",r:\\\"\\\\u0279\\\",\\\\u02A7:\\\"t\\\\u0283\\\",\\\\u02A4:\\\"d\\\\u0292\\\"},Va=new Map(Ks.map((r,t)=>[r,t]));function Nn(r){let t=Va.get(r);if(t!==void 0)return t;let e=Yo[r];return e===void 0?-1:Va.get(e)??-1}var Ga=1,ct={cls:\\\"vowel\\\",voiced:!0},Wo={_:{cls:\\\"silence\\\",voiced:!1},\\\\u0251:ct,\\\\u00E6:ct,\\\\u028C:ct,\\\\u0254:ct,\\\\u025B:ct,\\\\u025D:ct,\\\\u026A:ct,i:ct,\\\\u028A:ct,u:ct,e:ct,o:ct,a:ct,\\\\u0259:ct,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:ct,\\\\u0250:ct,\\\\u025C:ct,\\\\u0289:ct,\\\\u0268:ct,\\\\u0258:ct,\\\\u0275:ct,y:ct,\\\\u00F8:ct,\\\\u0153:ct,\\\\u026F:ct,\\\\u0264:ct},fs=Ks.map(r=>{let t=Wo[r];return{ipa:r,cls:t.cls,voiced:t.voiced,aspiration:t.aspiration??0,vot:t.vot??0}});var Ql=Va.get(\\\"s\\\")??-1,Ko=new Uint8Array(fs.length),$o=new Uint8Array(fs.length);fs.forEach((r,t)=>{Ko[t]=r.cls===\\\"vowel\\\"||r.cls===\\\"silence\\\"?1:r.cls===\\\"approximant\\\"?2:0,$o[t]=r.cls===\\\"stop\\\"?1:0});var Ua=[{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}],ja=Ks.length,Zo=Ua.length*2,$s=ja+Zo;var F={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},U=17,Et=U,Xe=U+1,Zs=U+2,Re=U+3;function mn(r,t){let e=n=>typeof n==\\\"number\\\"&&Number.isFinite(n)?n:0;if(t.fill(0),t.length<U)return;let s=e(r.jawSet);t[F.jaw]=.6*s,t[F.tbX]=.6*e(r.tongueFront),t[F.tbY]=.5*e(r.tongueHigh)-.5*s;let a=e(r.lipRound);a>0?(t[F.lipProt]=.6*a,t[F.lipWidth]=-.5*a,t[F.lipAp]=-.15*a):(t[F.lipWidth]=-.6*a,t[F.lipProt]=.15*a,t[F.lipAp]=-.1*a),t[F.lipAp]+=.4*e(r.lipOpen)+.3*s;let i=e(r.throat);t[F.larynx]=.9*e(r.larynxSet)+.3*e(r.twang)-.4*(i>0?i:0),t[F.epilarynx]=.8*e(r.twang),t[F.root]=.6*i,t[F.velum]=.7*e(r.nasal)}var Xa=[-.1,1,4.8,3.5,5,0,-1,-.4,-.2,0,0,-.25,-1.6,0,0,0,0],pn=[2.6,4.8,9.2,8,10.8,1,1,2.4,1.5,1,1,1.4,1.6,1,1,1,1],Te=[10,12,12,13,13,9,9,11,11,11,10,12,8,6,6,10,9],Qs=[.6,2.9,6.85,6.45,7.3,0,0,.7,.2,.5,0,-.15,0,0,0,0,0],Yt=[\\\"_\\\",\\\"\\\\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\\\"];var Ya=[{manner:\\\"silence\\\",voiced:!1,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"stop\\\",voiced:!1,place:\\\"bilabial\\\",dominant:[7],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"stop\\\",voiced:!0,place:\\\"bilabial\\\",dominant:[7],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"stop\\\",voiced:!1,place:\\\"alveolar\\\",dominant:[3,4],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"stop\\\",voiced:!0,place:\\\"alveolar\\\",dominant:[3,4],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"stop\\\",voiced:!1,place:\\\"velar\\\",dominant:[2],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"stop\\\",voiced:!0,place:\\\"velar\\\",dominant:[2],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"fricative\\\",voiced:!1,place:\\\"labiodental\\\",dominant:[10,7],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"fricative\\\",voiced:!0,place:\\\"labiodental\\\",dominant:[10,7],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"fricative\\\",voiced:!1,place:\\\"dental\\\",dominant:[3,4],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"fricative\\\",voiced:!0,place:\\\"dental\\\",dominant:[3,4],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"fricative\\\",voiced:!1,place:\\\"alveolar\\\",dominant:[3,4,0],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"fricative\\\",voiced:!0,place:\\\"alveolar\\\",dominant:[3,4,0],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"fricative\\\",voiced:!1,place:\\\"postalveolar\\\",dominant:[3,4,0,8,9],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"fricative\\\",voiced:!0,place:\\\"postalveolar\\\",dominant:[3,4,0,8,9],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"glottal\\\",voiced:!1,place:\\\"glottal\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"open\\\"},{manner:\\\"affricate\\\",voiced:!1,place:\\\"postalveolar\\\",dominant:[3,4,8,9],release:27,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"affricate\\\",voiced:!0,place:\\\"postalveolar\\\",dominant:[3,4,8,9],release:28,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"nasal\\\",voiced:!0,place:\\\"bilabial\\\",dominant:[7],release:-1,nasal:!0,glottal:\\\"none\\\"},{manner:\\\"nasal\\\",voiced:!0,place:\\\"alveolar\\\",dominant:[3,4],release:-1,nasal:!0,glottal:\\\"none\\\"},{manner:\\\"nasal\\\",voiced:!0,place:\\\"velar\\\",dominant:[2],release:-1,nasal:!0,glottal:\\\"none\\\"},{manner:\\\"lateral\\\",voiced:!0,place:\\\"alveolar\\\",dominant:[3,4,15],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"approximant\\\",voiced:!0,place:\\\"postalveolar\\\",dominant:[3,4,5,8,9,6],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"approximant\\\",voiced:!0,place:\\\"labial-velar\\\",dominant:[7,8,9,1,2],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"approximant\\\",voiced:!0,place:\\\"palatal\\\",dominant:[1,2],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"tap\\\",voiced:!0,place:\\\"alveolar\\\",dominant:[3,4],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"glottal\\\",voiced:!1,place:\\\"glottal\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"stop\\\"},{manner:\\\"lateral\\\",voiced:!0,place:\\\"alveolar\\\",dominant:[3,4,15,1,2],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"},{manner:\\\"vowel\\\",voiced:!0,place:\\\"none\\\",dominant:[],release:-1,nasal:!1,glottal:\\\"none\\\"}],Jt=[{name:\\\"male\\\",k:1,pharynxScale:1,tongueRadius:2.25,lipWidthBody:4.6,roofX:[-1.36528,-1.71909,-1.44257,-1.16605,-.88953,-.613,-.33648,-.05996,.23112,.57333,.85144,.93,1.10519,1.35681,1.618,1.86963,2.13081,2.392,2.65319,2.91437,3.166,3.40489,3.63422,3.854,4.06422,4.26489,4.456,4.63915,4.81274,4.972,5.11374,5.24115,5.359,5.46793,5.56731,5.66,5.74727,5.82786,5.9008,5.96514,6.02184,6.0728,6.12121,6.1639,6.1932],roofY:[8.50094,8.80094,8.88635,8.96813,9.04301,9.10839,9.1626,9.20506,9.24377,9.32092,9.43984,9.6,9.68519,9.80593,9.92,10.0163,10.10593,10.18,10.23667,10.27778,10.3,10.30148,10.28407,10.25,10.19926,10.13185,10.05,9.95074,9.83704,9.72,9.60037,9.47741,9.36,9.25444,9.15444,9.05,8.93815,8.82185,8.7,8.56852,8.43148,8.3,8.16667,8.03889,7.95],minLength:15.8741,neutralPharynx:8.679114,neutralLength:17.01563,vowelTargets:[[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[1.685,2.022,5.692,NaN,NaN,0,-.354,2,0,1,NaN,NaN,.217,NaN,NaN,NaN,NaN],[1.71734,4.3181,5.50464,NaN,NaN,.002,-.946147,2.19916,.0417314,1,NaN,NaN,.328,NaN,NaN,NaN,NaN],[1.02219,1.76474,6.05988,NaN,NaN,.002,.23676,.966674,-.0037729,.607,NaN,NaN,.053,NaN,NaN,NaN,NaN],[1.84396,1.3173,5.83076,NaN,NaN,0,-.851506,1.70254,.174709,.539,NaN,NaN,.175,NaN,NaN,NaN,NaN],[1.11739,3.34821,6.55346,NaN,NaN,0,-.216509,1.94745,-.0422592,1,NaN,NaN,.379,NaN,NaN,NaN,NaN],[.976,2.727,7.285,5.642,8.632,1,-.9,.654,.592,.347,NaN,NaN,-.921,NaN,NaN,NaN,NaN],[.575,3.637,7.419,NaN,NaN,0,-.001,1.154,0,1,NaN,NaN,.357,NaN,NaN,NaN,NaN],[.413,3.683,7.739,NaN,NaN,0,.514,1.046,0,1,NaN,NaN,.798,NaN,NaN,NaN,NaN],[.516,2.317,7.139,NaN,NaN,0,.478,.44,1.228,.199,NaN,NaN,.425,NaN,NaN,NaN,NaN],[.203,2.419,7.428,NaN,NaN,0,.402,.291,1.4,.065,NaN,NaN,.252,NaN,NaN,NaN,NaN],[.745,3.6,7.236,NaN,NaN,0,.269,1.315,0,1,NaN,NaN,.506,NaN,NaN,NaN,NaN],[.668,1.519,6.592,NaN,NaN,0,.227,.405,.597,.027,NaN,NaN,.061,NaN,NaN,NaN,NaN],[1.649,2.292,5.667,NaN,NaN,0,-.373,2,0,1,NaN,NaN,.37,NaN,NaN,NaN,NaN],[.505,2.944,6.685,NaN,NaN,0,.421,.323,.352,.533,NaN,NaN,.149,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN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NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[1.32069,1.25678,6.02835,NaN,NaN,0,-.335276,.998411,.463491,.539,NaN,NaN,.175,NaN,NaN,NaN,NaN],[.959344,1.81494,6.27513,NaN,NaN,.002,-.655744,2.0817,-.2,.607,NaN,NaN,.053,NaN,NaN,NaN,NaN],[1.04883,2.45673,6.28233,NaN,NaN,.002,.275032,.237875,-.00604252,.607,NaN,NaN,.053,NaN,NaN,NaN,NaN],[.196691,3.67139,7.59105,NaN,NaN,0,.118988,.21855,1.28252,.065,NaN,NaN,.252,NaN,NaN,NaN,NaN],[-.0486764,4.14389,6.68275,NaN,NaN,0,.363131,.0911767,1.06718,.199,NaN,NaN,.425,NaN,NaN,NaN,NaN],[.401239,2.74333,7.30483,NaN,NaN,0,.836646,.545774,.312847,1,NaN,NaN,.357,NaN,NaN,NaN,NaN],[.543948,2.70384,7.05207,NaN,NaN,0,.483956,.540973,1.24207,.199,NaN,NaN,.425,NaN,NaN,NaN,NaN],[.259827,4.68061,4.80757,NaN,NaN,0,.425163,.164055,1.5,.065,NaN,NaN,.252,NaN,NaN,NaN,NaN],[1.52518,2.84169,7.66767,NaN,NaN,0,-.71472,.755555,.744262,1,NaN,NaN,.506,NaN,NaN,NaN,NaN],[1.10488,2.15801,7.0783,NaN,NaN,0,.0687887,1.67217,.0623865,1,NaN,NaN,.379,NaN,NaN,NaN,NaN],[.255433,3.06882,6.81746,NaN,NaN,0,.522489,.0507891,1.44655,.065,NaN,NaN,.252,NaN,NaN,NaN,NaN],[.673371,1.81111,5.83671,NaN,NaN,0,.404942,.572677,.510262,.027,NaN,NaN,.061,NaN,NaN,NaN,NaN]],consonantTargets:[[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,N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,445.3125,410.1563,322.2656,445.3125,348.6328,459.9609,468.75,723.6328,492.1875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606.4453,612.3047,612.3047,348.6328,445.3125,410.1563,445.3125,348.6328,459.9609,568.3594,348.6328,468.75],tuneSlope:[0,-29.29688,43.94531,0,-8.789063,76.17188,67.38281,143.5547,190.4297,84.96094,149.4141,120.1172,32.22656,-43.94531,14.64844,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-8.789063,0,0,149.4141,84.96094,143.5547,84.96094,149.4141,120.1172,76.17188,149.4141,32.22656],tuneJaw:[0,1.685,1.516,1.022,1.182,1.041,.976,.575,.413,.516,.203,.745,.668,1.649,.505,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.182,1.022,1.022,.203,.516,.575,.516,.203,.745,1.041,.203,.668],tuneR1Max:[0,673.8281,638.6719,597.6563,541.9922,653.3203,515.625,603.5156,574.2188,524.4141,509.7656,626.9531,498.0469,644.5313,571.2891,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,541.9922,597.6563,597.6563,509.7656,524.4141,603.5156,524.4141,509.7656,626.9531,653.3203,509.7656,498.0469]},{name:\\\"female\\\",k:.9,pharynxScale:.88,tongueRadius:2.2,lipWidthBody:4.4,roofX:[-1.22852,-1.54718,-1.29831,-1.04944,-.80057,-.5517,-.30284,-.05397,.20801,.516,.76629,.837,.99467,1.22113,1.4562,1.68267,1.91773,2.1528,2.38787,2.62293,2.8494,3.0644,3.2708,3.4686,3.6578,3.8384,4.0104,4.17523,4.33147,4.4748,4.60237,4.71703,4.8231,4.92114,5.01058,5.094,5.17255,5.24507,5.31072,5.36863,5.41965,5.46552,5.50909,5.54751,5.57388],roofY:[7.65084,7.92084,7.99772,8.07132,8.13871,8.19755,8.24634,8.28455,8.31939,8.38883,8.49586,8.64,8.71667,8.82533,8.928,9.01467,9.09533,9.162,9.213,9.25,9.27,9.27133,9.25567,9.225,9.17933,9.11867,9.045,8.95567,8.85333,8.748,8.64033,8.52967,8.424,8.329,8.239,8.145,8.04433,7.93967,7.83,7.71167,7.58833,7.47,7.35,7.235,7.155],minLength:13.424,neutralPharynx:7.089841,neutralLength:14.72364,vowelTargets:[[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[1.682,1.847,5.832,NaN,NaN,0,-.665,2,0,1,NaN,NaN,.523,NaN,NaN,NaN,NaN],[1.483,3.712,6.328,NaN,NaN,0,-.094,1.851,0,1,NaN,NaN,.854,NaN,NaN,NaN,NaN],[1.28088,1.62683,5.87387,NaN,NaN,.002,.335575,1.12359,-.0348056,1,NaN,NaN,.087,NaN,NaN,NaN,NaN],[2.18231,1.18279,5.42025,NaN,NaN,0,-.961013,2.28849,.348209,.59,NaN,NaN,.254,NaN,NaN,NaN,NaN],[1.1329,2.86028,6.55673,NaN,NaN,0,-.332378,2.22805,-.127752,1,NaN,NaN,.773,NaN,NaN,NaN,NaN],[.694,2.581,7.338,5.71,8.898,1,-.9,.657,.59,.349,NaN,NaN,-.832,NaN,NaN,NaN,NaN],[.567,3.647,7.421,NaN,NaN,0,.077,1.147,0,1,NaN,NaN,.196,NaN,NaN,NaN,NaN],[.459,3.754,7.647,NaN,NaN,0,.295,1.092,0,1,NaN,NaN,1.016,NaN,NaN,NaN,NaN],[.573,2.314,7.268,NaN,NaN,0,.255,.371,1.4,.301,NaN,NaN,.382,NaN,NaN,NaN,NaN],[.266,2.243,7.381,NaN,NaN,0,.205,.187,1.4,.301,NaN,NaN,.24,NaN,NaN,NaN,NaN],[.8,3.593,7.368,NaN,NaN,0,.08,1.369,0,1,NaN,NaN,.853,NaN,NaN,NaN,NaN],[.966,1.827,7.11,NaN,NaN,0,.221,.288,1.4,.304,NaN,NaN,.46,NaN,NaN,Na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NaN,NaN,NaN],[1.05001,1.67781,6.04703,NaN,NaN,.002,-.1278,1.88944,-.197514,1,NaN,NaN,.087,NaN,NaN,NaN,NaN],[1.2978,2.25892,6.13862,NaN,NaN,.002,.291513,.217835,.153579,1,NaN,NaN,.087,NaN,NaN,NaN,NaN],[.748835,3.88263,7.45553,NaN,NaN,0,-.373731,.0944109,.996741,.301,NaN,NaN,.24,NaN,NaN,NaN,NaN],[.530736,3.70811,5.39006,NaN,NaN,0,.457426,.114866,1.43778,.301,NaN,NaN,.382,NaN,NaN,NaN,NaN],[.638896,2.6998,7.38642,NaN,NaN,0,.281391,.975347,.239022,1,NaN,NaN,.196,NaN,NaN,NaN,NaN],[1.34709,2.70038,6.73629,NaN,NaN,0,-.953099,.366066,1.47198,.301,NaN,NaN,.382,NaN,NaN,NaN,NaN],[-.0601416,4.75205,5.57332,NaN,NaN,0,.153204,.151234,1.33915,.301,NaN,NaN,.24,NaN,NaN,NaN,NaN],[.486386,2.7133,7.67124,NaN,NaN,0,-.995394,2.03666,.823076,1,NaN,NaN,.853,NaN,NaN,NaN,NaN],[1.09814,2.26515,7.21004,NaN,NaN,0,-.0773372,1.86078,.153965,1,NaN,NaN,.773,NaN,NaN,NaN,NaN],[.0242767,2.92052,6.7245,NaN,NaN,0,.17196,.00556334,1.35377,.301,NaN,NaN,.24,NaN,NaN,NaN,NaN],[.537281,2.37085,7.18489,NaN,NaN,0,.271071,.60755,1.2741,.304,NaN,NaN,.46,NaN,NaN,NaN,NaN]],consonantTargets:[[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,N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aN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]],tuneR1:[0,840.8203,653.3203,741.2109,714.8438,706.0547,492.1875,468.75,416.0156,486.3281,433.5938,521.4844,521.4844,823.2422,571.2891,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,714.8438,741.2109,741.2109,433.5938,486.3281,468.75,486.3281,433.5938,521.4844,706.0547,433.5938,521.4844],tuneSlope:[0,20.50781,55.66406,49.80469,46.875,43.94531,64.45313,146.4844,193.3594,114.2578,149.4141,137.6953,82.03125,11.71875,70.3125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.875,49.80469,49.80469,149.4141,114.2578,146.4844,114.2578,149.4141,137.6953,43.94531,149.4141,82.03125],tuneJaw:[0,1.682,1.483,1.067,1.256,1.181,.694,.567,.459,.573,.266,.8,.966,1.637,.818,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.256,1.067,1.067,.266,.573,.567,.573,.266,.8,1.181,.266,.966],tuneR1Max:[0,855.4688,697.2656,817.3828,755.8594,747.0703,583.0078,659.1797,662.1094,609.375,591.7969,700.1953,621.0938,820.3125,659.1797,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,755.8594,817.3828,817.3828,591.7969,609.375,659.1797,609.375,591.7969,700.1953,747.0703,591.7969,621.0938]},{name:\\\"child\\\",k:.74,pharynxScale:.8,tongueRadius:2.15,lipWidthBody:4,roofX:[-1.01,-1.27213,-1.0675,-.86288,-.65825,-.45362,-.249,-.04437,.17103,.42426,.63006,.6882,.81784,1.00404,1.19732,1.38353,1.5768,1.77008,1.96336,2.15663,2.34284,2.51962,2.68932,2.85196,3.00752,3.15602,3.29744,3.43297,3.56143,3.67928,3.78417,3.87845,3.96566,4.04627,4.11981,4.1884,4.25298,4.31262,4.36659,4.4142,4.45616,4.49387,4.5297,4.56128,4.58297],roofY:[6.29069,6.51269,6.5759,6.63642,6.69183,6.74021,6.78032,6.81174,6.84039,6.89748,6.98548,7.104,7.16704,7.25639,7.3408,7.41206,7.47839,7.5332,7.57513,7.60556,7.622,7.6231,7.61021,7.585,7.54745,7.49757,7.437,7.36355,7.27941,7.1928,7.10427,7.01328,6.9264,6.84829,6.77429,6.697,6.61423,6.52817,6.438,6.3407,6.2393,6.142,6.04333,5.94878,5.883],minLength:11.4771,neutralPharynx:5.801429,neutralLength:12.3134,vowelTargets:[[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[1.905,1.651,6.308,NaN,NaN,0,-.9,2,.361,.952,NaN,NaN,-.353,NaN,NaN,NaN,NaN],[1.367,3.496,6.678,NaN,NaN,0,-.534,1.601,.356,.548,NaN,NaN,-.23,NaN,NaN,NaN,NaN],[1.27917,1.94179,7.10892,NaN,NaN,0,-1,.468459,.334422,.516,NaN,NaN,-.157,NaN,NaN,NaN,NaN],[1.60487,1.06182,6.66595,NaN,NaN,0,-.481291,.829557,1.11712,.461,NaN,NaN,-.049,NaN,NaN,NaN,NaN],[1.35086,3.05085,7.03165,NaN,NaN,0,-.960103,1.63754,.550585,.548,NaN,NaN,-.168,NaN,NaN,NaN,NaN],[.05,1.859,7,5.722,9.357,1,-.9,.12,1.4,.214,NaN,NaN,-1.288,NaN,NaN,NaN,NaN],[.489,3.381,7.692,NaN,NaN,0,.005,.366,.001,.55,NaN,NaN,-.025,NaN,NaN,NaN,NaN],[.096,3.719,7.754,NaN,NaN,.001,.095,.386,.004,.655,NaN,NaN,-.001,NaN,NaN,NaN,NaN],[.498,2.338,7.482,NaN,NaN,0,-.498,.335,.6,.279,NaN,NaN,-.249,NaN,NaN,NaN,NaN],[.162,2.324,7.563,NaN,NaN,0,-.646,.301,.637,.054,NaN,NaN,-.327,NaN,NaN,NaN,NaN],[.676,3.477,7.552,NaN,NaN,0,-.219,.717,.351,.55,NaN,NaN,-.14,NaN,NaN,NaN,NaN],[.78,1.814,7.259,NaN,NaN,0,-.566,.131,1.241,.301,NaN,NaN,-.209,NaN,NaN,NaN,NaN],[1.816,2.008,6.239,NaN,NaN,0,-.753,2,.042,1,NaN,NaN,-.092,NaN,NaN,NaN,NaN],[.804,2.698,7.382,NaN,NaN,0,-.503,.569,.359,.535,NaN,NaN,-.379,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,Na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,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[1.19584,1.005,6.15846,NaN,NaN,0,-.461571,.918682,1.45202,.461,NaN,NaN,-.049,NaN,NaN,NaN,NaN],[.826508,1.53041,6.55857,NaN,NaN,0,-.117684,.884437,.373767,.516,NaN,NaN,-.157,NaN,NaN,NaN,NaN],[.655674,2.67915,7.45479,NaN,NaN,0,-.133794,.34988,.797836,.516,NaN,NaN,-.157,NaN,NaN,NaN,NaN],[.133509,3.13399,7.96958,NaN,NaN,0,-.991959,.561642,.399755,.054,NaN,NaN,-.327,NaN,NaN,NaN,NaN],[.439487,3.18761,7.94796,NaN,NaN,0,-.410189,.694782,.496471,.279,NaN,NaN,-.249,NaN,NaN,NaN,NaN],[.747307,3.0391,7.41261,NaN,NaN,0,.0226394,.228696,.183817,.55,NaN,NaN,-.025,NaN,NaN,NaN,NaN],[.504898,2.38409,7.58125,NaN,NaN,0,-.987977,1.11439,.843035,.279,NaN,NaN,-.249,NaN,NaN,NaN,NaN],[.39757,3.4521,8.0045,NaN,NaN,0,-.998927,.733525,.365173,.054,NaN,NaN,-.327,NaN,NaN,NaN,NaN],[1.00669,3.33113,7.16419,NaN,NaN,0,.0409327,.0676099,.618111,.55,NaN,NaN,-.14,NaN,NaN,NaN,NaN],[1.19737,2.32862,7.48863,NaN,N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NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],[NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]],tuneR1:[0,972.6563,700.1953,717.7734,758.7891,717.7734,489.2578,483.3984,421.875,533.2031,462.8906,536.1328,544.9219,978.5156,626.9531,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,758.7891,717.7734,717.7734,462.8906,533.2031,483.3984,533.2031,462.8906,536.1328,717.7734,462.8906,544.9219],tuneSlope:[0,-46.875,55.66406,84.96094,-14.64844,26.36719,29.29688,166.9922,213.8672,172.8516,213.8672,125.9766,102.5391,-49.80469,120.1172,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-14.64844,84.96094,84.96094,213.8672,172.8516,166.9922,172.8516,213.8672,125.9766,26.36719,213.8672,102.5391],tuneJaw:[0,1.905,1.367,.861,1.408,1.071,.05,.489,.096,.498,.162,.676,.78,1.816,.804,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.408,.861,.861,.162,.498,.489,.498,.162,.676,1.071,.162,.78],tuneR1Max:[0,893.5547,767.5781,779.2969,750,723.6328,489.2578,676.7578,682.6172,697.2656,667.9688,682.6172,650.3906,899.4141,741.2109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,750,779.2969,779.2969,667.9688,697.2656,676.7578,697.2656,667.9688,682.6172,723.6328,667.9688,650.3906]}];var Se=5.83392170191739;var r0=2*Math.PI*10;var Wt=r=>Ua.findIndex(t=>t.id===r),Qo=Wt(\\\"B\\\"),us=Wt(\\\"t\\\"),Jo=Wt(\\\"tss\\\"),fn=Wt(\\\"Pf\\\"),th=Wt(\\\"K\\\"),eh=Wt(\\\"^K\\\"),sh=Wt(\\\"!\\\"),ah=Wt(\\\"P!\\\"),ih=Wt(\\\"kch\\\"),un=Wt(\\\"m\\\"),nh=Wt(\\\"ch\\\"),rh=Wt(\\\"Psh\\\"),dn=Wt(\\\"in\\\"),oh=7.7,hh=.025,lh=.5,ch=.18,Wa=Yt.indexOf(\\\"p\\\"),Ka=Yt.indexOf(\\\"t\\\"),Ie=Yt.indexOf(\\\"k\\\"),vn=Yt.indexOf(\\\"s\\\"),Nh=Yt.indexOf(\\\"f\\\"),$a=Yt.indexOf(\\\"\\\\u0283\\\"),mh=Yt.indexOf(\\\"m\\\");function gn(r,t,e,s,a){let i=t>>1,n=(t&1)===1?1.3:1,o=i===un||i===dn;r.begin();for(let h=0;h<U;h++){if(h===F.velum)continue;let m=r.schwaTarget(h);h===F.tbY?m+=.1:h===F.jaw?m=.4:h===F.lipAp?m=.25:h===F.lipProt&&(m=.1),r.key(h,m)}r.emit(a?e-.15:e,e+s,.03,.03,1,0),o||(r.begin(),r.key(F.velum,r.schwaTarget(F.velum)),r.emit(a?e-.15:e-.02,e+s,.03,.03,4,0));let l=NaN;if(i===Qo)r.beatOral(Wa,e-.075,e,2,3.5,.01,l,!1,F.jaw,.3,-1,0,!1),Za(r,F.tbY,oh,e-.09,e+.01,.03,.04,2),bn(r,e-.075,e,n);else if(i===us||i===nh){let h=i===us?vn:$a,m=i===us?.03:.05;r.beatOral(Ka,e-.05,e,2,3.5,.01,l,!1,F.jaw,.3,-1,0,!1),r.beatOral(h,e+.012,e+m,1.6,0,0,.008,!1,-1,0,-1,0,!1),Js(r,e-.03,e+m-.004,(i===us?1.25:1.3)*n,i===us?.36:.38,.02)}else if(i===Jo){let h=Math.max(.09,Math.min(.26,s*1.6));r.beatOral(Ka,e-.05,e,2,3.5,.01,l,!1,F.jaw,.3,-1,0,!1),r.beatOral(vn,e+.012,e+h,1.4,0,0,.008,!1,-1,0,-1,0,!1),Js(r,e-.03,e+h,1.2*n,.4,.09)}else if(i===fn||i===rh){let h=i===fn;r.beatOral(Wa,e-.06,e,2,3.5,.01,l,!1,-1,0,-1,0,!1),r.beatOral(h?Nh:$a,e+.018,e+(h?.08:.11),h?1.6:1.5,0,0,.008,!1,-1,0,-1,0,!1),Js(r,e-.045,e+(h?.075:.1),1.7*n,.45,h?.04:.05)}else if(i===th)r.beatOral(Ie,e-.08,e,2,4,.008,l,!1,F.jaw,.35,-1,0,!1),bn(r,e-.08,e,n);else if(i===eh)r.beatOral(Ie,e-.06,e,2,4,.008,l,!1,F.jaw,.35,-1,0,!1),r.beatOral(Ie,e+.012,e+.085,1.4,0,0,.008,!0,F.tbY,r.xTbY-.015,-1,0,!1),r.begin(),r.key(Et,.5),r.emit(e-.05,e+.085,.02,.04,6,0),r.begin(),r.key(Re,-1.7*n),r.emit(e-.035,e+.085,.015,.05,2,0);else if(i===sh)r.beatOral(Ka,e-.12,e,2,3.5,.01,l,!1,-1,0,-1,0,!0),r.beatOral(Ie,e-.12,e+.035,2,0,0,l,!1,F.tbY,7.85,F.jaw,.4,!1),Za(r,F.dorsum,1,e-.03,e+.006,.04,.03,2);else if(i===ah){r.beatOral(Wa,e-.12,e,2,5,.006,l,!1,F.lipAp,-.08,-1,0,!1),r.beatOral(Ie,e-.12,e+.03,2,0,0,l,!1,-1,0,-1,0,!1),r.begin(),r.key(F.jaw,1.6),r.key(F.dorsum,1);let h=r.emit(e-.07,e+.004,.04,.05,40,2);h>=0&&r.rank(h,2)}else if(i===ih){let h=Math.max(.14,Math.min(.34,s*2));r.beatOral(Ie,e-.06,e,2,4,.008,l,!1,-1,0,-1,0,!1),r.beatOral(Ie,e+.002,e+.045,2,0,0,.008,!0,F.tbY,r.xTbY,-1,0,!1),r.beatOral($a,e+.025,e+h,1.4,0,0,.008,!1,-1,0,-1,0,!1),Js(r,e-.035,e+h,1.75*n,.45,.14)}else if(i===un){let h=Math.max(.06,s*.92);r.beatOral(mh,e-.03,e+h,1.6,0,0,l,!1,-1,0,-1,0,!1),r.begin(),r.key(F.velum,.9),r.emit(e-.02,e+h,.03,.03,4,0),r.begin(),r.key(Et,.3),r.emit(e-.08,e-.03,.02,.02,5,0),r.begin(),r.key(Re,.95*n),r.emit(e-.01,e+h,.02,.04,1,0)}else if(i===dn){let h=Math.max(.12,s);Za(r,F.jaw,.95,e-.04,e+h-.05,.05,.06,1.2),r.begin(),r.key(F.lipAp,.9),r.key(F.velum,.5),r.emit(e-.04,e+h-.05,.05,.06,4,0),r.begin(),r.key(Et,ch),r.emit(e-.03,e+h,.03,.05,8,0),r.begin(),r.key(Re,-lh*n),r.emit(e,e+h-.04,.06,.05,2,0)}}function Za(r,t,e,s,a,i,n,o){r.begin(),r.key(t,e);let l=r.emit(s,a,i,n,40,o);l>=0&&r.rank(l,o)}function bn(r,t,e,s){r.begin(),r.key(Xe,1),r.emit(t-.012,e+.03,.012,.03,8,0),r.begin(),r.key(F.larynx,Math.min(1.6,1.25+.3*s));let a=r.emit(e-.05,e+hh,.03,.08,40,3);a>=0&&r.rank(a,3)}function Js(r,t,e,s,a,i){r.begin(),r.key(Et,a),r.emit(t,e+i+.02,.02,.03,6,0),r.begin(),r.key(Re,s),r.emit(t-.01,e,.02,i,1,0)}var ta=U+4,ph=.08,fh=Yt.length,aa=0,ae=1,Ye=2,ia=3,vs=4,bs=5,ti=6,ei=7,na=8,uh=9,gs=10,dh={silence:aa,vowel:ae,stop:Ye,fricative:ia,affricate:vs,nasal:bs,approximant:ti,lateral:ei,tap:na,glottal:uh},vh={bilabial:0,labiodental:1,dental:2,alveolar:3,postalveolar:4,retroflex:5,palatal:6,velar:7,uvular:8},qe=fh;if(qe!==ja)throw new Error(\\\"vocal planner: the beats must follow the table phonemes\\\");var ie=$s,yt=new Uint8Array(ie),si=new Uint8Array(ie),ce=new Int8Array(ie).fill(-1),ai=new Uint8Array(ie),yn=new Uint8Array(ie),wn=new Uint8Array(ie),Mn=new Int16Array(ie).fill(-1),ra=new Int32Array(ie),ii=new Uint8Array(ie),ni=new Uint8Array(ie);for(let r=qe;r<ie;r++)yt[r]=gs;var bh=Yt.indexOf(\\\"\\\\u0259\\\"),Qa=[7.365,7.43,7.499],gh=.02;for(let r=0;r<qe;r++){let t=Ya[r];yt[r]=dh[t.manner],si[r]=t.voiced?1:0,ce[r]=vh[t.place]??-1,ai[r]=t.place===\\\"alveolar\\\"?1:0,yn[r]=t.nasal?1:0,wn[r]=t.glottal===\\\"open\\\"?1:t.glottal===\\\"stop\\\"?2:t.glottal===\\\"breathy\\\"?3:0,Mn[r]=t.release;let e=0;for(let i of t.dominant)e|=1<<i;ra[r]=e;let s=1<<F.tbX|1<<F.tbY|1<<F.root,a=1<<F.lipAp|1<<F.labiodental;ii[r]=e!==0&&(e&~s)===0?1:0,ni[r]=e!==0&&(e&~a)===0?1:0}var Ja=32,Pt=256,se=12,ea=.003,xh=1.5,xn=.06,ds=127,sa=.05,oa=class{segIdx=new Int16Array(Ja);segT0=new Float64Array(Ja);segCount=0;droppedVowel=!1;end=1/0;gT0=new Float64Array(Pt);gT1=new Float64Array(Pt);gRi=new Float64Array(Pt);gRo=new Float64Array(Pt);gStr=new Float64Array(Pt);gSpeed=new Float64Array(Pt);gHold=new Float64Array(Pt);gRet=new Float64Array(Pt);gRank=new Int8Array(Pt);gLead=new Float64Array(Pt*se);gLeadMin=new Float64Array(Pt);gLeadMax=new Float64Array(Pt);gKeyCount=new Uint8Array(Pt);gKeys=new Uint8Array(Pt*se);gVals=new Float64Array(Pt*se);gCount=0;vowelT=new Float64Array(qe*U);consT=new Float64Array(qe*U);kTmp=new Uint8Array(ta);vTmp=new Float64Array(ta);nTmp=0;target=new Float64Array(U);speed=new Float64Array(U);abduction=0;closure=0;stiffness=0;breath=1;beat=0;held=new Float64Array(U);xTbY=Qa[0];beatT=new Float64Array(U);at=0;restX=0;restY=0;silent=0;vowel=-1;wsum=new Float64Array(ta);vsum=new Float64Array(ta);rankA=new Int8Array(U);rankF=new Int8Array(U);rankR=new Int8Array(U);speedA=new Float64Array(U);speedR=new Float64Array(U);constructor(){this.setBody(0)}setBody(t){let e=t>0?t<2?t:2:0,s=Math.floor(e)<2?Math.floor(e):1,a=e-s,i=Jt[s],n=Jt[s+1];this.xTbY=Qa[s]*(1-a)+Qa[s+1]*a;for(let o=0;o<qe;o++)for(let l=0;l<U;l++)this.vowelT[o*U+l]=i.vowelTargets[o][l]*(1-a)+n.vowelTargets[o][l]*a,this.consT[o*U+l]=i.consonantTargets[o][l]*(1-a)+n.consonantTargets[o][l]*a;this.rebuild()}clear(){this.segCount=0,this.gCount=0,this.droppedVowel=!1,this.end=1/0}addNow(t,e){for(let a=0;a<this.segCount;a++)if(this.segIdx[a]===t&&Math.abs(this.segT0[a]-e)<=ea)return;let s=this.segCount;if(!(s>0&&this.segIdx[s-1]===t&&this.segT0[s-1]<e-ea&&yt[t]!==gs)){for(;this.segCount>0&&this.segT0[this.segCount-1]>=e-ea;)this.segCount--;this.push(t,e),this.rebuild()}}addUpcoming(t,e){for(let s=0;s<this.segCount;s++)if(Math.abs(this.segT0[s]-e)<=ea){this.segIdx[s]=t,this.rebuild();return}this.push(t,e),this.rebuild()}setEnd(t){for(this.end=t;this.segCount>0&&this.segT0[this.segCount-1]>=t;)this.segCount--;this.rebuild()}forget(t){let e=0;for(;e+2<this.segCount&&this.segT0[e+2]<t-xh;)e++;if(e!==0){for(let s=0;s<e;s++)yt[this.segIdx[s]]===ae&&(this.droppedVowel=!0);this.segIdx.copyWithin(0,e,this.segCount),this.segT0.copyWithin(0,e,this.segCount),this.segCount-=e,this.rebuild()}}push(t,e){this.segCount===Ja&&(yt[this.segIdx[0]]===ae&&(this.droppedVowel=!0),this.segIdx.copyWithin(0,1),this.segT0.copyWithin(0,1),this.segCount--);let s=this.segCount;for(;s>0&&this.segT0[s-1]>e;)s--;for(let a=this.segCount;a>s;a--)this.segIdx[a]=this.segIdx[a-1],this.segT0[a]=this.segT0[a-1];this.segIdx[s]=t,this.segT0[s]=e,this.segCount++}t1(t){return t+1<this.segCount?this.segT0[t+1]:this.end}segmentAt(t){let e=-1;for(let s=0;s<this.segCount&&this.segT0[s]<=t;s++)e=s;return e}phonemeOf(t){return this.segIdx[t]}vowelAt(t){for(let e=0;e<this.segCount;e++)if(yt[this.segIdx[e]]===ae&&this.t1(e)>t)return this.segIdx[e];return-1}beatAt(t){let e=this.segmentAt(t),s=e>=0?e:this.segCount>0?0:-1;return s>=0&&yt[this.segIdx[s]]===gs}silentAt(t){let e=this.segmentAt(t);return e>=0&&yt[this.segIdx[e]]===aa}queryNow(){let t=this.at,e=-1,s=-1;for(let a=0;a<this.segCount;a++){let i=this.segT0[a],n=this.segIdx[a];i<=t&&(e=a);let o=a+1<this.segCount?this.segT0[a+1]:this.end;s<0&&yt[n]===ae&&o>t&&(s=n)}this.silent=e>=0&&yt[this.segIdx[e]]===aa?1:0,this.vowel=s}begin(){this.nTmp=0}key(t,e){e===e&&(this.kTmp[this.nTmp]=t,this.vTmp[this.nTmp]=e,this.nTmp++)}emit(t,e,s,a,i,n){if(this.nTmp===0||this.gCount===Pt)return-1;let o=this.gCount++;this.gT0[o]=t,this.gT1[o]=e,this.gRi[o]=s,this.gRo[o]=a,this.gStr[o]=i,this.gSpeed[o]=n,this.gHold[o]=0,this.gRet[o]=0,this.gRank[o]=-1;let l=this.nTmp<se?this.nTmp:se;this.gKeyCount[o]=l;let h=1/0,m=-1/0;for(let p=0;p<l;p++){let v=this.kTmp[p];this.gKeys[o*se+p]=v,this.gVals[o*se+p]=this.vTmp[p];let N=v<U?yh*Se/(2*Math.PI*Te[v]*(n>0?n:1)):0;this.gLead[o*se+p]=N,N<h&&(h=N),N>m&&(m=N)}return this.gLeadMin[o]=h,this.gLeadMax[o]=m,this.nTmp=0,o}oral(t,e,s,a,i,n){let o=this.consT,l=ra[t],h=ii[t]===1,m=h?1+(i-1)*.35:i,p=yt[t],v=p===Ye||p===bs||p===vs,N=ni[t]===1,u=v?h?.039:N?.025:.024:0,k=v?h?.024:N?.022:.031:.008;this.begin();let g=v&&ce[t]===0;for(let f=0;f<U;f++)l&1<<f&&this.key(f,g&&f===F.lipAp?ri:o[e+f]);let S=this.emit(s-k,Math.max(s+.01,a-u),.03,h?.03:.018,40,m);if(S>=0){let f=h?1+(n-1)*.35:n,b=0;for(let E=0;E<U;E++)l&1<<E&&Te[E]>b&&(b=Te[E]);this.gRet[S]=f,this.gHold[S]=Se/(2*Math.PI*(b>0?b:10)*f),this.gRank[S]=(v?0:16)+(ce[t]>=0?ce[t]:0)}let d=o[e+F.tbX]===o[e+F.tbX];ai[t]===1&&!d&&(v||p===ia||p===na)&&(this.begin(),this.key(F.tbX,3.2),this.key(F.tbY,7.4),this.emit(s,a,.05,.05,1.2,0)),this.begin();let M=NaN;for(let f=0;f<U;f++){if(l&1<<f)continue;let b=o[e+f];b===b&&(h&&f===F.tbX?M=b:this.key(f,b))}this.emit(s,a,.05,.05,2.2,0),M===M&&(this.begin(),this.key(F.tbX,M),this.emit(s,a,.05,.05,.25,0))}rebuild(){this.gCount=0;let t=this.segCount,e=-1;for(let a=0;a<t;a++){let i=this.segIdx[a];if(yt[i]!==ae)continue;let n=this.segT0[a],o=this.t1(a),l=-1;for(let N=a+1;N<t;N++)if(yt[this.segIdx[N]]===ae){l=N;break}let h=e>=0?this.t1(e):n-.08,m=Math.max(.03,.75*(n-h))+.01,p=l>=0?Math.max(.03,.4*(this.segT0[l]-o))+.01:.042,v=i*U;this.begin();for(let N=0;N<U;N++)this.key(N,this.vowelT[v+N]);this.emit(n,o,m,p,1,0),e=a}let s=t;if(this.droppedVowel)s=-1;else for(let a=0;a<t;a++)if(yt[this.segIdx[a]]===ae){s=a;break}for(let a=0;a<t;a++){let i=this.segIdx[a],n=yt[i];if(n===ae||n===aa)continue;if(n===gs){let N=this.t1(a);gn(this,i-qe,this.segT0[a],N<1/0?N-this.segT0[a]:.25,a===0);continue}let o=this.gCount,l=this.segT0[a],h=this.t1(a),m=h-l,p=i*U;if(n===Ye){let N=!1;if(a>1){let u=this.segIdx[a-1],k=this.segIdx[a-2];if(yt[u]===Ye&&ce[u]>=0&&ce[u]<ce[i]){N=!0;let g=ra[i];for(let S=0;S<U;S++){let d=this.consT[k*U+S];g&1<<S&&d!==d&&(N=!1)}}}this.oral(i,p,N?l+Math.min(.025,Math.max(0,m-.03)):l,h,1.55,Oe[i]),si[i]===1&&(this.begin(),this.key(Et,gh),this.emit(l+.2*m,h,.02,.03,4,0))}else if(n===bs)this.oral(i,p,l,h,1.55,Oe[i]);else if(n===na)this.oral(i,p,l,h,2.8,Oe[i]);else if(n===vs){let N=l+m*.55;this.oral(i,p,l,N,2,Oe[i]);let u=Mn[i];u>=0&&this.oral(i,u*U,N+.008,h,1.4,Oe[u])}else(n===ia||n===ti||n===ei)&&this.oral(i,p,l,h,1.3,Oe[i]);yn[i]&&(this.begin(),this.key(F.velum,.45),this.emit(l-.02,h-.02,.05,.03,4,0));let v=wn[i];if(this.begin(),v===1)this.key(Et,.33),this.emit(l-.01,h,.03,.035,5,0);else if(v===2)this.key(Xe,1),this.emit(l,h,.012,.015,8,0);else if(v===3)this.key(Et,.1),this.emit(l,h,.03,.03,5,0);else if(si[i]===0)if(n===Ye||n===vs){let N=a+1<t&&yt[this.segIdx[a+1]]===ae,u=a>0&&Yt[this.segIdx[a-1]]===\\\"s\\\",k=N&&!u;this.key(Et,k?.36:.22);let g=k?Math.max(.02,wh[i]-.05):.0048;this.emit(l+.25*m,h+g,.035,k?.045:.02,6,0),this.stiffen(l+.25*m,h+g+(k?.045:.02))}else this.key(Et,.3),this.emit(l-.015,h+.005,.03,.03,6,0),this.stiffen(l-.015,h+.035);else n===ia&&(this.key(Et,.035),this.emit(l,h,.03,.03,3,0));if(a===0&&a<s)for(let N=o;N<this.gCount;N++){let u=this.gKeyCount[N],k=!1;for(let g=0;g<u;g++)this.gKeys[N*se+g]>=Et&&(k=!0);k||(this.gT0[N]-=xn,this.gRi[N]+=.5*xn)}}if(this.end<1/0){let a=t>0?this.segIdx[t-1]:0,i=yt[a],n=i===ae||i===bs||i===ti||i===ei||i===na;this.begin(),this.key(Et,.22),this.emit(this.end+(n?.045:.015),this.end+.1,.03,.06,6,0)}}evaluate(t,e,s){this.at=t,this.restX=e,this.restY=s,this.evaluateNow()}evaluateNow(){let t=this.at,e=this.restX,s=this.restY,a=this.wsum,i=this.vsum,n=this.speed,o=this.rankA,l=this.rankR,h=this.speedA,m=this.speedR;a.fill(0),i.fill(0);let p=this.held;p.fill(0);let v=this.rankF;o.fill(ds),v.fill(ds),l.fill(ds),h.fill(1),m.fill(1);for(let f=0;f<this.gCount;f++){let b=this.gRank[f];if(b<0)continue;let E=this.gT0[f]-this.gRi[f],O=this.gT1[f],H=O+this.gRo[f]+this.gHold[f];if(t+this.gLeadMax[f]<=E||t+this.gLeadMin[f]>H)continue;let I=this.gKeyCount[f],X=f*se;for(let V=0;V<I;V++){let y=t+this.gLead[X+V];if(y<=E||y>H)continue;let L=y<O,q=L?this.gSpeed[f]:this.gRet[f],R=this.gKeys[X+V];L?((b<o[R]||b===o[R]&&q>h[R])&&(o[R]=b,h[R]=q),y>=this.gT0[f]&&b<v[R]&&(v[R]=b)):(b<l[R]||b===l[R]&&q>m[R])&&(l[R]=b,m[R]=q)}}for(let f=0;f<U;f++)n[f]=o[f]!==ds?h[f]:l[f]!==ds?m[f]:1;for(let f=0;f<this.gCount;f++){let b=this.gT0[f]-this.gRi[f],E=this.gT0[f],O=this.gT1[f],H=this.gRi[f]>1e-6?this.gRi[f]:1e-6,I=this.gRo[f];if(t+this.gLeadMax[f]<=b||t+this.gLeadMin[f]>=O+I)continue;let X=this.gStr[f],V=this.gRank[f],y=this.gKeyCount[f],L=f*se,q=t+this.gLeadMin[f]>=E&&t+this.gLeadMax[f]<=O;for(let R=0;R<y;R++){let _=t+this.gLead[L+R];if(_<=b||_>=O+I)continue;let G=this.gKeys[L+R];if(V>=0&&_<O&&G<U&&V>v[G])continue;let D=1;q||(_<E?D=.5-.5*Math.cos(Math.PI*(_-b)/H):_>O&&(D=.5+.5*Math.cos(Math.PI*(_-O)/(I>1e-6?I:1e-6))));let Z=D*X;a[G]+=Z,i[G]+=Z*this.gVals[L+R],V>=0&&G<U&&D>p[G]&&(p[G]=D),V>=0&&V<30&&D>p[F.velum]&&(p[F.velum]=D)}}let N=this.target;for(let f=0;f<U;f++){let b=f===F.ttX?e:f===F.ttY?s:Mh[f],E=b;a[f]>0&&(f===F.velum?E=b+Math.min(1,a[f]/2)*(i[f]/a[f]-b):E=(b*sa+i[f])/(sa+a[f])),N[f]=E}let u=a[Et];this.abduction=u>0?i[Et]/u*Math.min(1,u/2):0;let k=a[Xe];this.closure=k>0?i[Xe]/k*Math.min(1,k/2):0;let g=a[Zs];this.stiffness=g>0?i[Zs]/g*Math.min(1,g):0;let S=-1;for(let f=0;f<this.segCount&&this.segT0[f]<=t;f++)S=f;S<0&&this.segCount>0&&(S=0);let d=S>=0&&yt[this.segIdx[S]]===gs;this.beat=d?1:0;let x=d?0:1,M=a[Re];this.breath=M>0?(x*sa+i[Re])/(sa+M):x}beatOral(t,e,s,a,i,n,o,l,h,m,p,v,N){let u=this.consT,k=t*U,g=this.beatT;for(let L=0;L<U;L++)g[L]=L===h?m:L===p?v:u[k+L];let S=ra[t],d=ii[t]===1,x=yt[t],M=!l&&(x===Ye||x===bs||x===vs),f=ni[t]===1,b=M?d?.039:f?.025:.024:0,E=M?d?.024:f?.022:.031:.008,O=o===o?Math.min(.03,o):.03,H=i>0?i:d?1+(a-1)*.35:a;this.begin();let I=M&&ce[t]===0;for(let L=0;L<U;L++)S&1<<L&&this.key(L,I&&L===F.lipAp&&h!==F.lipAp?ri:g[L]);let X=i>0?n:d?.03:.018,V=this.emit(e-E,Math.max(e+.01,s-b),O,X,40,H);if(V>=0){let L=i>0?i:Oe[t],q=0;for(let R=0;R<U;R++)S&1<<R&&Te[R]>q&&(q=Te[R]);this.gRet[V]=L,this.gHold[V]=Se/(2*Math.PI*(q>0?q:10)*L),this.gRank[V]=(M?0:16)+(ce[t]>=0?ce[t]:0)}let y=g[F.tbX]===g[F.tbX];!N&&ai[t]===1&&!y&&(this.begin(),this.key(F.tbX,3.2),this.key(F.tbY,7.4),this.emit(e,s,Math.min(.05,O+.02),.05,1.2,0)),this.begin();for(let L=0;L<U;L++){if(S&1<<L||N&&(L===F.tbX||L===F.tbY))continue;let q=g[L];q===q&&this.key(L,q)}this.emit(e,s,Math.min(.05,O+.02),.05,2.2,0)}rank(t,e){this.gRank[t]=30,this.gRet[t]=e,this.gHold[t]=.02}schwaTarget(t){return this.vowelT[bh*U+t]}stiffen(t,e){this.begin(),this.key(Zs,1),this.emit(t,e,.03,ph,1,0)}},kn=Float64Array.from(Te,r=>2*Math.PI*r*Sa/Se),yh=is(Is,.5)/Sa-is(2,.5)/Se,Oe=Float64Array.from(Ya,r=>r.manner===\\\"stop\\\"||r.manner===\\\"nasal\\\"?1.55:r.manner===\\\"tap\\\"?2.8:r.manner===\\\"affricate\\\"?2:1.3),wh=Float64Array.from(Yt,r=>{let t=Nn(r);return t>=0?fs[t].vot:0}),Mh=Float64Array.from(Qs),g0=Float64Array.from(Xa),oi=Float64Array.from(pn),hi=-.25,ri=-1,li=Float64Array.from(Xa,(r,t)=>t===F.lipAp?Math.min(r,ri):r);function An(r,t){let e=-r[F.jaw]/9.84,s=Math.cos(e),a=Math.sin(e);t[0]=-2.5+8.95*s+3.15*a+.3*(r[F.tbX]-2.9),t[1]=10.5+8.95*a-3.15*s+.35*(r[F.tbY]-6.85)}var ha=class{k=0;pharynxScale=0;r=0;roofX;roofY;x=0;y=0;sd=0;qx=0;qy=0;bx=0;by=0;tipX=0;tipY=0;constructor(t){this.k=t.k,this.pharynxScale=t.pharynxScale,this.r=t.tongueRadius*t.k,this.roofX=Float64Array.from(t.roofX),this.roofY=Float64Array.from(t.roofY)}px(t){return(t>.5?.5+(t-.5)*.86:t)*this.k}py(t){return(t<7?7-(7-t)*this.pharynxScale:t)*this.k}sx(t){return(t>.5?.86:1)*this.k}sy(t){return(t<7?this.pharynxScale:1)*this.k}project(){let t=this.x,e=this.y,s=1/0,a=1,i=this.roofX,n=this.roofY;for(let o=0;o+1<i.length;o++){let l=i[o],h=n[o],m=i[o+1]-l,p=n[o+1]-h,v=m*m+p*p,N=((t-l)*m+(e-h)*p)/v;N=N<0?0:N>1?1:N;let u=l+m*N,k=h+p*N,g=Math.sqrt((t-u)*(t-u)+(e-k)*(e-k));g<s&&(s=g,a=m*(e-h)-p*(t-l)<0?1:-1,this.qx=u,this.qy=k)}this.sd=s*a}bodyPoint(t){let e=t[F.tbX],s=t[F.tbY];this.bx=(e>.5?.5+(e-.5)*.86:e)*this.k,this.by=(s<7?7-(7-s)*this.pharynxScale:s)*this.k}tipPoint(t){let e=this.k,s=this.pharynxScale,a=t[F.tbX],i=t[F.tbY],n=t[F.ttX],o=t[F.ttY],l=(a>.5?.5+(a-.5)*.86:a)*e,h=(i<7?7-(7-i)*s:i)*e,m=(n>.5?.5+(n-.5)*.86:n)*e,p=(o<7?7-(7-o)*s:o)*e,v=Math.sqrt((m-l)*(m-l)+(p-h)*(p-h));if(v<1.05*this.r){let N=1.05*this.r/(v>1e-9?v:1e-9);m=l+(m-l)*N,p=h+(p-h)*N}this.tipX=m,this.tipY=p}};var lt={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};var la=[-1,-1.5,-1.1,1.5,-1.2,3.6,-1.3,5.6,-1.38,7.5,-1.33,8.9,-1.05,10.1,-.45,10.9,.4,11.3],ca=[1,9.6,1.8,9.92,2.7,10.18,3.6,10.3,4.4,10.25,5.1,10.05,5.7,9.72,6.15,9.36,6.5,9.05,6.78,8.7,6.98,8.3,7.12,7.95],Le=Math.PI,Na=Le/180,kh=.5,Ah=.3,Rn=.7,Rh=.1,We=32,ci=64,Ln=256,Ne=64,Sh=new Float64Array([-1,-.5,.5,1]),Lh=2,Fh=2.6,Eh=2,Ph=1.6,ma=1.4,kt=class{xs;ys;n=0;constructor(t=Ln){this.xs=new Float64Array(t),this.ys=new Float64Array(t)}};function Sn(r,t,e,s,a){r.n=0;for(let i=0;i<s-1;i++){let n=i>0?i-1:0,o=i+2<s-1?i+2:s-1;for(let l=0;l<a;l++){let h=l/a,m=h*h,p=m*h;r.xs[r.n]=.5*(2*t[i]+(-t[n]+t[i+1])*h+(2*t[n]-5*t[i]+4*t[i+1]-t[o])*m+(-t[n]+3*t[i]-3*t[i+1]+t[o])*p),r.ys[r.n]=.5*(2*e[i]+(-e[n]+e[i+1])*h+(2*e[n]-5*e[i]+4*e[i+1]-e[o])*m+(-e[n]+3*e[i]-3*e[i+1]+e[o])*p),r.n++}}r.xs[r.n]=t[s-1],r.ys[r.n]=e[s-1],r.n++}var pa=class{k=1;pharWall=new kt(64);palate=new kt(64);ctlX=new Float64Array(16);ctlY=new Float64Array(16);pnsX=0;pnsY=0;condX=0;condY=0;polarCX=0;polarCY=0;polarC2X=0;polarC2Y=0;jawR=1;vel=new kt(16);velOral=new kt(16);velNasal=new kt(16);outer=new kt;inner=new kt;upperLipIn=new kt(16);lowerLipIn=new kt(16);root=new kt(16);arcPts=new kt(We+1);blade=new kt(16);under=new kt(16);back=new kt(64);roof=new kt;cum=new Float64Array(Ln);tipPts=new kt(32);outline=new kt;floorX=new Float64Array(3);floorY=new Float64Array(3);lowTeethX=new Float64Array(4);lowTeethY=new Float64Array(4);tmp=new Float64Array(ci);crossT=new Float64Array(ci);crossExit=new Uint8Array(ci);ray=new Float64Array(6);r=new Float64Array(8);m=new Float64Array(5);io=new Float64Array(8);fs0=0;fs1=0;phScale=1;dBX=0;dBY=0;dRR=0;dUlx=0;dUly=0;dLlx=0;dLly=0;dGlotY=0;dEpi=new Float64Array(6);tongueR=2.25;lipWB=4.6;sinPhi=0;cosPhi=1;gInX=new Float64Array(Ne);gInY=new Float64Array(Ne);gOutX=new Float64Array(Ne);gOutY=new Float64Array(Ne);gMidX=new Float64Array(Ne);gMidY=new Float64Array(Ne);gD=new Float64Array(Ne);gArea=new Float64Array(Ne);gS=new Float64Array(Ne);gRegion=new Uint8Array(Ne);gN=0;length=17;pharynxLength=8.8;teethS=16;lipS=17;lipArea=1;velumPort=0;splitIndex=-1;tipX=0;tipY=0;contactTip=1;contactBody=1;contactTipNX=0;contactTipNY=-1;contactBodyNX=0;contactBodyNY=-1;phLen=8.8;orLen=8.3;epiArt=0;ventArt=0;constructor(t){this.setBody(t.scale,t.pharynx,t.tongueRadius,t.lipWidth)}setBody(t,e,s,a){this.k=t,this.phScale=e,this.tongueR=s,this.lipWB=a;let i=this.ctlX,n=this.ctlY;for(let h=0;h<la.length/2;h++)i[h]=this.pX(la[2*h]),n[h]=this.pY(la[2*h+1]);Sn(this.pharWall,i,n,la.length/2,4);for(let h=0;h<ca.length/2;h++)i[h]=this.pX(ca[2*h]),n[h]=this.pY(ca[2*h+1]);Sn(this.palate,i,n,ca.length/2,3),this.pnsX=this.pX(1),this.pnsY=this.pY(9.75),this.condX=this.pX(-2.5),this.condY=this.pY(10.5),this.polarCX=this.pX(2.6),this.polarCY=this.pY(6.95),this.polarC2X=this.pX(5),this.polarC2Y=this.pY(6.85);let o=this.pX(6.95)-this.condX,l=this.pY(7.75)-this.condY;this.jawR=Math.sqrt(o*o+l*l)}pX(t){return(t>.5?.5+(t-.5)*.86:t)*this.k}pY(t){return(t<7?7-(7-t)*this.phScale:t)*this.k}j(t,e){let s=this.pX(t),a=this.pY(e),i=s-this.condX,n=a-this.condY;this.r[0]=this.condX+i*this.cosPhi-n*this.sinPhi,this.r[1]=this.condY+i*this.sinPhi+n*this.cosPhi}evaluate(t){let e=this.k,s=this.phScale,a=0,i=0,n=this.r,o=t[lt.larynx]*e,l=(7-7*s)*e+o,h=(i=t[lt.jaw],-(i<-.2?-.2:i>3?3:i)*e/this.jawR);this.sinPhi=Math.sin(h),this.cosPhi=Math.cos(h);let m=(i=t[lt.velum]/1.2,i<0?0:i>1?1:i),p=(194+46*m)*Na,v=2.8*e,N=Math.cos(p),u=Math.sin(p),k=this.vel,g=this.velOral,S=this.velNasal;k.n=g.n=S.n=0;for(let c=0;c<=10;c++){let P=c/10,T=Math.sin(P*Le)*e*(.3*m-.12),C=this.pnsX+v*P*N,j=this.pnsY+v*P*u-T,W=-u,Nt=N,w=(.48-.2*P)*e;g.xs[c]=C+W*w,g.ys[c]=j+Nt*w,S.xs[c]=C-W*w,S.ys[c]=j-Nt*w,k.xs[c]=C,k.ys[c]=j}k.n=g.n=S.n=11;let d=this.palate,x=d.xs[0],M=d.ys[0];for(let c=0;c<11;c++){let P=c/10/.35;if(P<1){let T=(1-P)*(1-P);g.xs[c]=g.xs[c]+(x-g.xs[c])*T,g.ys[c]=g.ys[c]+(M-g.ys[c])*T}}let f=this.outer;f.n=0;let b=g.ys[10]-.3*e,E=this.pharWall;for(let c=0;c<E.n;c++){let P=E.ys[c];if(P<b){f.xs[f.n]=E.xs[c],f.ys[f.n++]=P;continue}if(c>0){let T=E.xs[c-1],C=E.ys[c-1],j=P-C,W=(i=(b-C)/(j>1e-9?j:1e-9),i<0?0:i>1?1:i);f.xs[f.n]=T+(E.xs[c]-T)*W,f.ys[f.n++]=C+(P-C)*W}break}let O=f.n;for(let c=10;c>=0;c--)f.xs[f.n]=g.xs[c],f.ys[f.n++]=g.ys[c];for(let c=1;c<d.n;c++)f.xs[f.n]=d.xs[c],f.ys[f.n++]=d.ys[c];let H=f.n-1,I=(i=t[lt.lipProt],(i<-.2?-.2:i>1.6?1.6:i)*e),X=(i=t[lt.lipWidth],i<0?0:i>1?1:i),V=(7.85-.3*t[lt.jaw])*e,y=(i=t[lt.labiodental],i<0?0:i>1?1:i),L=t[lt.lipAp]*e,q=(8.15+.12*(1-X)>.5?.5+(8.15+.12*(1-X)-.5)*.86:8.15+.12*(1-X))*e+I*.95,R=q-.15*e,_=V+L*.35+y*.35*e,G=q-.25*e,D=V-L*.65,Z=d.xs[d.n-1],it=d.ys[d.n-1];if(y>0){let c=t[lt.lipAp]*e,P=Z+.05*e,T=it-(c>-.1?c:-.1);G=G+(P-G)*y,D=D+(T-D)*y;let C=Z+.55*e,j=it+.45*e;R=R+(C-R)*(y*.7),_=_+(j-_)*(y*.7)}{let c=6.3652*e,P=8.35*e;{let C=this.io;C[0]=c,C[1]=P,C[2]=c+(.3*e+I*.4),C[3]=P+.05*e,C[4]=R+-.35*e,C[5]=_+.12*e,C[6]=R,C[7]=_,this.bezier3(this.upperLipIn,7)}let T=this.upperLipIn;for(let C=0;C<T.n;C++)f.xs[f.n]=T.xs[C],f.ys[f.n++]=T.ys[C]}let rt=this.tongueR*e,et=(t[lt.tbX]>.5?.5+(t[lt.tbX]-.5)*.86:t[lt.tbX])*e,A=(t[lt.tbY]<7?7-(7-t[lt.tbY])*s:t[lt.tbY])*e,K=(.5+(2.9-.5)*.86)*e,Y=(7-(7-6.85)*s)*e,pt=(.5+(.75-.5)*.86)*e+(.45*(et-K)+t[lt.root]*e),At=(7-(7-3.3)*s)*e+(.3*(A-Y)+.55*o),st=.3*e+0,_t=(7-(7-2.4)*s)*e+o,ge=0*e+.35*(pt-.75*e),xe=(7-(7-4.5)*s)*e+(o*.8+.15*(A-Y)),Ot=200*Na,me=et+rt*Math.cos(Ot),pe=A+rt*Math.sin(Ot),$e=Math.sin(Ot),Ze=-Math.cos(Ot),fe=Math.sqrt((pt-me)*(pt-me)+(At-pe)*(At-pe))/3;{let c=this.io;c[0]=pt,c[1]=At,c[2]=pt+.08*e,c[3]=At+fe,c[4]=me-$e*fe,c[5]=pe-Ze*fe,c[6]=me,c[7]=pe,this.bezier3(this.root,9)}let vt=(t[lt.ttX]>.5?.5+(t[lt.ttX]-.5)*.86:t[lt.ttX])*e,ht=(t[lt.ttY]<7?7-(7-t[lt.ttY])*s:t[lt.ttY])*e;if(Math.sqrt((vt-et)*(vt-et)+(ht-A)*(ht-A))<rt*1.05){let P=vt-et,T=ht-A,C=Math.sqrt(P*P+T*T);(C===0||C!==C)&&(C=1),P/=C,T/=C,vt=et+P*(rt*1.05),ht=A+T*(rt*1.05)}let Kt;{let c=Math.sqrt((et-vt)*(et-vt)+(A-ht)*(A-ht));c<=rt*1.0001?Kt=Math.atan2(ht-A,vt-et):Kt=Math.atan2(ht-A,vt-et)+Math.acos(rt/c)}for(;Kt>Ot;)Kt-=2*Le;for(;Kt<Ot-2*Le;)Kt+=2*Le;let Rt=this.arcPts;for(let c=0;c<We;c++){let P=Ot+(Kt-Ot)*c/(We-1);Rt.xs[c]=et+rt*Math.cos(P),Rt.ys[c]=A+rt*Math.sin(P)}Rt.n=We;let ue=Rt.xs[We-1],De=Rt.ys[We-1],va=Math.sin(Kt),ba=-Math.cos(Kt),Be=Math.sqrt((ue-vt)*(ue-vt)+(De-ht)*(De-ht)),xs=(i=t[lt.ttCurl],i<0?0:i>1?1:i),ga=ue+va*(Be*.5)+0,xa=De+ba*(Be*.5)+(.18+.5*xs)*e;{let c=this.io;c[0]=ue,c[1]=De,c[2]=ga,c[3]=xa,c[4]=vt,c[5]=ht,this.bezier2(this.blade,7)}let Qe=t[lt.dorsum];if(Qe>0){let c=et,P=vt,T=P-c>1e-6?P-c:1e-6;for(let j=0;j<Rt.n;j++){let W=(Rt.xs[j]-c)/T;if(W<=0||W>=1)continue;let Nt=Math.sin(Le*Math.pow(W,.8));Rt.ys[j]=Rt.ys[j]+-Qe*.9*e*Nt*Nt}let C=this.blade;for(let j=1;j<C.n-1;j++){let W=(C.xs[j]-c)/T;if(W<=0||W>=1)continue;let Nt=Math.sin(Le*Math.pow(W,.8));C.ys[j]=C.ys[j]+-Qe*.9*e*Nt*Nt}}{let c=4.972*e,P=(7-(7-6.15)*s)*e,T=c-this.condX,C=P-this.condY;n[0]=this.condX+T*this.cosPhi-C*this.sinPhi,n[1]=this.condY+T*this.sinPhi+C*this.cosPhi}let ys=n[0],Fe=n[1];{let c=this.io;c[0]=vt,c[1]=ht,c[2]=vt+(-.3*e-xs*.4*e),c[3]=ht+-.6*e,c[4]=ys,c[5]=Fe,this.bezier2(this.under,6)}this.floorX[0]=ys,this.floorY[0]=Fe;{let c=5.402*e,P=(7-(7-6.25)*s)*e,T=c-this.condX,C=P-this.condY;n[0]=this.condX+T*this.cosPhi-C*this.sinPhi,n[1]=this.condY+T*this.sinPhi+C*this.cosPhi}this.floorX[1]=n[0],this.floorY[1]=n[1];{let c=5.617*e,P=(7-(7-6.55)*s)*e,T=c-this.condX,C=P-this.condY;n[0]=this.condX+T*this.cosPhi-C*this.sinPhi,n[1]=this.condY+T*this.sinPhi+C*this.cosPhi}this.floorX[2]=n[0],this.floorY[2]=n[1],this.lowTeethX[0]=n[0],this.lowTeethY[0]=n[1];{let c=5.8492*e,P=7.15*e,T=c-this.condX,C=P-this.condY;n[0]=this.condX+T*this.cosPhi-C*this.sinPhi,n[1]=this.condY+T*this.sinPhi+C*this.cosPhi}this.lowTeethX[1]=n[0],this.lowTeethY[1]=n[1];{let c=6.047*e,P=7.75*e,T=c-this.condX,C=P-this.condY;n[0]=this.condX+T*this.cosPhi-C*this.sinPhi,n[1]=this.condY+T*this.sinPhi+C*this.cosPhi}this.lowTeethX[2]=n[0],this.lowTeethY[2]=n[1];{let c=6.1932*e,P=7.45*e,T=c-this.condX,C=P-this.condY;n[0]=this.condX+T*this.cosPhi-C*this.sinPhi,n[1]=this.condY+T*this.sinPhi+C*this.cosPhi}this.lowTeethX[3]=n[0],this.lowTeethY[3]=n[1];{let c=n[0],P=n[1];{let T=this.io;T[0]=c,T[1]=P,T[2]=c+(.25*e+I*.3),T[3]=P+-.05*e,T[4]=G+-.3*e,T[5]=D+-.12*e,T[6]=G,T[7]=D,this.bezier3(this.lowerLipIn,7)}}let ot=this.inner;ot.n=0,ot.xs[0]=st,ot.ys[0]=_t,ot.xs[1]=ge,ot.ys[1]=xe,ot.n=2;let ws=xe+.05*e,wt=this.back,te=this.root;wt.n=0;for(let c=0;c<te.n;c++)wt.xs[wt.n]=te.xs[c],wt.ys[wt.n++]=te.ys[c];for(let c=1;c<Rt.n;c++)wt.xs[wt.n]=Rt.xs[c],wt.ys[wt.n++]=Rt.ys[c];let Ee=te.n,qt=-1;for(let c=0;c<wt.n;c++)if(wt.ys[c]>ws){qt=c;break}if(qt<0)qt=wt.n-1;else if(qt>0){let c=wt.xs[qt-1],P=wt.ys[qt-1],T=wt.xs[qt],C=wt.ys[qt],j=C-P,W=(i=(ws-P)/(j>1e-9?j:1e-9),i<0?0:i>1?1:i);ot.xs[ot.n]=c+(T-c)*W,ot.ys[ot.n++]=P+(C-P)*W}if(qt<Ee){for(let c=qt;c<Ee;c++)ot.xs[ot.n]=te.xs[c],ot.ys[ot.n++]=te.ys[c];this.appendFrom(ot,Rt,1)}else this.appendFrom(ot,Rt,qt-Ee+2);this.appendFrom(ot,this.blade,1),this.appendFrom(ot,this.under,1);for(let c=1;c<3;c++)ot.xs[ot.n]=this.floorX[c],ot.ys[ot.n++]=this.floorY[c];for(let c=1;c<4;c++)ot.xs[ot.n]=this.lowTeethX[c],ot.ys[ot.n++]=this.lowTeethY[c];this.appendFrom(ot,this.lowerLipIn,0);let Ms=0;this.gN=Ms;let ks=l+2.4*e*this.phScale,As=this.polarCY,Je=12,ye=-1;for(let c=0;c<Je;c++){let P=c/Je,T=ks+.12*e+(As-(ks+.12*e))*P,C=this.ray;C[0]=4.6*e,C[1]=T,C[2]=-1,C[3]=0,C[5]=9*e,this.measure(!1)&&this.pushSample(1)}let Rs=30;for(let c=0;c<=Rs;c++){let P=c/Rs,T=(180+-144*P)*Na,C=P<.45?0:(P-.45)/.55,j=C*C*(3-2*C),W=this.polarCX+(this.polarC2X-this.polarCX)*j,Nt=this.polarCY+(this.polarC2Y-this.polarCY)*j,w=this.ray;w[0]=W,w[1]=Nt,w[2]=Math.cos(T),w[3]=Math.sin(T),w[5]=8*e,this.measure(!0)&&(ye<0&&T<=150*Na&&(ye=this.gN),this.pushSample(ye<0?1:2))}let de=Z+.03*e,ze=(R<G?R:G)-.04*e,we=de+.3*e>ze?de+.3*e:ze,ts=6,ne=this.gN,ve=this.m;for(let c=0;c<ts;c++){let P=de+(we-de)*(c/(ts-1)),T=this.ray;if(T[0]=P,T[1]=4*e,T[2]=0,T[3]=1,T[5]=8*e,!!this.measure(!1)){if(P>G){let C=D-(P-G)*4/3,j=C<ve[3]?C:ve[3],W=(a=(y-Rn)/(1-Rn),a=a<0?0:a>1?1:a,a*a*(3-2*a)*(a=(P-G-0)/(Rh*e-0),a=a<0?0:a>1?1:a,a*a*(3-2*a))),Nt=j+(ve[3]-3.5*e-j)*W;ve[0]=P,ve[1]=Nt,ve[4]=ve[3]-Nt}this.pushSample(3)}}this.splitIndex=ye;let re=(1.1+(this.lipWB-1.1)*X)*e,Ht=this.gN,Dt=this.roof;Dt.n=0;for(let c=O;c<=H;c++)Dt.xs[Dt.n]=f.xs[c],Dt.ys[Dt.n++]=f.ys[c];let Me=this.cum;Me[0]=0;for(let c=1;c<Dt.n;c++){let P=Dt.xs[c]-Dt.xs[c-1],T=Dt.ys[c]-Dt.ys[c-1];Me[c]=Me[c-1]+Math.sqrt(P*P+T*T)}let bt=this.tipPts;bt.n=0;for(let c=2;c<this.blade.n;c++)bt.xs[bt.n]=this.blade.xs[c],bt.ys[bt.n++]=this.blade.ys[c];for(let c=1;c<3;c++)bt.xs[bt.n]=this.under.xs[c],bt.ys[bt.n++]=this.under.ys[c];this.closestApproach(bt),this.contactTip=n[4],this.contactTipNX=n[0],this.contactTipNY=n[1],this.closestApproach(Rt),this.contactBody=n[4],this.contactBodyNX=n[0],this.contactBodyNY=n[1];{let c=this.outline;c.n=0,this.appendFrom(c,te,0),this.appendFrom(c,Rt,1),this.appendFrom(c,this.blade,1),this.appendFrom(c,this.under,1);for(let W=1;W<3;W++)c.xs[c.n]=this.floorX[W],c.ys[c.n++]=this.floorY[W];c.xs[c.n]=te.xs[0],c.ys[c.n++]=te.ys[0];let T=1-(a=((this.contactTip<this.contactBody?this.contactTip:this.contactBody)- -.06*e)/(0- -.06*e),a=a<0?0:a>1?1:a,a*a*(3-2*a)),C=.1*e*(1+T),j=Me[Dt.n-1];for(let W=0;W<Ht;W++){if(this.gRegion[W]===0)continue;let Nt=this.io;Nt[0]=this.gOutX[W],Nt[1]=this.gOutY[W],this.projectOn();let w=n[2],B=n[3],$=1-(a=(B-.15*e)/(.25*e-.15*e),a=a<0?0:a>1?1:a,a*a*(3-2*a));if($<=0)continue;Nt[0]=this.gOutX[W],Nt[1]=this.gOutY[W],this.signedGap();let J=n[0];if(J-C-B<=.6*e)for(let mt=0;mt<4;mt++){let xt=Sh[mt];Nt[2]=(i=w+xt*C,i<0?0:i>j?j:i),this.pointAlong(),this.signedGap();let ut=n[0];(ut<J||ut!==ut)&&(J=ut)}let tt=(1-(a=(J-.15*e)/(.6*e-.15*e),a=a<0?0:a>1?1:a,a*a*(3-2*a)))*$,Q=(1-(a=(J-.45*e)/(.6*e-.45*e),a=a<0?0:a>1?1:a,a*a*(3-2*a)))*$;if(tt<=0&&Q<=0)continue;let at=J>0?J:0,gt=this.gD[W],ft=gt+((gt<at?gt:at)-gt)*Q;this.gD[W]=ft+(at-ft)*tt}}{let c=R<G?R:G,P=.6*e,T=(a=(y-0)/(kh-0),a=a<0?0:a>1?1:a,a*a*(3-2*a)),C=T>=1?1/0:L+Ah*e*T/(1-T);for(let j=0;j<Ht;j++){if(this.gRegion[j]!==3||this.gMidX[j]<Z)continue;let W=c-this.gMidX[j],Nt=W>0?W:0,w=C+Nt*Nt/(2*P),B=w>0?w:0;B<this.gD[j]&&(this.gD[j]=B)}}for(let c=0;c<Ht;c++){let P=this.gD[c],T=this.gRegion[c];if(T===1)this.gArea[c]=Lh*Math.pow(P,ma);else if(T===2){let C=(a=(this.gMidX[c]-vt-0)/(.4*e-0),a=a<0?0:a>1?1:a,a*a*(3-2*a)),j=Fh*Math.pow(P,ma);this.gArea[c]=j+(Ph*Math.pow(P,ma)-j)*C}else{let C=(i=(this.gMidX[c]-Z)/(.45*e),i<0?0:i>1?1:i),j=Eh*Math.pow(P,ma),W=Le/4*P*re;this.gArea[c]=j+(W-j)*C}}for(let c=1;c<Ht-1;c++){let P=this.gArea[c-1],T=this.gArea[c+1],C=1.35*(P>T?P:T);this.gArea[c]>C&&(this.gArea[c]=C)}let es=t[lt.lateral];if(es>0){let c=es*.35*e*e;for(let P=0;P<Ht;P++){if(this.gRegion[P]<2)continue;let T=this.gMidX[P]-vt,C=this.gMidY[P]-ht;Math.sqrt(T*T+C*C)<1.4*e&&this.gArea[P]<c&&(this.gArea[P]=c)}}let ss=2.4*e*this.phScale;for(let c=0;c<Ht;c++){if(c>0){let P=this.gMidX[c]-this.gMidX[c-1],T=this.gMidY[c]-this.gMidY[c-1];ss+=Math.sqrt(P*P+T*T)}this.gS[c]=ss}let _e=Ht-1;this.teethS=ne<Ht?this.gS[ne]:this.gS[_e],this.lipS=this.gS[_e],this.pharynxLength=ye>0?this.gS[ye]:this.gS[Je],this.length=this.lipS,this.lipArea=this.gArea[_e];let Mt=t[lt.velum];this.velumPort=(Mt>0?Mt:0)*e*e,this.tipX=vt,this.tipY=ht,this.dBX=et,this.dBY=A,this.dRR=rt,this.dUlx=R,this.dUly=_,this.dLlx=G,this.dLly=D,this.dGlotY=l,this.dEpi[0]=st,this.dEpi[1]=_t,this.dEpi[2]=ge,this.dEpi[3]=xe,this.dEpi[4]=pt,this.dEpi[5]=At,this.epiArt=t[lt.epilarynx],this.ventArt=t[lt.ventricular]}resample(t,e,s,a){this.resampleInto(t,e,s,a,t.length,e.length)}resampleInto(t,e,s,a,i,n){let o=this.pharynxLength;this.fs0=0,this.fs1=o,this.fill(t,s,i),this.fs0=o,this.fs1=this.lipS,this.fill(e,a,n),this.phLen=o,this.orLen=this.lipS-o}fill(t,e,s){let a=this.fs0,i=this.fs1,n=0,o=this.k,l=2.4*o*this.phScale,h=.1*l,m=this.gN,p=this.gS,v=this.gArea,N=.95*(1-.75*(n=this.ventArt,n<0?0:n>1?1:n)),u=1.9+(.35-1.9)*(n=this.epiArt,n<0?0:n>1?1:n),k=o*o,g=(i-a)/s,S=8,d=0;for(let x=0;x<s;x++){let M=0,f=!1,b=1/0;for(let I=0;I<S;I++){let X=a+g*(x+(I+.5)/S),V;if(X<=l){let y=X/l,L=y<.3?1.3:y<.5?N:1.2+(u-1.2)*((y-.5)/.5);for(let q=0;q<2;q++){let R=q===0?.3:.5;if(Math.abs(y-R)<.03){let _=R-.03,G=R+.03,D=_<.3?1.3:_<.5?N:1.2+(u-1.2)*((_-.5)/.5),Z=G<.3?1.3:G<.5?N:1.2+(u-1.2)*((G-.5)/.5);L=D+(Z-D)*((y-(R-.03))/(2*.03))}}V=L*k,X>l-h&&(V=V+(v[0]-V)*((X-(l-h))/h))}else if(X<=p[0])V=v[0];else{let y=0,L=m-1;if(X>=p[L])V=v[L];else{for(;L-y>1;){let _=y+L>>1;p[_]<=X?y=_:L=_}let q=p[L]-p[y],R=(X-p[y])/(q>1e-9?q:1e-9);V=v[y]+(v[L]-v[y])*R}}if(V<b&&(b=V),V<=1e-5){f=!0;break}M+=1/V}let E=a+g*x,O=a+g*(x+1)+(x===s-1?1e-6:0);for(;d<m&&p[d]<E;)d++;let H=d;for(;H<m&&p[H]<=O;)v[H]<b&&(b=v[H]),v[H]<=1e-5&&(f=!0),H++;t[x]=f?0:S/M,e[x]=f?0:b<t[x]?b:t[x]}}appendFrom(t,e,s){for(let a=s<e.n?s:e.n;a<e.n;a++)t.xs[t.n]=e.xs[a],t.ys[t.n++]=e.ys[a]}bezier3(t,e){let s=this.io,a=s[0],i=s[1],n=s[2],o=s[3],l=s[4],h=s[5],m=s[6],p=s[7];for(let v=0;v<e;v++){let N=v/(e-1),u=1-N,k=u*u*u,g=3*u*u*N,S=3*u*N*N,d=N*N*N;t.xs[v]=k*a+g*n+S*l+d*m,t.ys[v]=k*i+g*o+S*h+d*p}t.n=e}bezier2(t,e){let s=this.io,a=s[0],i=s[1],n=s[2],o=s[3],l=s[4],h=s[5];for(let m=0;m<e;m++){let p=m/(e-1),v=1-p;t.xs[m]=v*v*a+2*v*p*n+p*p*l,t.ys[m]=v*v*i+2*v*p*o+p*p*h}t.n=e}rayPolyline(t,e){let s=this.ray,a=s[0],i=s[1],n=s[2],o=s[3],l=s[4],h=s[5],m=0,p=t.xs,v=t.ys;for(let N=0;N+1<t.n;N++){let u=p[N],k=v[N],g=p[N+1],S=v[N+1],d=n*(k-i)-o*(u-a)>=0,x=n*(S-i)-o*(g-a)>=0;if(d===x)continue;let M=g-u,f=S-k,b=n*f-o*M;if(Math.abs(b)<1e-15)continue;let E=((u-a)*f-(k-i)*M)/b;E>=l&&E<=h&&m<e.length&&(e[m++]=E)}return m}rayCrossings(t){let e=this.ray,s=e[0],a=e[1],i=e[2],n=e[3],o=e[4],l=e[5],h=0,m=t.xs,p=t.ys,v=this.crossT,N=this.crossExit;for(let u=0;u+1<t.n;u++){let k=m[u],g=p[u],S=m[u+1],d=p[u+1],x=i*(g-a)-n*(k-s)>=0,M=i*(d-a)-n*(S-s)>=0;if(x===M)continue;let f=S-k,b=d-g,E=i*b-n*f;if(Math.abs(E)<1e-15)continue;let O=((k-s)*b-(g-a)*f)/E;O>=o&&O<=l&&h<v.length&&(v[h]=O,N[h]=i*(p[u+1]-p[u])-n*(m[u+1]-m[u])<0?1:0,h++)}return h}measure(t){let e=this.k,s=this.ray,a=this.tmp,i=s[0],n=s[1],o=s[2],l=s[3];s[4]=0;let h=this.rayPolyline(this.outer,a);if(h===0)return!1;let m=1/0;for(let k=0;k<h;k++)a[k]<m&&(m=a[k]);let p;if(t){s[5]=m+1.5*e;let k=this.rayCrossings(this.inner),g=this.crossT,S=this.crossExit;for(let M=1;M<k;M++){let f=g[M],b=S[M],E=M-1;for(;E>=0&&g[E]>f;)g[E+1]=g[E],S[E+1]=S[E],E--;g[E+1]=f,S[E+1]=b}let d=0;if(k>0&&S[0]===1)p=g[0],d=1;else{let M=2.5*e;s[2]=-o,s[3]=-l,s[5]=M;let f=this.rayPolyline(this.inner,a),b=M;for(let E=0;E<f;E++)a[E]<b&&(b=a[E]);p=-b}let x=0;for(;d<k&&g[d]<m;){if(S[d]===1){d++;continue}let M=d+1<k?g[d+1]:m+1.5*e;x+=(M<m?M:m)-g[d],d+=2}p=p+x}else{s[5]=m+1.5*e;let k=this.rayPolyline(this.inner,a);p=-1/0;for(let g=0;g<k;g++)a[g]>p&&a[g]<m+1.5*e&&(p=a[g]);if(p===-1/0){let g=m-3.5*e;p=g>0?g:0}}let v=m-p,N=this.m,u=p<m?p:m;return N[0]=i+o*u,N[1]=n+l*u,N[2]=i+o*m,N[3]=n+l*m,N[4]=v>0?v:0,!0}pushSample(t){let e=this.gN++,s=this.m;this.gInX[e]=s[0],this.gInY[e]=s[1],this.gOutX[e]=s[2],this.gOutY[e]=s[3],this.gMidX[e]=s[0]+(s[2]-s[0])*.5,this.gMidY[e]=s[1]+(s[3]-s[1])*.5,this.gD[e]=s[4],this.gArea[e]=0,this.gS[e]=0,this.gRegion[e]=t}projectOn(){let t=this.roof,e=this.cum,s=this.r,a=this.io[0],i=this.io[1],n=1/0,o=0,l=0,h=0,m=1,p=0;for(let v=0;v+1<t.n;v++){let N=t.xs[v],u=t.ys[v],k=t.xs[v+1]-N,g=t.ys[v+1]-u,S=k*k+g*g;if(S<1e-12)continue;let d=((a-N)*k+(i-u)*g)/S;d=d<0?0:d>1?1:d;let x=N+k*d,M=u+g*d,f=Math.sqrt((a-x)*(a-x)+(i-M)*(i-M));f<n&&(n=f,o=e[v]+d*Math.sqrt(S),l=x,h=M,m=k*(i-u)-g*(a-N)<0?1:-1,p=v)}s[2]=o,s[3]=n,s[4]=m*n,s[5]=p,s[6]=l,s[7]=h}pointAlong(){let t=this.roof,e=this.cum,s=this.io[2],a=0,i=0;for(;i+2<t.n&&e[i+1]<s;)i++;let n=e[i+1]-e[i],o=n>1e-9?(a=(s-e[i])/n,a<0?0:a>1?1:a):0;this.io[0]=t.xs[i]+(t.xs[i+1]-t.xs[i])*o,this.io[1]=t.ys[i]+(t.ys[i+1]-t.ys[i])*o}signedGap(){let t=this.outline,e=this.io[0],s=this.io[1],a=1/0,i=!1,n=t.xs,o=t.ys;for(let h=0;h+1<t.n;h++){let m=n[h],p=o[h],v=n[h+1],N=o[h+1],u=v-m,k=N-p,g=u*u+k*k,S=g>1e-12?((e-m)*u+(s-p)*k)/g:0;S=S<0?0:S>1?1:S;let d=e-m-u*S,x=s-p-k*S,M=d*d+x*x;M<a&&(a=M),p>s!=N>s&&e<m+(s-p)*u/k&&(i=!i)}let l=Math.sqrt(a);this.r[0]=i?-l:l}closestApproach(t){let e=this.r,s=1/0,a=0;for(let h=0;h<t.n;h++)this.io[0]=t.xs[h],this.io[1]=t.ys[h],this.projectOn(),e[4]<s&&(s=e[4],a=e[5]|0);let i=this.roof,n=i.xs[a+1]-i.xs[a],o=i.ys[a+1]-i.ys[a],l=Math.sqrt(n*n+o*o);(l===0||l!==l)&&(l=1),e[4]=s,e[0]=o/l,e[1]=-n/l}};var Ch=F.labiodental,Ke=16,Th=70,Tt=40;function Ih(r,t,e){let s=35e3/96e3/.93,a=8.7*r*(.55+.45*t)-1.6*r,i=8.3*r-1*r;e[0]=Math.min(Tt,Math.max(8,Math.floor(a/s))),e[1]=Math.min(Tt,Math.max(8,Math.floor(i/s)))}var fa=class{ph=new Float64Array(Tt);or=new Float64Array(Tt);phMin=new Float64Array(Tt);orMin=new Float64Array(Tt);phLen=8.8;orLen=8.3;teeth=16;velum=0;lab=0;copy(t){this.ph.set(t.ph),this.or.set(t.or),this.phMin.set(t.phMin),this.orMin.set(t.orMin),this.phLen=t.phLen,this.orLen=t.orLen,this.teeth=t.teeth,this.velum=t.velum,this.lab=t.lab}},ua=class{geometry;prev=new fa;next=new fa;counts=new Int32Array(2);nPh=18;nOr=18;slew=new Ue;edge=new Float64Array(2*Tt+1);prof=new Float64Array(2*Tt);pmin=new Float64Array(2*Tt);sProf=new Float64Array(2*Tt);vProf=new Float64Array(2*Tt);sMin=new Float64Array(2*Tt);vMin=new Float64Array(2*Tt);lenIn=new Float64Array(3);sLen=new Float64Array(3);vLen=new Float64Array(3);sa=1;sb=0;sc=0;sd=1;snapped=!0;dvdt=new Float64Array(2*Tt);vol=new Float64Array(2*Tt);keyDt=.01;blockDt=0;lbMin=0;dx=0;u=0;constructor(t){this.dx=35e3/(2*t),this.lbMin=Ws(t),this.geometry=new pa({scale:1,pharynx:1,tongueRadius:2.25,lipWidth:4.6});let e=Math.max(8,Math.round(32*t/48e3))/t;this.blockDt=e,this.keyDt=Ke*e,this.slew.setStep(this.keyDt);let s=2*Math.PI*Th,a=Math.exp(-s*e);this.sa=(1+s*e)*a,this.sb=e*a,this.sc=-s*s*e*a,this.sd=(1-s*e)*a}setBody(t,e,s,a){this.geometry.setBody(t,e,s,a),Ih(t,e,this.counts),this.nPh=this.counts[0],this.nOr=this.counts[1],this.slew.setScale(t)}key(t,e){let s=this.geometry,a=this.prev,i=this.next;a.copy(i),s.evaluate(t);let n=this.nPh,o=this.nOr;s.resampleInto(i.ph,i.or,i.phMin,i.orMin,n,o),i.phLen=s.phLen,i.orLen=s.orLen,i.teeth=s.teethS,i.velum=s.velumPort;let l=t[Ch];if(i.lab=l<0?0:l>1?1:l,e)a.copy(i),this.snapped=!0;else{this.slew.limitAll(i.ph,a.ph,n),this.slew.limitAll(i.or,a.or,o),this.slew.limitAll(i.phMin,a.phMin,n),this.slew.limitAll(i.orMin,a.orMin,o);for(let h=0;h<n;h++)i.phMin[h]>i.ph[h]&&(i.phMin[h]=i.ph[h]);for(let h=0;h<o;h++)i.orMin[h]>i.or[h]&&(i.orMin[h]=i.or[h])}}toAirway(t){let e=this.u,s=1-e,a=this.prev,i=this.next,n=this.nPh,o=this.nOr,l=n+o,h=this.sa,m=this.sb,p=this.sc,v=this.sd,N=this.snapped,u=this.lenIn,k=this.sLen,g=this.vLen;u[0]=a.phLen*s+i.phLen*e,u[1]=a.orLen*s+i.orLen*e,u[2]=a.teeth*s+i.teeth*e;for(let A=0;A<3;A++)if(N)k[A]=u[A],g[A]=0;else{let K=k[A]-u[A],Y=g[A];k[A]=u[A]+h*K+m*Y,g[A]=p*K+v*Y}let S=k[0],d=k[1],x=this.edge,M=this.prof,f=this.pmin;x[0]=0;for(let A=0;A<n;A++)M[A]=a.ph[A]*s+i.ph[A]*e,f[A]=a.phMin[A]*s+i.phMin[A]*e,x[A+1]=(A+1)*S/n;for(let A=0;A<o;A++)M[n+A]=a.or[A]*s+i.or[A]*e,f[n+A]=a.orMin[A]*s+i.orMin[A]*e,x[n+A+1]=S+(A+1)*d/o;let b=this.sProf,E=this.vProf,O=this.sMin,H=this.vMin;if(N){for(let A=0;A<l;A++)b[A]=M[A],O[A]=f[A],E[A]=0,H[A]=0;this.snapped=!1}else for(let A=0;A<l;A++){let K=b[A]-M[A],Y=E[A];b[A]=M[A]+h*K+m*Y,E[A]=p*K+v*Y,K=O[A]-f[A],Y=H[A],O[A]=f[A]+h*K+m*Y,H[A]=p*K+v*Y}let I=1/this.blockDt,X=S/n,V=d/o,y=this.vol,L=this.dvdt;for(let A=0;A<l;A++){let K=b[A]>0?b[A]:0;M[A]=K;let Y=O[A]>0?O[A]:0;f[A]=Y<K?Y:K;let pt=K*(A<n?X:V);L[A]=N?0:-(pt-y[A])*I,y[A]=pt}let q=S+d,R=t.nG,_=q-R*this.dx;_<this.lbMin&&(_=this.lbMin);let G=(q-_)/R,D=0;{let A=0;for(;D<l&&x[D]<_;){let K=x[D],Y=x[D+1]<_?x[D+1]:_;if(Y>K&&(A+=(Y-K)/(M[D]>1e-6?M[D]:1e-6)),x[D+1]>_)break;D++}t.ductLen=_,t.ductArea=A>0?_/A:M[0]}let Z=t.gridIn,it=t.gridMin;for(let A=0;A<R;A++){let K=_+A*G,Y=K+G;for(;D<l-1&&x[D+1]<=K;)D++;let pt=0,At=1/0,st=D;for(;st<l&&x[st]<Y;){let ge=x[st]>K?x[st]:K,xe=x[st+1]<Y?x[st+1]:Y,Ot=M[st]>1e-6?M[st]:1e-6;xe>ge&&(pt+=(xe-ge)/Ot);let me=f[st]<Ot?f[st]:Ot;me<At&&(At=me),st++}let _t=pt>0?G/pt:M[l-1];Z[A]=_t,it[A]=At<_t?At:_t}let rt=k[2];t.teethX=(rt-_)/G,t.splitI=(S-_)/G,t.velum=a.velum*s+i.velum*e,t.labial=a.lab*s+i.lab*e;let et=t.vflow;for(let A=0;A<=R;A++)et[A]=0;for(let A=0;A<l;A++){let K=(.5*(x[A]+x[A+1])-_)/G;K=K<0?0:K>R?R:K;let Y=Math.floor(K);Y>=R&&(Y=R-1);let pt=K-Y;et[Y]+=(1-pt)*this.dvdt[A],et[Y+1]+=pt*this.dvdt[A]}}get length(){let t=this.u;return(this.prev.phLen+this.prev.orLen)*(1-t)+(this.next.phLen+this.next.orLen)*t}};var Fn={glide:.17,overshoot:.095,preparation:.25};function En(r){let t=r>0?r<.6?r:.6:0;if(!(t>1e-6))return 1;let e=Math.log(t);return-e/Math.sqrt(Math.PI*Math.PI+e*e)}function Pn(r){let t=z(r,.005,.5);return Se/(2*Math.PI*t)}var da=$s,Oh=1.5,qh=60,Dh=.25,Bh=1.5,zh=.25,Cn=[1.6,1.2,.9],Tn=[.03,.06,.06],_h=.01,In=[.03,0,0],On=[70/360,50/360,50/360],qn=[.3,.3,.3],Hh=.05,Vh=.04,Gh=.25,Uh=.06,jh=20,It=Ke/2,Dn=[4.6,4.4,4],Ni=Fn;function Xh(r,t){let e=r[t.name];return typeof e==\\\"number\\\"&&Number.isFinite(e)?e:t.default}function Bn(r,t){let e=35e3/(2*r);return Math.max(8,Math.floor((t-Ws(r))/e))}var mi=class{sr=0;air;drive;roofs;planner=new oa;bank;glide;env;vibRng;blk=0;stepEvery=0;keyEvery=0;envBuf;art=new Float64Array(U);tip=new Float64Array(2);rate=new Float64Array(U);abdAt=new Float64Array(It+1);cloAt=new Float64Array(It+1);stfAt=new Float64Array(It+1);lungAt=new Float64Array(It+1);beatOn=new Uint8Array(It+1);lungFactor=1;beatLine=0;setting={jawSet:0,tongueFront:0,tongueHigh:0,lipRound:0,lipOpen:0,larynxSet:0,nasal:0,twang:0,throat:0};setOff=new Float64Array(U);size=1;pharynxScale=1;placed=new Float64Array(2);at=0;phonemeParam=Ga;bendParam=0;body=0;tension=.55;breath=.15;vibInc=0;vibDepth=.3;vibDelay=.25;articulation=1;attack=.02;release=.15;level=1;ring=0;tuning=0;nextIn=0;live=!1;fresh=!1;released=!1;noteHz=220;vel=.8;pos=0;bi=0;intervalLeft=0;blockInInterval=0;end=1/0;pLungTarget=9;pLung=0;pCoupleHz=0;pEar=0;bLo=0;bW=0;k=1;vibPhase=0;bloomT=0;bloomFrom=0;bloomNow=0;tuneJaw=0;abduction=0;closure=0;stiffness=0;foldRest=.03;glottisModel=ps;f0Now=110;depth=0;laidK=-1;laidN=-1;laidJv=-1;laidGeoK=-1;laidPh=-1;laidTongue=-1;laidLips=-1;constructor(t,e,s){this.sr=t,this.roofs=Jt.map(a=>new ha(a)),this.air=new Xs(t,Bn(t,Jt[0].minLength*1.25),s),this.drive=new ua(t),this.blk=this.air.block,this.stepEvery=2*this.blk,this.keyEvery=Ke*this.blk,this.bank=new Ts(U,t/this.stepEvery),this.glide=new Os(t/this.blk),this.env=new Ps(t),this.vibRng=s.fork(\\\"vibrato\\\"),this.envBuf=new Float32Array(this.blk),this.bi=this.blk;for(let a of zn)this.setParam(a.name,Xh(e,a))}noteOn(t,e){this.noteHz=z(Number.isFinite(t)?t:220,jh,this.sr*.25),this.vel=z(Number.isFinite(e)?e:.8,0,1),this.live=!0,this.fresh=!0,this.released=!1,this.end=1/0,this.env.reset(),this.env.trigger(),this.vibPhase=this.vibRng(),this.bloomT=0,this.bloomFrom=0,this.bloomNow=0,this.start()}noteOff(){!this.live||this.released||(this.released=!0,this.env.release(),this.end=this.pos/this.sr,this.planner.setEnd(this.end))}get active(){return this.live}setParam(t,e){if(Number.isFinite(e))switch(t){case\\\"phoneme\\\":this.setPhoneme(e);return;case\\\"nextIn\\\":this.nextIn=z(e,0,1);return;case\\\"nextPhoneme\\\":this.setNext(e);return;case\\\"bend\\\":this.setBend(e);return;case\\\"glide\\\":this.glide.setSpeed(Pn(e));return;case\\\"overshoot\\\":this.glide.setDamping(En(z(e,0,.5)));return;case\\\"preparation\\\":this.glide.setPreparation(z(e,0,1));return;case\\\"body\\\":this.body=z(e,0,2),this.applyBody(),this.live&&this.fresh&&this.start();return;case\\\"tension\\\":this.tension=z(e,0,1),this.applyTension();return;case\\\"roughness\\\":this.air.glottis.setRoughness(z(e,0,1));return;case\\\"fry\\\":this.air.glottis.setFry(z(e,0,1));return;case\\\"drift\\\":this.air.glottis.setDrift(z(e,0,20));return;case\\\"glottis\\\":this.setGlottis(e);return;case\\\"breath\\\":this.breath=z(e,0,1);return;case\\\"vibratoRate\\\":this.vibInc=z(e,0,12)*this.blk/this.sr;return;case\\\"vibratoDepth\\\":this.vibDepth=z(e,0,2);return;case\\\"vibratoDelay\\\":this.vibDelay=z(e,0,1);return;case\\\"articulation\\\":this.articulation=z(e,.25,4);return;case\\\"attack\\\":this.attack=z(e,.001,1),this.env.set(this.attack,.05,1,this.release);return;case\\\"release\\\":this.release=z(e,.01,2),this.env.set(this.attack,.05,1,this.release);return;case\\\"level\\\":this.level=z(e,0,2);return;case\\\"ring\\\":this.ring=z(e,0,1);return;case\\\"mic\\\":this.air.mic=z(e,0,1);return;case\\\"cheeks\\\":this.air.cheeks=z(e,0,1);return;case\\\"piriform\\\":this.air.piriform=e>=.5?1:0;return;case\\\"size\\\":this.size=z(e,.8,1.25),this.applyBody();return;case\\\"pharynx\\\":this.pharynxScale=z(e,.8,1.25);return;case\\\"jawSet\\\":case\\\"tongueFront\\\":case\\\"tongueHigh\\\":case\\\"lipRound\\\":case\\\"lipOpen\\\":case\\\"larynxSet\\\":case\\\"throat\\\":this.setting[t]=z(e,-1,1),this.settings();return;case\\\"nasal\\\":case\\\"twang\\\":this.setting[t]=z(e,0,1),this.settings();return;case\\\"tuning\\\":this.tuning=z(e,0,1);return}}setGlottis(t){let e=z(Math.round(t),0,2);this.glottisModel=e===1?je:e===2?ps:Ys,this.live||(this.air.model=this.glottisModel),this.applyTension()}setPhoneme(t){let e=z(Math.round(t),0,da-1);this.phonemeParam=e,!(!this.live||this.released)&&(this.fresh?this.start():this.planner.addNow(e,this.pos/this.sr))}setNext(t){let e=z(Math.round(t),0,da-1);!this.live||this.released||(this.planner.addUpcoming(e,this.pos/this.sr+this.nextIn),this.fresh&&this.settle())}setBend(t){let e=z(t,-48,48);this.bendParam=e,!(!this.live||this.released)&&(this.fresh?this.glide.snap(e):e!==this.glide.target&&(this.glide.setTarget(e),this.bloomFrom=this.bloomNow,this.bloomT=0))}process(t,e,s,a){if(!this.live)return;let i=this.air,n=this.blk,o=s;for(;o<a;){this.bi===n&&(this.intervalLeft===0&&this.interval(),this.beginBlock(),this.bi=0);let l=n-this.bi,h=l<a-o?l:a-o,m=this.envBuf;this.env.fill(m,0,h),i.render(t,e,o,h,this.bi,m),this.bi+=h,this.pos+=h,this.intervalLeft-=h,o+=h}a>s&&(this.fresh=!1),this.env.active||(this.live=!1)}applyBody(){let t=this.body;this.bLo=Math.floor(t)<2?Math.floor(t):1,this.bW=t-this.bLo;let e=Jt[this.bLo],s=Jt[this.bLo+1],a=this.bW;this.k=(e.k*(1-a)+s.k*a)*this.size,this.planner.setBody(t);let i=this.bLo,n=this.air;n.foldLength=Cn[i]*(1-a)+Cn[i+1]*a,n.upperRest=In[i]*(1-a)+In[i+1]*a,n.lag=On[i]*(1-a)+On[i+1]*a,n.skew=qn[i]*(1-a)+qn[i+1]*a,n.doublePulse=Hh,this.foldRest=Tn[i]*(1-a)+Tn[i+1]*a,this.applyTension()}applyTension(){let t=z(this.tension+.35*(this.vel-.8),0,1);this.air.glottis.setTension(t);let e=this.air.model===je?_h:this.foldRest;this.air.restOffset=e+Vh*(.5-t)}start(){this.pos=0,this.bi=this.blk;let t=Jt[this.bLo],e=Jt[this.bLo+1],s=this.bW,a=this.k,i=this.pharynxScale,n=(t.pharynxScale*(1-s)+e.pharynxScale*s)*i,o=t.tongueRadius*(1-s)+e.tongueRadius*s,l=Dn[this.bLo]*(1-s)+Dn[this.bLo+1]*s,h=(t.minLength*(1-s)+e.minLength*s)*this.size*Math.min(1,.55+.45*i),m=(t.neutralPharynx*(1-s)+e.neutralPharynx*s)*this.size*i,p=this.air,v=Math.min(p.nMax,Bn(this.sr,h)),N=h-v*p.dx,u=z(Math.round((m-N)/p.dx),2,v-2);a!==this.laidK||v!==this.laidN||u!==this.laidJv?(p.configure(a,v,u),this.laidK=a,this.laidN=v,this.laidJv=u):p.reset(),(n!==this.laidPh||o!==this.laidTongue||l!==this.laidLips||a!==this.laidGeoK)&&(this.drive.setBody(a,n,o,l),this.laidGeoK=a,this.laidPh=n,this.laidTongue=o,this.laidLips=l),p.model=this.glottisModel,this.applyTension(),this.planner.clear(),this.planner.addNow(this.phonemeParam,0),this.glide.snap(this.bendParam),this.pLungTarget=z(4+6.25*this.vel,5,15),this.pLung=this.planner.silentAt(0)||this.planner.beatAt(0)?0:.94*this.pLungTarget,this.pCoupleHz=Bh*(this.noteHz/120),this.pEar=0,this.tuneJaw=0,this.settle()}settle(){let t=this.bank;for(let e=0;e<U;e++)t.snap(e,Qs[e]);this.at=this.pos/this.sr;for(let e=0;e<3;e++){this.targets();for(let s=0;s<U;s++)t.snap(s,this.planner.target[s]);this.contact();for(let s=0;s<U;s++)t.snap(s,t.values[s])}this.art.set(t.values),this.drive.key(this.art,!0),this.updateGlottis();for(let e=0;e<=It;e++)this.abdAt[e]=this.abduction,this.cloAt[e]=this.closure,this.stfAt[e]=this.stiffness,this.lungAt[e]=this.lungFactor,this.beatOn[e]=this.beatLine;this.intervalLeft=0,this.blockInInterval=0}targets(){An(this.bank.values,this.tip);let t=this.planner;t.at=this.at,t.restX=this.tip[0],t.restY=this.tip[1],t.evaluateNow();let e=t.target,s=this.ring,a=this.tuneJaw;e[F.epilarynx]+=s,e[F.larynx]-=.6*s,e[F.root]+=.4*s,e[F.jaw]+=a,e[F.tbY]-=a,e[F.lipAp]+=.5*a;let i=this.setOff,n=t.held;for(let o=0;o<U;o++)e[o]+=i[o]*(1-n[o]);for(let o=0;o<U;o++){let l=e[o];e[o]=l<li[o]?li[o]:l>oi[o]?oi[o]:l}}settings(){mn(this.setting,this.setOff)}updateGlottis(){let t=this.k*this.k,e=this.breath;this.abduction=(.1*e*e+.008+.03*e)*t+this.planner.abduction*t,this.closure=this.planner.closure,this.stiffness=this.planner.stiffness,this.lungFactor=this.planner.breath,this.beatLine=this.planner.beat}step(){this.targets();let t=this.bank,e=this.planner,s=this.articulation,a=this.rate;for(let i=0;i<U;i++)a[i]=kn[i]*e.speed[i]*s;t.setAll(e.target,a),t.step(),this.contact(),this.updateGlottis()}contact(){let t=this.bank;t.values[F.lipAp]<hi&&(this.placed[0]=hi,t.placeFrom(F.lipAp,this.placed,0));let e=this.roofs[this.bW<.5?this.bLo:this.bLo+1],a=-.1*e.k,i=this.art;i.set(t.values),e.bodyPoint(i),e.x=e.bx,e.y=e.by,e.project(),e.sd-e.r<a&&(this.depth=a-(e.sd-e.r),this.push(e,F.tbX,F.tbY)),i.set(t.values),e.tipPoint(i),e.x=e.tipX,e.y=e.tipY,e.project(),e.sd<a&&(this.depth=a-e.sd,this.push(e,F.ttX,F.ttY))}push(t,e,s){let a=t.sd,i=this.depth,n=t.x-t.qx,o=t.y-t.qy,l=Math.sqrt(n*n+o*o);if(!(l>1e-9))n=0,o=-1;else{let S=a>=0?1/l:-1/l;n*=S,o*=S}let h=this.bank,m=h.values,p=m[e],v=m[s],N=t.k,u=(p>.5?.86:1)*N,k=(v<7?t.pharynxScale:1)*N,g=this.placed;g[0]=p+n*i/u,g[1]=v+o*i/k,h.placeFrom(e,g,0),h.placeFrom(s,g,1)}interval(){let t=this.sr;this.abdAt[0]=this.abdAt[It],this.cloAt[0]=this.cloAt[It],this.stfAt[0]=this.stfAt[It],this.lungAt[0]=this.lungAt[It],this.beatOn[0]=this.beatOn[It];for(let e=1;e<=It;e++)this.at=(this.pos+e*this.stepEvery)/t,this.step(),this.abdAt[e]=this.abduction,this.cloAt[e]=this.closure,this.stfAt[e]=this.stiffness,this.lungAt[e]=this.lungFactor,this.beatOn[e]=this.beatLine;this.art.set(this.bank.values),this.drive.key(this.art,!1),this.planner.forget(this.pos/t),this.intervalLeft=this.keyEvery,this.blockInInterval=0}beginBlock(){let t=this.sr,e=this.blk,s=this.air;this.blockInInterval++;let a=this.blockInInterval,i=this.drive;i.u=a/Ke,i.toAirway(s);let n=a*It/Ke,o=Math.floor(n),l=o<It?o+1:It,h=n-o;s.agStatic=this.abdAt[o]+(this.abdAt[l]-this.abdAt[o])*h,s.closure=this.cloAt[o]+(this.cloAt[l]-this.cloAt[o])*h;let m=this.k*this.k;s.chink=(.008+.03*this.breath)*m;let p=this.stfAt[o]+(this.stfAt[l]-this.stfAt[o])*h;s.xRel=1-Dh*p;let v=this.lungAt[o]+(this.lungAt[l]-this.lungAt[o])*h,N=this.beatOn[o]|this.beatOn[l],u=(this.pos+e/2)/t,k=this.planner;k.at=u,k.queryNow(),this.glide.advance();let g=this.glide.value;this.bloomT+=e/t;let S=this.bloomT,d=.5-.5*Math.cos(Math.PI*Math.min(S/Math.max(this.vibDelay,1e-9),1)),x=this.bloomFrom*(.5+.5*Math.cos(Math.PI*Math.min(S/Uh,1)));this.bloomNow=d>x?d:x;let M=this.vibPhase+this.vibInc;M>=1&&(M-=1),this.vibPhase=M;let f=Math.sin(2*Math.PI*M)*this.vibDepth*this.bloomNow,b=this.noteHz*Math.pow(2,(g+f)/12+p*qh/1200);this.f0Now=b,this.tune();let E=s.pSupra;this.pEar+=(E-this.pEar)*(1-Math.exp(-e/t/zh)),s.model===je?s.f0=b:s.model===Ys?s.f0=b-this.pCoupleHz*Math.max(E-this.pEar,0)/he:s.f0=b+this.pCoupleHz*(Math.max(s.dpSmooth,0)-Math.max(s.pSubSmooth,0))/he;let O=u<this.end&&k.silent===0?1:0,H=N===1?.003:O?.025:.05;this.pLung+=(this.pLungTarget*O*v-this.pLung)*(1-Math.exp(-e/t/H)),s.pLung=this.pLung*he,s.gain=Gh*this.level*Math.min(this.vel/.2,1),s.beginBlock()}tune(){let t=this.f0Now;if(!(this.tuning>0)){this.tuneJaw=0;return}let e=this.planner.vowel;if(e<0){this.tuneJaw=0;return}let s=Jt[this.bLo],a=Jt[this.bLo+1],i=this.bW,n=s.tuneSlope[e]*(1-i)+a.tuneSlope[e]*i;if(n<20){this.tuneJaw=0;return}let o=s.tuneR1[e]*(1-i)+a.tuneR1[e]*i,l=s.tuneJaw[e]*(1-i)+a.tuneJaw[e]*i,h=(1.15*t-o)/n,m=2.6-l;this.tuneJaw=this.tuning*Math.min(Oh,m,h>0?h:0)}},zn=[{name:\\\"phoneme\\\",min:0,max:da-1,default:Ga},{name:\\\"bend\\\",min:-48,max:48,default:0,unit:\\\"st\\\"},{name:\\\"glide\\\",min:.005,max:.5,default:Ni.glide,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"body\\\",min:0,max:2,default:0},{name:\\\"tension\\\",min:0,max:1,default:.55},{name:\\\"roughness\\\",min:0,max:1,default:.02},{name:\\\"fry\\\",min:0,max:1,default:0},{name:\\\"drift\\\",min:0,max:20,default:6,unit:\\\"cents\\\"},{name:\\\"glottis\\\",min:0,max:2,default:2},{name:\\\"breath\\\",min:0,max:1,default:.15},{name:\\\"vibratoRate\\\",min:0,max:12,default:5.5,unit:\\\"Hz\\\"},{name:\\\"vibratoDepth\\\",min:0,max:2,default:.3,unit:\\\"st\\\"},{name:\\\"vibratoDelay\\\",min:0,max:1,default:.25,unit:\\\"s\\\"},{name:\\\"articulation\\\",min:.25,max:4,default:1,curve:\\\"exp\\\"},{name:\\\"attack\\\",min:.001,max:1,default:.02,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"release\\\",min:.01,max:2,default:.15,curve:\\\"exp\\\",unit:\\\"s\\\"},{name:\\\"level\\\",min:0,max:2,default:1},{name:\\\"overshoot\\\",min:0,max:.5,default:Ni.overshoot},{name:\\\"preparation\\\",min:0,max:1,default:Ni.preparation},{name:\\\"ring\\\",min:0,max:1,default:0},{name:\\\"mic\\\",min:0,max:1,default:0},{name:\\\"cheeks\\\",min:0,max:1,default:0},{name:\\\"piriform\\\",min:0,max:1,default:0},{name:\\\"size\\\",min:.8,max:1.25,default:1},{name:\\\"pharynx\\\",min:.8,max:1.25,default:1},{name:\\\"jawSet\\\",min:-1,max:1,default:0},{name:\\\"tongueFront\\\",min:-1,max:1,default:0},{name:\\\"tongueHigh\\\",min:-1,max:1,default:0},{name:\\\"lipRound\\\",min:-1,max:1,default:0},{name:\\\"lipOpen\\\",min:-1,max:1,default:0},{name:\\\"larynxSet\\\",min:-1,max:1,default:0},{name:\\\"nasal\\\",min:0,max:1,default:0},{name:\\\"twang\\\",min:0,max:1,default:0},{name:\\\"throat\\\",min:-1,max:1,default:0},{name:\\\"tuning\\\",min:0,max:1,default:0},{name:\\\"nextIn\\\",min:0,max:1,default:0,unit:\\\"s\\\"},{name:\\\"nextPhoneme\\\",min:0,max:da-1,default:0}],_n={id:\\\"vocal\\\",label:\\\"Vocal\\\",params:zn,polyphony:8,createVoice:(r,t,e)=>new mi(r,t,e)};var pi=globalThis.bellowsKernel;if(!pi||typeof pi.registerEngine!=\\\"function\\\")throw new Error(\\\"bellows-voice: the bellows kernel must load first. Use Bellows.boot({ plugins: [voice] }) or b.use(voice).\\\");pi.registerEngine(_n);})();\\n\";\n", "/* Generated by scripts/gen-plugin.mjs from src/engines/vocal.ts. Do not edit by hand. */\nimport type { EngineInfo } from 'bellowsjs';\n\n/** The vocal engine as listEngines() describes it, without its DSP. */\n// prettier-ignore\nexport const VOCAL_ENGINE_INFO: EngineInfo = {\n \"id\": \"vocal\",\n \"label\": \"Vocal\",\n \"params\": [\n {\n \"name\": \"phoneme\",\n \"min\": 0,\n \"max\": 81,\n \"default\": 1\n },\n {\n \"name\": \"bend\",\n \"min\": -48,\n \"max\": 48,\n \"default\": 0,\n \"unit\": \"st\"\n },\n {\n \"name\": \"glide\",\n \"min\": 0.005,\n \"max\": 0.5,\n \"default\": 0.17,\n \"curve\": \"exp\",\n \"unit\": \"s\"\n },\n {\n \"name\": \"body\",\n \"min\": 0,\n \"max\": 2,\n \"default\": 0\n },\n {\n \"name\": \"tension\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0.55\n },\n {\n \"name\": \"roughness\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0.02\n },\n {\n \"name\": \"fry\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"drift\",\n \"min\": 0,\n \"max\": 20,\n \"default\": 6,\n \"unit\": \"cents\"\n },\n {\n \"name\": \"glottis\",\n \"min\": 0,\n \"max\": 2,\n \"default\": 2\n },\n {\n \"name\": \"breath\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0.15\n },\n {\n \"name\": \"vibratoRate\",\n \"min\": 0,\n \"max\": 12,\n \"default\": 5.5,\n \"unit\": \"Hz\"\n },\n {\n \"name\": \"vibratoDepth\",\n \"min\": 0,\n \"max\": 2,\n \"default\": 0.3,\n \"unit\": \"st\"\n },\n {\n \"name\": \"vibratoDelay\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0.25,\n \"unit\": \"s\"\n },\n {\n \"name\": \"articulation\",\n \"min\": 0.25,\n \"max\": 4,\n \"default\": 1,\n \"curve\": \"exp\"\n },\n {\n \"name\": \"attack\",\n \"min\": 0.001,\n \"max\": 1,\n \"default\": 0.02,\n \"curve\": \"exp\",\n \"unit\": \"s\"\n },\n {\n \"name\": \"release\",\n \"min\": 0.01,\n \"max\": 2,\n \"default\": 0.15,\n \"curve\": \"exp\",\n \"unit\": \"s\"\n },\n {\n \"name\": \"level\",\n \"min\": 0,\n \"max\": 2,\n \"default\": 1\n },\n {\n \"name\": \"overshoot\",\n \"min\": 0,\n \"max\": 0.5,\n \"default\": 0.095\n },\n {\n \"name\": \"preparation\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0.25\n },\n {\n \"name\": \"ring\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"mic\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"cheeks\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"piriform\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"size\",\n \"min\": 0.8,\n \"max\": 1.25,\n \"default\": 1\n },\n {\n \"name\": \"pharynx\",\n \"min\": 0.8,\n \"max\": 1.25,\n \"default\": 1\n },\n {\n \"name\": \"jawSet\",\n \"min\": -1,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"tongueFront\",\n \"min\": -1,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"tongueHigh\",\n \"min\": -1,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"lipRound\",\n \"min\": -1,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"lipOpen\",\n \"min\": -1,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"larynxSet\",\n \"min\": -1,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"nasal\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"twang\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"throat\",\n \"min\": -1,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"tuning\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0\n },\n {\n \"name\": \"nextIn\",\n \"min\": 0,\n \"max\": 1,\n \"default\": 0,\n \"unit\": \"s\"\n },\n {\n \"name\": \"nextPhoneme\",\n \"min\": 0,\n \"max\": 81,\n \"default\": 0\n }\n ],\n \"polyphony\": 8\n};\n", "/*\n * The voice as a bellows plugin: the engine's worklet script and its description, plain data for\n * Bellows.boot({ plugins: [voice] }) or b.use(voice). Neither imports the engine's DSP, so a page\n * carries the voice once, inside the script, and only if it uses it.\n */\n\nimport type { BellowsPlugin } from 'bellowsjs';\nimport { workletCode } from './worklet-code.gen';\nimport { VOCAL_ENGINE_INFO } from './catalog.gen';\n\nexport { VOCAL_ENGINE_INFO };\n\nexport const voice: BellowsPlugin = {\n id: 'bellows-voice',\n worklet: workletCode,\n engines: [VOCAL_ENGINE_INFO],\n};\n", "/*\n * A singer: a bellows instrument on the 'vocal' engine, with sing() and speak(). Lyrics go through\n * the text layer (lyrics/), notes through bellows' tempo map and tuning (b.layNotes), the plan\n * through sungEvents (sing.ts), and the events into bellows through its host API\n * (b.postKernelEvents), so this module needs nothing from bellows that is not public.\n *\n * Moved from bellows' facade (Bellows.singEvents, speakEvents and Instrument.sing, speak at\n * bellowsjs 0.4.0) when the voice became its own package; what it posts is unchanged.\n */\n\nimport { EventKind, listEngines, type Bellows, type BusHandle, type FxInput, type Instrument, type KernelEvent, type NoteOptions, type NoteSpec, type NoteValue, type Scale, type TimeValue } from 'bellowsjs';\nimport type { PronouncingDictionary, SungPlan, Syllable } from './lyrics/types';\nimport { lyricsToSyllables } from './lyrics/read';\nimport { resolveAccent, type Accent } from './lyrics/accents';\nimport { speechPlan } from './lyrics/speech';\nimport { BEAT_LEAD_IN, beatLine, type BeatPattern, type BeatTiming } from './lyrics/beat';\nimport { SHAPE_PRESETS, VOICE_SETTINGS } from './engines/vocal-settings';\nimport { planSung, type PlanSungOptions } from './lyrics/sing';\nimport { sungEvents, type SungWindow } from './sing';\nimport { VOCAL_PLAN_LEAD, vocalGlideLead } from './engines/vocal-lead';\nimport { speechHzForBody, voicePreset, type VoicePreset } from './voices';\n\n/** One note of a sung line. `note: null` is a rest: it takes time and no syllable. */\nexport interface SingNote {\n note: NoteValue | null;\n /** Beats, notation ('8n', '3/8'), or { seconds }, through the tempo map. */\n dur: TimeValue | { seconds: number };\n /** Velocity 0..1, default 0.8. A phrase plays at its first note's. */\n vel?: number;\n}\n\nexport interface SingOptions {\n /**\n * Context time of the first note's beat, where its vowel lands. Left out, a live line starts as\n * soon as its opening consonants can all still sound, and a line in a clock callback replayed by\n * render() starts at the callback's tick.\n */\n at?: number;\n /** Pronouncing dictionary for this line, over the singer's. */\n dictionary?: PronouncingDictionary;\n /** Scale for { degree } notes, as note()'s third argument. Default C major. */\n scale?: Scale;\n /**\n * The accent's t and l rules on English words (General American: \"little\" sings l\u026A.\u027E\u0259\u026B), default\n * true. False keeps every /t d l/ as written, as classical diction does. IPA is sung as written\n * either way.\n */\n allophones?: boolean;\n /** Accent for this line, over the singer's: an id from ACCENTS ('southern-british', ...) or an Accent. */\n accent?: Accent | string;\n}\n\nexport interface SpeakOptions {\n /** Context time the first syllable's vowel lands. Left out, as soon as the opening consonants can sound. */\n at?: number;\n dictionary?: PronouncingDictionary;\n /** Accent, over the singer's. Its prosody sets the melody and rate. */\n accent?: Accent | string;\n /** Baseline pitch, Hz. Default the singer's speechHz: its preset's, or the norm for its body. */\n hz?: number;\n /** Rate over the accent's own, 1 normal. */\n rate?: number;\n /** The accent's t and l rules, default true. */\n allophones?: boolean;\n /** Breaths in: 'between' phrases (default), 'all' (before the first too), or 'none'. */\n breath?: 'between' | 'all' | 'none';\n}\n\n/**\n * What sing() planned and posted. `phrases` are the plan, each vowel on its beat. `leadIn` is the\n * longest any phrase starts before its own first beat, which can be more than the plan's own\n * lead-in: a phrase that opens on an aspirated p, t or k releases it early, so its vowel is voiced\n * on the beat. Live, call at least that far ahead of the first beat.\n */\nexport interface BeatboxOptions extends BeatTiming {\n /** Context time of the first step's hit. Left out, as soon as the line's lead-in can sound. */\n at?: number;\n /** A hum's pitch where its step names none: a note through the tuning, or { hz }. Default 0.75 of speechHz. */\n note?: NoteValue;\n /** Velocity 0..1: the breath behind every sound. Default 0.8. */\n vel?: number;\n}\n\nexport interface SingResult extends SungPlan {\n /** IPA the vocal engine has no phoneme for, each once; those spans keep the sound before them. */\n unknown: string[];\n /**\n * Seconds of the line left out because the instrument was still singing an earlier line there, or\n * had a later one posted already: the opening consonants that would have overlapped it, or whole\n * phrases. 0 when the instrument was free.\n */\n trimmed: number;\n}\n\nexport interface SingerOptions {\n /** Pronunciations: lowercase word to CMUdict ARPAbet, as parseCmudict() returns. None ships. */\n dictionary?: PronouncingDictionary | null;\n /** The accent lines are read in. Default 'general-american'. */\n accent?: Accent | string;\n /** Voices on the channel, as b.voice() takes it. */\n polyphony?: number;\n /** speak()'s default pitch, Hz, over the preset's and the body's norm. */\n speechHz?: number;\n}\n\n/**\n * A vocal channel's own phoneme and bend, which sung lines hand back when they end (undefined: the\n * engine's default), and the phrases sing() has posted on it, so the next line fits around them.\n */\ninterface SingState {\n restPhoneme?: number;\n restBend?: number;\n /** The channel's own glide settings, which set how early sung bends go out. */\n glide?: number;\n overshoot?: number;\n preparation?: number;\n windows: SungWindow[];\n}\n\nconst EMPTY: SingResult = { phrases: [], leadIn: 0, unknown: [], trimmed: 0 };\n\nexport class Singer {\n /** The bellows instrument underneath: notes, params, fx, sends and gain go through it. */\n readonly instrument: Instrument;\n /** Pronunciations for every line, over the letter-to-sound rules. */\n dictionary: PronouncingDictionary | null;\n /** The accent every line is read in, unless a line names its own. */\n accent: Accent | string;\n /** speak()'s default baseline pitch, Hz. */\n speechHz: number;\n /** The starter voice this singer was made from, if any. */\n readonly preset: VoicePreset | undefined;\n private readonly key: string;\n private readonly offParam: () => void;\n\n constructor(\n private readonly b: Bellows,\n voice: Record<string, number> | string | VoicePreset = {},\n opts: SingerOptions = {},\n ) {\n const preset = typeof voice === 'string' ? voicePreset(voice) : isPreset(voice) ? voice : undefined;\n if (typeof voice === 'string' && !preset) {\n throw new Error(`bellows-voice: no starter voice \"${voice}\"; see VOICE_PRESETS`);\n }\n const params: Record<string, number> = preset ? { ...preset.params } : { ...(voice as Record<string, number>) };\n this.preset = preset;\n if (!listEngines().some((e) => e.id === 'vocal')) {\n throw new Error(\n \"bellows-voice: this bellows instance has no 'vocal' engine. Load the voice first: \" +\n 'Bellows.boot({ plugins: [voice] }) or await b.use(voice). If it is loaded, the page has two ' +\n 'copies of bellowsjs (a bundler that pre-bundles bellows-voice with its own, or a CDN page ' +\n \"without an import map for 'bellowsjs'), and the voice cannot see the one that loaded it.\",\n );\n }\n this.instrument = b.voice('vocal', params, opts.polyphony !== undefined ? { polyphony: opts.polyphony } : undefined);\n this.dictionary = opts.dictionary ?? null;\n this.accent = opts.accent ?? 'general-american';\n this.speechHz = opts.speechHz ?? preset?.speechHz ?? speechHzForBody(params.body ?? 0);\n this.key = 'bellows-voice:' + this.instrument.channel;\n // what the engine itself does with a creation value that is not a number\n const own = (v: number | undefined) => (typeof v === 'number' && Number.isFinite(v) ? v : undefined);\n b.contextState<SingState>(this.key, {\n make: () => ({\n restPhoneme: own(params.phoneme),\n restBend: own(params.bend),\n glide: own(params.glide),\n overshoot: own(params.overshoot),\n preparation: own(params.preparation),\n windows: [],\n }),\n // a render starts from the channel's own values as they are now, and no lines\n fork: (live) => ({ ...live, windows: [] }),\n });\n this.offParam = b.onUntimedParam(this.instrument.channel, (name, value) => this.restOn(name, value));\n }\n\n /** The bellows channel this singer plays on. */\n get channel(): number {\n return this.instrument.channel;\n }\n\n /**\n * Sing a lyric on a melody. Notes are laid end to end from `at`, each `dur` through the tempo map\n * and each pitch through the tuning and `scale`. Each note's vowel lands on its beat; opening\n * consonants start before it. Lyrics are English (through the dictionary when set, letter-to-sound\n * rules otherwise) and IPA between slashes. A hyphen splits a word across notes, a free-standing\n * '-' or '~' holds the vowel onto the next note, and punctuation or a rest ends a phrase.\n *\n * One singer sings one line at a time, because `phoneme` and `bend` are channel parameters: give a\n * harmony its own singer. A line that would start while an earlier one is still singing starts\n * where that one ends, and `trimmed` says how much went.\n */\n sing(lyrics: string | readonly Syllable[], notes: readonly SingNote[], opts: SingOptions = {}): SingResult {\n if (this.instrument.disposed) return { ...EMPTY };\n return this.post(lyrics, notes, opts);\n }\n\n /**\n * Speak text in an accent: its vowels and consonants from the accent's rules, its rhythm\n * stress-timed and its melody from the accent's prosody, a statement falling (or, in Australian\n * and New Zealand English, rising) and a question rising.\n */\n speak(text: string, opts: SpeakOptions = {}): SingResult {\n if (this.instrument.disposed) return { ...EMPTY };\n const accent = resolveAccent(opts.accent ?? this.accent);\n const syllables: Syllable[] = [];\n const questions: boolean[] = [];\n // each sentence or clause is a phrase; its closing mark sets its tune\n for (const m of text.matchAll(/[^.!?;:,\\n]+[.!?;:,\\n]*/g)) {\n const part = lyricsToSyllables(m[0], {\n dictionary: opts.dictionary ?? this.dictionary ?? undefined,\n allophones: opts.allophones,\n accent,\n // running speech: weak function words\n reduce: true,\n });\n if (part.length === 0) continue;\n part[part.length - 1].phraseEnd = true;\n syllables.push(...part);\n questions.push(m[0].includes('?'));\n }\n const plan = speechPlan(syllables, { hz: opts.hz ?? this.speechHz, rate: opts.rate, prosody: accent.prosody, breath: opts.breath }, questions);\n const notes: SingNote[] = plan.notes.map((n) =>\n n.rest ? { note: null, dur: { seconds: n.dur } } : { note: { hz: n.hz }, dur: { seconds: n.dur } },\n );\n // spoken consonants at their full spoken length, where sung ones are shortened (durations.ts)\n return this.post(plan.syllables, notes, { at: opts.at }, { consonantScale: 1 });\n }\n\n /**\n * Beatbox a pattern ('B . t . | Pf . t .', see parseBeat and BEAT_PRESETS): each sound made on the\n * voice's own tract with a beatboxer's airstream (an ejective kick, an inward snare, clicks, a hummed\n * bass). One throat, so a pattern is monophonic, and the whole of it is one breath group.\n */\n beatbox(pattern: BeatPattern | string, opts: BeatboxOptions = {}): SingResult {\n const line = beatLine(pattern, opts);\n const humDefault: NoteValue = opts.note ?? { hz: 0.75 * this.speechHz };\n let pitch: NoteValue = humDefault;\n const notes: SingNote[] = line.steps.map((step, i) => {\n if (step !== null && step.id === 'm') pitch = step.note ?? humDefault;\n return { note: pitch, dur: { seconds: line.durs[i] }, vel: opts.vel };\n });\n const at = opts.at === undefined ? undefined : opts.at - BEAT_LEAD_IN;\n return this.post(line.syllables, notes, { at });\n }\n\n /**\n * Shape the mouth: voice settings and anatomy (VOICE_SETTINGS: jawSet, lipRound, larynxSet, nasal,\n * twang, throat, cheeks, size, pharynx, ...) as values, or a SHAPE_PRESETS id ('smile', 'operatic',\n * 'giant'). Settings left out go back to neutral. Size and pharynx take effect from the next line.\n */\n shape(values: Record<string, number> | string): this {\n const v = typeof values === 'string' ? SHAPE_PRESETS.find((p) => p.id === values)?.values : values;\n if (!v) throw new Error(`bellows-voice: no mouth shape '${String(values)}' (see SHAPE_PRESETS)`);\n for (const s of VOICE_SETTINGS) {\n const x = v[s.param];\n this.param(s.param, typeof x === 'number' && Number.isFinite(x) ? x : (s.neutral ?? 0));\n }\n return this;\n }\n\n /** Play a note on the voice's own phoneme (an \"ah\" unless `phoneme` is set), as the instrument's note() does. */\n note(note: NoteValue, opts: NoteOptions = {}): this {\n this.instrument.note(note, opts);\n return this;\n }\n\n /** Set an engine parameter, as the instrument's param() does. */\n param(name: string, value: number, at?: number): this {\n this.instrument.param(name, value, at);\n return this;\n }\n\n /** Sustain a note on the voice's own phoneme; returns an id for off(). */\n on(note: NoteValue, vel = 0.8, at?: number): number {\n return this.instrument.on(note, vel, at);\n }\n\n off(noteId: number, at?: number): this {\n this.instrument.off(noteId, at);\n return this;\n }\n\n /** Insert effects on the voice's channel, as the instrument's fx() does. */\n fx(...fx: FxInput[]): this {\n this.instrument.fx(...fx);\n return this;\n }\n\n /** Send the voice to a bus. */\n send(bus: BusHandle, level: number): this {\n this.instrument.send(bus, level);\n return this;\n }\n\n gain(value: number): this {\n this.instrument.gain(value);\n return this;\n }\n\n pan(value: number): this {\n this.instrument.pan(value);\n return this;\n }\n\n /** Release the channel. */\n dispose(opts: { releaseSeconds?: number } = {}): void {\n this.offParam();\n this.instrument.dispose(opts);\n }\n\n private state(): SingState {\n return this.b.contextState<SingState>(this.key, { make: () => ({ windows: [] }) })!;\n }\n\n private post(\n lyrics: string | readonly Syllable[],\n notes: readonly SingNote[],\n opts: SingOptions,\n planOpts: PlanSungOptions = {},\n ): SingResult {\n const b = this.b;\n const channel = this.instrument.channel;\n const syllables =\n typeof lyrics === 'string'\n ? lyricsToSyllables(lyrics, {\n dictionary: opts.dictionary ?? this.dictionary ?? undefined,\n allophones: opts.allophones,\n accent: opts.accent ?? this.accent,\n })\n : lyrics;\n const state = this.state();\n const rendering = b.rendering;\n const now = b.now();\n // live, a phrase that has ended can no longer meet a new one: its events are spent\n if (!rendering) state.windows = state.windows.filter((w) => w.end >= now);\n const plan1 = (at: number) => {\n const plan = planSung(b.layNotes(notes as readonly NoteSpec[], at, opts.scale), syllables, planOpts);\n const posted = sungEvents(plan, {\n channel,\n phonemeParam: b.paramIndex('phoneme'),\n bendParam: b.paramIndex('bend'),\n nextPhonemeParam: b.paramIndex('nextPhoneme'),\n nextInParam: b.paramIndex('nextIn'),\n planLead: VOCAL_PLAN_LEAD,\n bendLead: vocalGlideLead(state.glide, state.overshoot, state.preparation),\n firstNoteId: b.reserveNoteIds(0),\n restPhoneme: state.restPhoneme,\n restBend: state.restBend,\n busy: state.windows,\n // a stop released before the render starts, or before now, never sounds\n notBefore: rendering ? 0 : now,\n });\n return { plan, posted };\n };\n let { plan, posted } = plan1(opts.at ?? (rendering ? now : now + 0.005));\n // live with no `at`, the first beat goes after the opening consonants, as soon as they can all\n // still sound, instead of losing them to the past\n if (opts.at === undefined && !rendering && posted.leadIn > 0) ({ plan, posted } = plan1(now + 0.005 + posted.leadIn));\n b.reserveNoteIds(plan.phrases.length);\n b.postKernelEvents(posted.events);\n state.windows = state.windows.concat(posted.windows).sort((a, c) => a.start - c.start);\n return { phrases: plan.phrases, leadIn: posted.leadIn, unknown: posted.unknown, trimmed: posted.trimmed };\n }\n\n /**\n * An untimed phoneme or bend becomes the channel's own, which sung lines hand back when they end.\n * A line already posted would still hand back the old value at its end, so the new one is posted\n * there too, after that line's resets, unless another line opens at that moment and owns the\n * channel.\n */\n private restOn(name: string, value: number): void {\n if (!Number.isFinite(value)) return;\n const state = this.b.contextState<SingState>(this.key);\n if (!state) return;\n if (name === 'glide' || name === 'overshoot' || name === 'preparation') {\n state[name] = value;\n return;\n }\n if (name !== 'phoneme' && name !== 'bend') return;\n if (name === 'phoneme') state.restPhoneme = value;\n else state.restBend = value;\n const now = this.b.now();\n const idx = this.b.paramIndex(name);\n const fixes: KernelEvent[] = [];\n for (const w of state.windows) {\n if (!w.resets || w.end < now) continue;\n if (state.windows.some((o) => o.start === w.end)) continue;\n fixes.push({ time: w.end, kind: EventKind.Param, target: this.instrument.channel, a: idx, b: value, c: 0 });\n }\n if (fixes.length > 0) this.b.postKernelEvents(fixes);\n }\n}\n\n/**\n * A singer on bellows instance `b`: b.voice('vocal', ...) with sing() and speak(). `voice` is the\n * engine's params, or a starter voice by id ('soprano', 'narrator-female'; see VOICE_PRESETS) or\n * as the preset itself.\n */\nexport function singer(b: Bellows, voice: Record<string, number> | string | VoicePreset = {}, opts: SingerOptions = {}): Singer {\n return new Singer(b, voice, opts);\n}\n\nfunction isPreset(v: unknown): v is VoicePreset {\n return typeof v === 'object' && v !== null && 'params' in v && 'speechHz' in v && 'group' in v;\n}\n", "/*\n * A sung plan as kernel events: how a lyric reaches the vocal engine.\n *\n * planSung (lyrics/sing.ts) times phonemes in seconds and pitches in Hz\n * and knows nothing about engines. The vocal engine (engines/vocal.ts)\n * knows a phoneme only as an index on its `phoneme` parameter, and a pitch\n * inside a note only as `bend` in semitones. This file is the join. One\n * phrase becomes one note with ordinary Param events inside it, so nothing\n * in the kernel knows a phoneme exists, and realtime playback, offline\n * rendering and b.render() replays all sing the same way (docs/VOICE.md,\n * \"The design as built\").\n *\n * Each phrase, in this order:\n *\n * bend 0 at start\n * phoneme at start, the first span\n * NoteOn at start, with the phrase's first Hz and its velocity\n * phoneme at each later span start where the sound changes\n * bend at each later pitch time (less bendLead), 12 log2(hz / first Hz)\n * nextIn, nextPhoneme planLead before each later sound (see below)\n * NoteOff at end\n * bend and phoneme at end, back to the channel's own (restBend, restPhoneme)\n *\n * The Params at `start` go before the NoteOn at the same time. The kernel\n * keeps insertion order for equal times (kernel/engine.ts, pushEvent), and\n * the voice snaps every tracked value at note-on, so the phrase opens on\n * its own sound and pitch instead of gliding in from the channel's last\n * ones. The vocal engine also snaps a phoneme or bend that arrives after\n * its note-on but before it renders, so for that engine the order is a\n * second guarantee rather than the only one.\n *\n * While a phrase sings, `bend` belongs to it: 0 on its first note, so a\n * channel's own bend does not transpose a sung line, whose pitches already\n * came through the caller's tuning exactly. The resets at `end` go after\n * the NoteOff at the same time. A released vocal voice ignores phoneme and\n * bend (the pool sends every Param to every voice, and a tail must not be\n * reshaped by what follows), so they do not touch the phrase's tail. They\n * put back the phoneme and bend the channel had of its own, which the\n * caller passes in, so a plain note() after a sung line sings what it sang\n * before the line, at its own pitch, not the line's last consonant a fifth\n * away.\n *\n * ONE PHRASE AT A TIME ON A CHANNEL\n *\n * Because phoneme and bend are channel parameters, two phrases that\n * overlap on one channel reshape each other: the later one's opening\n * consonants reach the earlier one's live voice, and the earlier one's\n * resets land on the later one. planSung keeps the phrases of one plan\n * apart; `busy` carries the phrases earlier calls posted. A phrase that\n * would start inside one starts where it ends instead, dropping or\n * shortening its opening sounds; a phrase that would run into a later one\n * already posted ends where that one starts, and posts no resets there,\n * since they would land after the later phrase's opening events at the\n * same time. What is left out is counted in `trimmed`. The earlier phrase\n * wins because its events are already in the kernel and cannot be taken\n * back.\n *\n * EARLY RELEASES\n *\n * The vocal engine releases a stop when the next sound's phoneme arrives,\n * and after an aspirated release (p t k, not after /s/) voicing waits for\n * the glottis to close again; the formant voice held it off for the stop's\n * VOT, 58 to 80 ms, and the rule below was set for that. Posted at the vowel's own beat, the\n * vowel then started 70 to 91 ms late (MEASURED, 110 Hz). So the release\n * goes out early by lead = VOT + VOICING_LAG, the time from the release to\n * the voicing's half level: the stop starts `lead` before its span (but\n * not before the middle of the sound ahead of it, which keeps half its\n * time) and the vowel at its beat minus `lead` (but at least MIN_CLOSURE\n * after the stop starts). A phrase that opens on such a stop moves its\n * NoteOn back with it, and `leadIn` counts that. Measured on the posted\n * events, the vowel after /p t k/ moved from 70, 81, 91 ms after its beat\n * to 2, 4, 5. The plan's spans keep their times, vowel on the beat;\n * only the events that sing them move. At sixteenths the VOT outlasts a\n * short vowel whatever the release time; that needs a shorter VOT, which\n * nothing here can ask the engine for.\n *\n * SOUNDS AHEAD AND EARLY BENDS\n *\n * The articulatory vocal engine plans like a singer: a stop closes 22 to\n * 31 ms before its own time, a nasal lowers the velum 20 ms early, the next\n * vowel ramps in through the consonants before it, and a closure releases\n * before the sound after it. So with `planLead` each sound after a phrase's\n * first is also announced that far ahead (but not before the NoteOn, after\n * which the announcements at the NoteOn's time go): `nextIn`, the seconds\n * until it starts, then `nextPhoneme`, the sound. Its `phoneme` event still\n * goes at its own time and confirms it. With `bendLead` each bend goes out\n * that much early (not before the NoteOn), the time the engine's glide\n * takes to be half way, so its preparation lands before the note and its\n * overshoot after. Both default to 0, the old events exactly; the facade\n * passes VOCAL_PLAN_LEAD and vocalGlideLead() of the channel's glide,\n * overshoot and preparation.\n *\n * bend is a unit conversion, not a tuning. The Hz came through the\n * caller's tuning layer, and 12 log2 of a frequency ratio is that ratio in\n * semitones whatever divided the octave; test/integration/sing.test.ts\n * checks that a 19-EDO line comes back from its bends to 1e-12 of each\n * note's Hz. The engine's bend spans 48 semitones either way, four octaves\n * from the phrase's first note, and clamps beyond that.\n *\n * A span whose IPA the engine has no phoneme for (vocalPhonemeIndex gives\n * -1: typed IPA can ask for \u00E7 or \u028D) keeps the sound before it, which at a\n * phrase's start is the silence of the breath before it. That invents no\n * sound and keeps every later span on its time. The symbols are reported,\n * once each, rather than thrown, so one exotic letter does not cost a\n * caller the whole line.\n *\n * A planner, run off the audio thread; it allocates.\n */\n\nimport type { KernelEvent } from 'bellowsjs';\nimport { EventKind } from 'bellowsjs';\nimport type { SungPhrase, SungPlan } from './lyrics/types';\nimport {\n VOCAL_ACOUSTICS,\n VOCAL_DEFAULT_PHONEME,\n vocalPhonemeIndex,\n vocalReleaseAspirated,\n vocalReleaseVot,\n} from './engines/vocal-phonemes';\nimport { BEAT_PREFIX, beatTokenIndex, vocalIsBeat } from './engines/vocal-beats';\n\n/** The silence a phrase opens from, '_' in VOCAL_PHONEMES. */\nconst SILENCE = vocalPhonemeIndex('_');\n\n/**\n * Seconds from the end of a VOT to the voicing's half level in the vocal\n * engine at articulation 1: its VOICING_TIME is 30 ms to 98 percent, and a\n * critically damped step is half way at 0.29 of that, 8.6 ms; release to\n * half voicing measured 79, 65 and 88 ms after /t p k/ for VOTs of 70, 58\n * and 80.\n */\nconst VOICING_LAG = 0.01;\n/** The shortest closure an early release leaves a stop, in seconds. */\nconst MIN_CLOSURE = 0.02;\n\n/** One phrase as posted on a channel: from its first event to its NoteOff. */\nexport interface SungWindow {\n start: number;\n end: number;\n /** Whether the phrase put the channel's own phoneme and bend back at `end`. */\n resets: boolean;\n}\n\nexport interface SungEventOptions {\n /** Kernel channel the vocal instrument plays on. */\n channel: number;\n /** Interned index of the engine's `phoneme` parameter: internParam('phoneme'). */\n phonemeParam: number;\n /** Interned index of `bend`: internParam('bend'). */\n bendParam: number;\n /**\n * Interned indices of `nextPhoneme` and `nextIn`. With planLead > 0, each\n * sound after a phrase's first is also posted planLead early (but not\n * before the phrase's NoteOn) as nextIn, the seconds until it starts,\n * then nextPhoneme, the sound: the engine's planner then starts the\n * gestures that lead a sound before it (engines/vocal-planner.ts).\n */\n nextPhonemeParam?: number;\n nextInParam?: number;\n /** Seconds each sound is announced ahead. Default 0, none. */\n planLead?: number;\n /**\n * Seconds each bend goes out early (but not before the NoteOn), so the\n * engine's pitch glide, with its preparation and overshoot, is half way\n * on the note: vocalGlideLead() of the channel's settings. Default 0.\n */\n bendLead?: number;\n /** Note id of the first phrase; phrase k plays as firstNoteId + k. Default 1. */\n firstNoteId?: number;\n /** The phoneme index the channel returns to after each phrase, its own. Default VOCAL_DEFAULT_PHONEME. */\n restPhoneme?: number;\n /** The bend the channel returns to after each phrase, its own. Default 0. */\n restBend?: number;\n /** Phrases earlier calls posted on this channel, in time order. New phrases fit between them. */\n busy?: readonly SungWindow[];\n /**\n * The earliest time an early release may move a stop to: 0 in an offline\n * render, the context's time live. A stop moved before it would never sound.\n */\n notBefore?: number;\n}\n\nexport interface SungEvents {\n /** In time order, ready for a kernel `events` message. */\n events: KernelEvent[];\n /** IPA the engine has no phoneme for, each once, in order of first use. */\n unknown: string[];\n /** Each phrase as posted, in time order: what the caller adds to `busy` for the next call. */\n windows: SungWindow[];\n /** The longest time a posted phrase starts before its first note's beat, early releases included. */\n leadIn: number;\n /** Seconds of the plan left out where phrases would have overlapped `busy` or each other. */\n trimmed: number;\n}\n\n/**\n * The kernel events that sing a plan on one channel running the vocal\n * engine: one note per phrase, with `phoneme` and `bend` Param events\n * inside it. Never throws on a plan planSung produced; an unknown IPA\n * symbol keeps the sound before it and is listed in `unknown`.\n */\nexport function sungEvents(plan: SungPlan, opts: SungEventOptions): SungEvents {\n const result: SungEvents = { events: [], unknown: [], windows: [], leadIn: 0, trimmed: 0 };\n const busy = (opts.busy ?? []).slice().sort((a, b) => a.start - b.start);\n const first = opts.firstNoteId ?? 1;\n plan.phrases.forEach((phrase, k) => phraseEvents(phrase, first + k, opts, busy, result));\n return result;\n}\n\nfunction isVowel(idx: number): boolean {\n // a beat (engines/vocal-beats.ts) sits past the phoneme table\n return VOCAL_ACOUSTICS[idx]?.cls === 'vowel';\n}\n\nfunction phraseEvents(phrase: SungPhrase, noteId: number, opts: SungEventOptions, busy: SungWindow[], result: SungEvents): void {\n /* planSung never makes these; a plan built by hand might. */\n if (phrase.spans.length === 0 || phrase.pitches.length === 0) return;\n if (!validHz(phrase.pitches[0].hz)) return;\n\n const ch = opts.channel;\n const param = (time: number, index: number, value: number): KernelEvent => ({\n time,\n kind: EventKind.Param,\n target: ch,\n a: index,\n b: value,\n c: 0,\n });\n const unknown = result.unknown;\n const lookup = (ipa: string): number => {\n const idx = ipa.startsWith(BEAT_PREFIX) ? beatTokenIndex(ipa) : vocalPhonemeIndex(ipa);\n if (idx < 0 && !unknown.includes(ipa)) unknown.push(ipa);\n return idx;\n };\n\n /* The sound at each span start where it changes. */\n const times: number[] = [];\n const sounds: number[] = [];\n let sound = SILENCE;\n phrase.spans.forEach((span, s) => {\n const idx = lookup(span.ipa);\n if (s === 0) sound = idx < 0 ? SILENCE : idx;\n // a beat strikes again on its own; a phoneme that repeats is the same sound held\n else if (idx < 0 || (idx === sound && !vocalIsBeat(idx))) return;\n else sound = idx;\n times.push(s === 0 ? phrase.start : span.start);\n sounds.push(sound);\n });\n\n /* Aspirated releases go out early, so the vowel's voicing lands on its beat. */\n for (let k = 0; k + 1 < sounds.length; k++) {\n const next = sounds[k + 1];\n // the engine sees the sound before the note's first one as none\n const prev = k > 0 ? sounds[k - 1] : -1;\n if (!isVowel(next) || !vocalReleaseAspirated(sounds[k], prev)) continue;\n const lead = vocalReleaseVot(sounds[k], prev, next) + VOICING_LAG;\n // never back past the middle of the sound before, a phrase already\n // posted on the channel (fitting would cut the stop away), or now\n const floor = k > 0 ? (times[k - 1] + times[k]) / 2 : Math.min(times[0], openingFloor(busy, times[0], opts.notBefore));\n const stop = Math.max(times[k] - lead, floor);\n const beat = times[k + 1];\n times[k] = stop;\n times[k + 1] = Math.min(beat, Math.max(stop + MIN_CLOSURE, beat - lead));\n }\n\n /* Fit the phrase between the ones already posted on the channel. */\n const start0 = times[0];\n const end0 = phrase.end;\n let start = start0;\n for (const w of busy) if (w.start <= start && w.end > start) start = w.end;\n let end = end0;\n let meets = false;\n for (const w of busy) {\n if (w.start >= start && w.start <= end) {\n end = w.start;\n meets = true;\n break;\n }\n }\n if (!(end > start)) {\n result.trimmed += end0 - start0;\n return;\n }\n result.trimmed += start - start0 + (end0 - end);\n\n /* What is sounding, and at what pitch, where the fitted phrase opens. */\n let open = 0;\n while (open + 1 < times.length && times[open + 1] <= start) open++;\n let p0 = 0;\n while (p0 + 1 < phrase.pitches.length && phrase.pitches[p0 + 1].time <= start) p0++;\n let openHz = phrase.pitches[p0].hz;\n if (!validHz(openHz)) openHz = phrase.pitches[0].hz;\n\n /* Inside the note: [time, rank, event], merged by time and, at a tie, by rank, then posting order. */\n const inner: Array<[number, number, KernelEvent]> = [];\n for (let k = open + 1; k < times.length; k++) if (times[k] < end) inner.push([times[k], 0, param(times[k], opts.phonemeParam, sounds[k])]);\n const lead = opts.bendLead !== undefined && opts.bendLead > 0 ? opts.bendLead : 0;\n let bend = 0;\n for (let p = p0 + 1; p < phrase.pitches.length; p++) {\n const t = phrase.pitches[p].time;\n if (t >= end) break;\n const st = 12 * Math.log2(phrase.pitches[p].hz / openHz);\n if (st === bend || !Number.isFinite(st)) continue;\n bend = st;\n // the first change waits at least half its note: posted at the NoteOn it reached a fresh voice, which\n // snaps, and a short opening note under a long glide was sung at the second note's pitch (MEASURED:\n // 100 ms at 220 Hz then 330 Hz with glide 0.5 sang 330 throughout)\n const floor = p === p0 + 1 ? phrase.pitches[p0].time + 0.5 * (t - phrase.pitches[p0].time) : start;\n const at = Math.max(start, floor, t - lead);\n inner.push([at, 1, param(at, opts.bendParam, st)]);\n }\n const ahead = opts.planLead !== undefined && opts.planLead > 0 ? opts.planLead : 0;\n if (ahead > 0 && opts.nextPhonemeParam !== undefined && opts.nextInParam !== undefined) {\n for (let k = open + 1; k < times.length; k++) {\n if (!(times[k] < end)) continue;\n const at = Math.max(start, times[k] - ahead);\n inner.push([at, 2, param(at, opts.nextInParam, times[k] - at)]);\n inner.push([at, 2, param(at, opts.nextPhonemeParam, sounds[k])]);\n }\n }\n const order = inner.map((_, i) => i);\n order.sort((a, b) => inner[a][0] - inner[b][0] || inner[a][1] - inner[b][1] || a - b);\n\n const out = result.events;\n out.push(param(start, opts.bendParam, 0));\n out.push(param(start, opts.phonemeParam, sounds[open]));\n out.push({ time: start, kind: EventKind.NoteOn, target: ch, a: noteId, b: openHz, c: phrase.vel });\n /* At a tie the phoneme goes first, then the bend, then what is announced ahead. */\n for (const i of order) out.push(inner[i][2]);\n /* Meeting a later phrase, the NoteOff sorts ahead of that phrase's opening\n events at the same time, or this voice would take its sound before it\n releases; a nanosecond is inside the same frame at any sample rate. */\n out.push({ time: meets ? end - 1e-9 : end, kind: EventKind.NoteOff, target: ch, a: noteId, b: 0, c: 0 });\n if (!meets) {\n out.push(param(end, opts.bendParam, opts.restBend ?? 0));\n out.push(param(end, opts.phonemeParam, opts.restPhoneme ?? VOCAL_DEFAULT_PHONEME));\n }\n\n const window: SungWindow = { start, end, resets: !meets };\n result.windows.push(window);\n let at = busy.length;\n while (at > 0 && busy[at - 1].start > start) at--;\n busy.splice(at, 0, window);\n\n const firstVowel = phrase.spans.find((s) => s.kind === 'nucleus');\n const beat = firstVowel ? firstVowel.start : phrase.start;\n if (beat - start > result.leadIn) result.leadIn = beat - start;\n}\n\n/** The latest end of a posted phrase at or before `t`, or `notBefore`, whichever is later. */\nfunction openingFloor(busy: readonly SungWindow[], t: number, notBefore = -Infinity): number {\n let floor = notBefore;\n for (const w of busy) if (w.start <= t && w.end > floor) floor = w.end;\n return floor;\n}\n\nfunction validHz(hz: number): boolean {\n return hz > 0 && Number.isFinite(hz);\n}\n"],
|
|
5
|
+
"mappings": ";stBAEO,IAAMA,GAAsB,894JCG5B,IAAMC,EAAgC,CAC3C,GAAM,QACN,MAAS,QACT,OAAU,CACR,CACE,KAAQ,UACR,IAAO,EACP,IAAO,GACP,QAAW,CACb,EACA,CACE,KAAQ,OACR,IAAO,IACP,IAAO,GACP,QAAW,EACX,KAAQ,IACV,EACA,CACE,KAAQ,QACR,IAAO,KACP,IAAO,GACP,QAAW,IACX,MAAS,MACT,KAAQ,GACV,EACA,CACE,KAAQ,OACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,UACR,IAAO,EACP,IAAO,EACP,QAAW,GACb,EACA,CACE,KAAQ,YACR,IAAO,EACP,IAAO,EACP,QAAW,GACb,EACA,CACE,KAAQ,MACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,QACR,IAAO,EACP,IAAO,GACP,QAAW,EACX,KAAQ,OACV,EACA,CACE,KAAQ,UACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,SACR,IAAO,EACP,IAAO,EACP,QAAW,GACb,EACA,CACE,KAAQ,cACR,IAAO,EACP,IAAO,GACP,QAAW,IACX,KAAQ,IACV,EACA,CACE,KAAQ,eACR,IAAO,EACP,IAAO,EACP,QAAW,GACX,KAAQ,IACV,EACA,CACE,KAAQ,eACR,IAAO,EACP,IAAO,EACP,QAAW,IACX,KAAQ,GACV,EACA,CACE,KAAQ,eACR,IAAO,IACP,IAAO,EACP,QAAW,EACX,MAAS,KACX,EACA,CACE,KAAQ,SACR,IAAO,KACP,IAAO,EACP,QAAW,IACX,MAAS,MACT,KAAQ,GACV,EACA,CACE,KAAQ,UACR,IAAO,IACP,IAAO,EACP,QAAW,IACX,MAAS,MACT,KAAQ,GACV,EACA,CACE,KAAQ,QACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,YACR,IAAO,EACP,IAAO,GACP,QAAW,IACb,EACA,CACE,KAAQ,cACR,IAAO,EACP,IAAO,EACP,QAAW,GACb,EACA,CACE,KAAQ,OACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,MACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,SACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,WACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,OACR,IAAO,GACP,IAAO,KACP,QAAW,CACb,EACA,CACE,KAAQ,UACR,IAAO,GACP,IAAO,KACP,QAAW,CACb,EACA,CACE,KAAQ,SACR,IAAO,GACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,cACR,IAAO,GACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,aACR,IAAO,GACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,WACR,IAAO,GACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,UACR,IAAO,GACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,YACR,IAAO,GACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,QACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,QACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,SACR,IAAO,GACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,SACR,IAAO,EACP,IAAO,EACP,QAAW,CACb,EACA,CACE,KAAQ,SACR,IAAO,EACP,IAAO,EACP,QAAW,EACX,KAAQ,GACV,EACA,CACE,KAAQ,cACR,IAAO,EACP,IAAO,GACP,QAAW,CACb,CACF,EACA,UAAa,CAC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,EAAM,KAAK,EAAE,IAAI,EACjBU,EAAM,KAAK,EAAE,WAAWlD,CAAI,EAC5BmD,EAAuB,CAAC,EAC9B,QAAWV,KAAKH,EAAM,QAChB,CAACG,EAAE,QAAUA,EAAE,IAAMD,GACrBF,EAAM,QAAQ,KAAMc,GAAMA,EAAE,QAAUX,EAAE,GAAG,GAC/CU,EAAM,KAAK,CAAE,KAAMV,EAAE,IAAK,KAAMY,GAAU,MAAO,OAAQ,KAAK,WAAW,QAAS,EAAGH,EAAK,EAAGjD,EAAO,EAAG,CAAE,CAAC,EAExGkD,EAAM,OAAS,GAAG,KAAK,EAAE,iBAAiBA,CAAK,CACrD,CACF,EAOO,SAASG,GAAOnE,EAAYC,EAAuD,CAAC,EAAGC,EAAsB,CAAC,EAAW,CAC9H,OAAO,IAAIH,EAAOC,EAAGC,EAAOC,CAAI,CAClC,CAEA,SAASG,GAASM,EAA8B,CAC9C,OAAO,OAAOA,GAAM,UAAYA,IAAM,MAAQ,WAAYA,GAAK,aAAcA,GAAK,UAAWA,CAC/F",
|
|
6
6
|
"names": ["workletCode", "VOCAL_ENGINE_INFO", "voice", "workletCode", "VOCAL_ENGINE_INFO", "EventKind", "listEngines", "EventKind", "SILENCE", "vocalPhonemeIndex", "VOICING_LAG", "MIN_CLOSURE", "sungEvents", "plan", "opts", "result", "busy", "a", "b", "first", "phrase", "k", "phraseEvents", "isVowel", "idx", "VOCAL_ACOUSTICS", "noteId", "validHz", "ch", "param", "time", "index", "value", "EventKind", "unknown", "lookup", "ipa", "BEAT_PREFIX", "beatTokenIndex", "times", "sounds", "sound", "span", "s", "vocalIsBeat", "next", "prev", "vocalReleaseAspirated", "lead", "vocalReleaseVot", "floor", "openingFloor", "stop", "beat", "start0", "end0", "start", "w", "end", "meets", "open", "p0", "openHz", "inner", "bend", "p", "t", "st", "at", "ahead", "order", "_", "i", "out", "VOCAL_DEFAULT_PHONEME", "window", "firstVowel", "notBefore", "hz", "EMPTY", "Singer", "b", "voice", "opts", "preset", "voicePreset", "isPreset", "params", "listEngines", "e", "speechHzForBody", "own", "v", "live", "name", "value", "lyrics", "notes", "text", "accent", "resolveAccent", "syllables", "questions", "m", "part", "lyricsToSyllables", "plan", "speechPlan", "n", "pattern", "line", "beatLine", "humDefault", "pitch", "step", "i", "at", "BEAT_LEAD_IN", "values", "SHAPE_PRESETS", "p", "s", "VOICE_SETTINGS", "x", "note", "vel", "noteId", "fx", "bus", "level", "planOpts", "channel", "state", "rendering", "now", "w", "plan1", "planSung", "posted", "sungEvents", "VOCAL_PLAN_LEAD", "vocalGlideLead", "a", "c", "idx", "fixes", "o", "EventKind", "singer"]
|
|
7
7
|
}
|