@opendaw/studio-core 0.0.7 → 0.0.8
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/EngineWorklet.d.ts +0 -2
- package/dist/EngineWorklet.d.ts.map +1 -1
- package/dist/EngineWorklet.js +0 -4
- package/dist/MeterWorklet.d.ts +1 -4
- package/dist/MeterWorklet.d.ts.map +1 -1
- package/dist/MeterWorklet.js +1 -8
- package/dist/RecordingWorklet.d.ts +2 -5
- package/dist/RecordingWorklet.d.ts.map +1 -1
- package/dist/RecordingWorklet.js +2 -13
- package/dist/RenderQuantum.d.ts +2 -0
- package/dist/RenderQuantum.d.ts.map +1 -0
- package/dist/RenderQuantum.js +1 -0
- package/dist/Worklets.d.ts +3 -9
- package/dist/Worklets.d.ts.map +1 -1
- package/dist/Worklets.js +13 -18
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/processors.js +6 -0
- package/dist/processors.js.map +7 -0
- package/package.json +20 -24
- package/dist/WorkletFactory.d.ts +0 -8
- package/dist/WorkletFactory.d.ts.map +0 -1
- package/dist/WorkletFactory.js +0 -9
- package/dist/engine-processor.js +0 -6
- package/dist/engine-processor.js.map +0 -7
- package/dist/meter-processor.js +0 -2
- package/dist/meter-processor.js.map +0 -7
- package/dist/recording-processor.js +0 -4
- package/dist/recording-processor.js.map +0 -7
package/dist/meter-processor.js
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
var x=s=>s!=null;var S=(s,t="asDefined failed")=>s??p(t);var k=s=>s instanceof Function?s():s;var K=s=>{throw new Error(`Unhandled ${s}`)},p=s=>{throw s instanceof Error?s:new Error(s)},E=(s,t)=>s?void 0:p(k(t));var It=()=>{};var lt;(function(s){s[s.Ascending=1]="Ascending",s[s.Descending=-1]="Descending"})(lt||(lt={}));var w=class{static#t=Object.freeze(new Array(0));static empty=()=>this.#t;static clear=t=>{t.length=0};static replace=(t,e)=>{t.length=0,t.push(...e)};static consume=(t,e)=>{for(let r=0;r<t.length;)e(t[r])?t.splice(r,1):r++};static peekFirst=t=>t.at(0)??null;static peekLast=t=>t.at(-1)??null;static getFirst=(t,e)=>S(t.at(0),e);static getLast=(t,e)=>S(t.at(-1),e);static removeLast=(t,e)=>S(t.pop(),e);static create=(t,e)=>{let r=new Array(e);for(let i=0;i<e;i++)r[i]=t(i);return r};static equals=(t,e)=>{if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0};static satisfy=(t,e)=>{if(t.length<2)return!0;let r=t[0];for(let i=1;i<t.length;i++)if(!e(r,t[i]))return!1;return!0};static remove=(t,e)=>{let r=t.indexOf(e);if(r===-1)return p(`${e} not found in ${t}`);t.splice(r,1)};static removeOpt=(t,e)=>{let r=t.indexOf(e);return r===-1?!1:(t.splice(r,1),!0)};static hasDuplicates=t=>new Set(t).size<t.length;static removeDuplicates=t=>{let e=0,r=new Set;for(let i of t)r.has(i)||(r.add(i),t[e++]=i);return t.length=e,t};static removeDuplicateKeys=(t,e)=>{let r=0,i=new Set;for(let n of t){let o=n[e];i.has(o)||(i.add(o),t[r++]=n)}return t.length=r,t};static*iterate(t){for(let e=0;e<t.length;e++)yield t[e]}static*iterateReverse(t){for(let e=t.length-1;e>=0;e--)yield t[e]}static*iterateStateFull(t){let e=t.length-1;for(let r=0;r<=e;r++)yield{value:t[r],isFirst:r===0,isLast:r===e}}static isSorted(t,e=lt.Ascending){if(t.length<2)return!0;let r=t[0];for(let i=1;i<t.length;i++){let n=t[i];if(Math.sign(r-n)===e)return!1;r=n}return!0}};var A;(function(s){s.wrap=e=>x(e)?new t(e):s.None,s.from=e=>s.wrap(e()),s.tryFrom=e=>{try{return s.wrap(e())}catch{return s.None}},s.execute=(e,...r)=>s.wrap(e?.apply(null,r)),s.async=e=>e.then(r=>s.wrap(r),()=>s.None);class t{#t;constructor(r){this.#t=S(r)}unwrap(){return this.#t}unwrapOrElse(r){return this.#t}unwrapOrNull(){return this.#t}unwrapOrUndefined(){return this.#t}contains(r){return r===this.#t}match(r){return r.some(this.#t)}ifSome(r){return r(this.#t)}isEmpty(){return!1}nonEmpty(){return!0}map(r){return s.wrap(r(this.#t))}mapOr(r,i){return r(this.#t)}flatMap(r){return r(this.#t)}equals(r){return this.unwrapOrNull()===r.unwrapOrNull()}assert(r){return this}toString(){return`{Option.Some(${this.#t})}`}get[Symbol.toStringTag](){return this.toString()}}s.Some=t,s.None=new class{unwrap=e=>p(x(e)?k(e):"unwrap failed");unwrapOrElse=e=>k(e);unwrapOrNull=()=>null;unwrapOrUndefined=()=>{};contains=e=>!1;match=e=>e.none();ifSome=e=>{};isEmpty=()=>!0;nonEmpty=()=>!1;map=e=>s.None;mapOr=(e,r)=>k(r);flatMap=e=>s.None;equals=e=>e.isEmpty();assert=e=>p(k(e)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(A||(A={}));var Nt;(function(s){s.async=t=>t.then(e=>s.ok(e),e=>s.err(e)),s.tryGet=t=>{try{return s.ok(t())}catch(e){return s.err(e)}},s.ok=t=>new class{value;constructor(e){this.value=e}asOption=()=>A.wrap(this.value);failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>this.value;map=e=>{try{return s.ok(e(this.value))}catch(r){return s.err(r)}};flatMap=e=>e(this.value);match=e=>e.ok(this.value);toVoid=()=>s.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>`{Success: ${this.value}`;get[Symbol.toStringTag](){return"Success"}}(t),s.Ok=new class{constructor(){}asOption=()=>A.None;failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>{};map=t=>s.ok(t());flatMap=t=>t();match=t=>t.ok();toVoid=()=>s.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>"{Success: Ok";get[Symbol.toStringTag](){return"Success"}},s.err=t=>new class{reason;constructor(e){this.reason=e}asOption=()=>A.None;failureReason=()=>this.reason;isFailure=()=>!0;isSuccess=()=>!1;result=()=>{throw new Error(`No result because '${this.reason}'`)};map=()=>this;flatMap=()=>this;match=e=>e.err(this.reason);toVoid=()=>s.err(this.reason);failure=()=>this;toString=()=>`{Failure: ${this.reason}`;get[Symbol.toStringTag](){return"Failure"}}(t)})(Nt||(Nt={}));var v;(function(s){s.exact=(t,e,r)=>{let i=0,n=t.length-1;for(;i<=n;){let o=i+n>>>1,a=r(t[o],e);if(a===0)return o;a<0?i=o+1:n=o-1}return-1},s.exactMapped=(t,e,r,i)=>{let n=0,o=t.length-1;for(;n<=o;){let a=n+o>>>1,h=r(i(t[a]),e);if(h===0)return a;h<0?n=a+1:o=a-1}return-1},s.leftMost=(t,e,r)=>{let i=0,n=t.length;for(;i<n;){let o=i+n>>>1;r(t[o],e)<0?i=o+1:n=o}return i},s.rightMost=(t,e,r)=>{let i=0,n=t.length;for(;i<n;){let o=i+n>>>1;r(t[o],e)<=0?i=o+1:n=o}return n-1},s.leftMostMapped=(t,e,r,i)=>{let n=0,o=t.length;for(;n<o;){let a=n+o>>>1;r(i(t[a]),e)<0?n=a+1:o=a}return n},s.rightMostMapped=(t,e,r,i)=>{let n=0,o=t.length;for(;n<o;){let a=n+o>>>1;r(i(t[a]),e)<=0?n=a+1:o=a}return o-1},s.rangeMapped=(t,e,r,i)=>[s.leftMostMapped(t,e,r,i),s.rightMostMapped(t,e,r,i)]})(v||(v={}));var Tt;(function(s){s.parseCssRgbOrRgba=t=>{let e=t.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(x(e)&&e.every(r=>!isNaN(r))){if(e.length===3)return[e[0]/255,e[1]/255,e[2]/255,1];if(e.length===4)return[e[0]/255,e[1]/255,e[2]/255,e[3]]}throw new Error(`${t} is not proper formatted. Example: 'rgb(255, 255, 255)' or 'rgba(255, 255, 255, 1)'`)}})(Tt||(Tt={}));var Q=(s,t)=>s-t;var ue=Math.PI*2,Re=Math.PI/2,ct=Math.PI/4,De=1/Math.sqrt(2),d=(s,t,e)=>Math.max(t,Math.min(s,e));var St=(s,t)=>fe(s/t)*t,fe=s=>s-Math.floor(s),ut=s=>Math.pow(2,Math.ceil(Math.log(s)/Math.log(2)));var Z;(function(s){s.valueAt=({slope:i,steps:n,y0:o,y1:a},h)=>s.normalizedAt(h/n,i)*(a-o)+o,s.normalizedAt=(i,n)=>{if(n>.499999&&n<.500001)return i;{let o=d(n,1e-15,.999999999999999);return o*o/(1-o*2)*(Math.pow((1-o)/o,2*i)-1)}},s.inverseAt=(i,n)=>{let o=d(n,1e-15,.999999999999999);return Math.log(i*(1-2*o)/(o*o)+1)/(2*Math.log((1-o)/o))},s.coefficients=i=>{let n=s.valueAt(i,1),a=(s.valueAt(i,2)-n)/(n-i.y0),h=n-a*i.y0;return{m:a,q:h}};function*e(i,n,o,a){let{m:h,q:l}=s.coefficients({slope:i,steps:n,y0:o,y1:a});for(let u=0,f=o;u<n;u++)yield f=h*f+l}s.walk=e;function*r(i,n){let o=1/n,a=s.normalizedAt(o,i),l=(s.normalizedAt(2*o,i)-a)/a;for(let u=0,f=0;u<n;u++)yield f=l*f+a}s.walkNormalized=r,s.byHalf=(i,n,o,a)=>({slope:s.slopeByHalf(n,o,a),steps:i,y0:n,y1:a}),s.slopeByHalf=(i,n,o)=>Math.abs(o-i)<1e-6?.5:(n-i)/(o-i)})(Z||(Z={}));var F=new DataView(new ArrayBuffer(8)),P;(function(s){s.MIN_VALUE=-2147483648,s.MAX_VALUE=2147483647,s.toByte=t=>(F.setInt8(0,t),F.getInt8(0)),s.toShort=t=>(F.setInt16(0,t),F.getInt16(0)),s.toInt=t=>(F.setInt32(0,t),F.getInt32(0))})(P||(P={}));var O;(function(s){let r=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),i=new Float32Array(r),n=new Int32Array(r);s.floatToIntBits=o=>{let a=s.floatToRawIntBits(o);return(a&2139095040)===2139095040&&(a&8388607)!==0?2143289344:a},s.intBitsToFloat=o=>(n[0]=o,i[0]),s.floatToRawIntBits=o=>(i[0]=o,n[0]),s.toFloat32=o=>(F.setFloat32(0,o),F.getFloat32(0))})(O||(O={}));var Ft;(function(s){s.floatToIntBits=t=>{let e=O.floatToIntBits(t),r=e>>>16&32768,i=(e&2147483647)+4096;return i>=1199570944?(e&2147483647)>=1199570944?i<2139095040?r|31744:r|31744|(e&8388607)>>>13:r|31743:i>=947912704?r|i-939524096>>>13:i<855638016?r:(i=(e&2147483647)>>>23,r|(e&8388607|8388608)+(8388608>>>i-102)>>>126-i)},s.intBitsToFloat=t=>{let e=t&1023,r=t&31744;if(r===31744)r=261120;else if(r!==0){if(r+=114688,e===0&&r>115712)return O.intBitsToFloat((t&32768)<<16|r<<13|1023)}else if(e!==0){r=115712;do e<<=1,r-=1024;while((e&1024)===0);e&=1023}return O.intBitsToFloat((t&32768)<<16|(r|e)<<13)}})(Ft||(Ft={}));var ft;(function(s){let t=9218868437227405312n,e=4503599627370495n,r=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),i=new Float64Array(r),n=new BigInt64Array(r);s.float64ToLongBits=o=>{let a=s.float64ToRawLongBits(o);return(a&t)===t&&(a&e)!==0n?0x7ff8000000000000n:a},s.longBitsToFloat64=o=>(n[0]=o,i[0]),s.float64ToRawLongBits=o=>(i[0]=o,n[0]),s.clamp=o=>(F.setFloat64(0,o),F.getFloat64(0))})(ft||(ft={}));var R=class{static*empty(){}static one(t){return[t]}static count(t){let e=0;for(let r of t)e++;return e}static some(t,e){for(let r of t)if(e(r))return!0;return!1}static every(t,e){for(let r of t)if(!e(r))return!1;return!0}static reduce(t,e,r){let i=r,n=0;for(let o of t)i=e(i,o,n++);return i}static includes(t,e){for(let r of t)if(r===e)return!0;return!1}static forEach(t,e){for(let r of t)e(r)}static*map(t,e){let r=0;for(let i of t)yield e(i,r++)}static*take(t,e){let r=0;for(let i of t){if(r++>=e)return;yield i}}static filter(t,e){let r=[];for(let i of t)e(i)&&r.push(i);return r}static filterMap(t,e){let r=[];for(let i of t){let n=e(i);x(n)&&r.push(n)}return r}static reverse(t){let e=[];for(let r of t)e.push(r);return e.reverse()}static*pairWise(t){let e=t[Symbol.iterator](),{done:r,value:i}=e.next(),n=i;if(r!==!0)for(;;){let{done:o,value:a}=e.next();if(o===!0){yield[n,null];return}yield[n,a],n=a}}};var J=class s{static create(t=1024){return this.use(new ArrayBuffer(t))}static use(t,e=0){return new s(new DataView(t,e))}littleEndian=!1;#t;#e=0;constructor(t){this.#t=t}get remaining(){return this.#t.byteLength-this.#e}get position(){return this.#e}set position(t){t<0?p(`position(${t}) cannot be negative.`):t>this.#t.byteLength?p(`position(${t}) is outside range (${this.#t.byteLength}).`):this.#e=t}writeBoolean(t){this.writeByte(t?1:0)}writeByte(t){this.#s(1),this.#t.setInt8(this.#e++,t)}writeShort(t){this.#s(Int16Array.BYTES_PER_ELEMENT),this.#t.setInt16(this.#e,t,this.littleEndian),this.#e+=Int16Array.BYTES_PER_ELEMENT}writeInt(t){this.#s(Int32Array.BYTES_PER_ELEMENT),this.#t.setInt32(this.#e,t,this.littleEndian),this.#e+=Int32Array.BYTES_PER_ELEMENT}writeLong(t){this.#s(BigInt64Array.BYTES_PER_ELEMENT),this.#t.setBigInt64(this.#e,t,this.littleEndian),this.#e+=BigInt64Array.BYTES_PER_ELEMENT}writeFloat(t){this.#s(Float32Array.BYTES_PER_ELEMENT),this.#t.setFloat32(this.#e,t,this.littleEndian),this.#e+=Float32Array.BYTES_PER_ELEMENT}writeDouble(t){this.#s(Float64Array.BYTES_PER_ELEMENT),this.#t.setFloat64(this.#e,t,this.littleEndian),this.#e+=Float64Array.BYTES_PER_ELEMENT}writeBytes(t){this.#s(t.length);for(let e=0;e<t.length;++e)this.#t.setInt8(this.#e++,t[e])}writeString(t){let e=t.length;this.#s(Int32Array.BYTES_PER_ELEMENT+e*Int16Array.BYTES_PER_ELEMENT),this.writeInt(e);for(let r=0;r<e;r++)this.writeShort(t.charCodeAt(r))}toArrayBuffer(){return this.#t.buffer.slice(0,this.#e)}#s(t){let e=this.#t.byteLength;if(this.#e+t>e){let r=this.#t;this.#t=new DataView(new ArrayBuffer(ut(e+t)));for(let i=0;i<this.#e;i++)this.#t.setInt8(i,r.getInt8(i))}}},tt=class{#t=0;writeByte(t){this.#t++}writeShort(t){this.#t+=2}writeInt(t){this.#t+=4}writeLong(t){this.#t+=8}writeFloat(t){this.#t+=4}writeDouble(t){this.#t+=8}writeBoolean(t){this.#t++}writeBytes(t){this.#t+=t.length}writeString(t){this.#t+=t.length+4}get count(){return this.#t}};var et=class{littleEndian=!1;#t;#e=0;constructor(t,e=0){this.#t=new DataView(t,e)}get position(){return this.#e}set position(t){t<0?p(`position(${t}) cannot be negative.`):t>this.#t.byteLength?p(`position(${t}) is outside range (${this.#t.byteLength}).`):this.#e=t}readByte(){return this.#t.getInt8(this.#e++)}readShort(){let t=this.#t.getInt16(this.#e,this.littleEndian);return this.#e+=Int16Array.BYTES_PER_ELEMENT,t}readInt(){let t=this.#t.getInt32(this.#e,this.littleEndian);return this.#e+=Int32Array.BYTES_PER_ELEMENT,t}readLong(){let t=this.#t.getBigInt64(this.#e,this.littleEndian);return this.#e+=BigInt64Array.BYTES_PER_ELEMENT,t}readFloat(){let t=this.#t.getFloat32(this.#e,this.littleEndian);return this.#e+=Float32Array.BYTES_PER_ELEMENT,t}readDouble(){let t=this.#t.getFloat64(this.#e,this.littleEndian);return this.#e+=Float64Array.BYTES_PER_ELEMENT,t}readBoolean(){return this.readByte()===1}readBytes(t){for(let e=0;e<t.length;e++)t[e]=this.readByte()}readString(){let t=this.readInt(),e="";for(let r=0;r<t;r++)e+=String.fromCharCode(this.readShort());return e}available(t){return this.#e+t<=this.#t.byteLength}remaining(){return this.#t.byteLength-this.#e}skip(t){this.position+=t}};var pt;(function(s){function*t(){}s.empty=t,s.next=r=>{let{value:i,done:n}=r.next();return n?null:i};function*e(...r){for(let i of r)for(let n of i)yield n}s.flatten=e})(pt||(pt={}));var D;(function(s){s[s.T=0]="T",s[s.R=1]="R",s[s.B=2]="B",s[s.L=3]="L"})(D||(D={}));var C;(function(s){s[s.TL=0]="TL",s[s.TR=1]="TR",s[s.BR=2]="BR",s[s.BL=3]="BL"})(C||(C={}));var Bt;(function(s){s.outerTangentPoints=(t,e)=>{let r=e.x-t.x,i=e.y-t.y,n=Math.atan2(i,r)+Math.acos((t.r-e.r)/Math.sqrt(r*r+i*i)),o=Math.cos(n),a=Math.sin(n);return[{x:t.x+t.r*o,y:t.y+t.r*a},{x:e.x+e.r*o,y:e.y+e.r*a}]}})(Bt||(Bt={}));var Lt;(function(s){s.zero=()=>({x:0,y:0}),s.create=(t,e)=>({x:t,y:e}),s.clone=t=>({...t}),s.floor=t=>({x:Math.floor(t.x),y:Math.floor(t.y)}),s.length=t=>Math.sqrt(t.x*t.x+t.y*t.y),s.distance=(t,e)=>Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),s.add=(t,e)=>({x:t.x+e.x,y:t.y+e.y}),s.subtract=(t,e)=>({x:t.x-e.x,y:t.y-e.y}),s.scaleBy=(t,e)=>({x:t.x*e,y:t.y*e}),s.scaleTo=(t,e)=>{let r=e/s.length(t);return{x:t.x*r,y:t.y*r}},s.fromClient=t=>({x:t.clientX,y:t.clientY})})(Lt||(Lt={}));var Pt;(function(s){s.Empty=Object.freeze({x:0,y:0,width:0,height:0}),s.corners=t=>{let e=t.x,r=t.y,i=e+t.width,n=r+t.height;return[{x:e,y:r},{x:i,y:r},{x:i,y:n},{x:e,y:n}]},s.inflate=(t,e)=>({x:t.x-e,y:t.y-e,width:t.width+e*2,height:t.height+e*2}),s.contains=(t,e)=>{let r=e.x>=t.x&&e.y>=t.y,i=e.x+e.width<=t.x+t.width&&e.y+e.height<=t.y+t.height;return r&&i},s.isPointInside=(t,e)=>t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height,s.intersect=(t,e)=>{let r=Math.max(t.x,e.x),i=Math.min(t.x+t.width,e.x+e.width),n=Math.min(t.y+t.height,e.y+e.height),o=Math.max(t.y,e.y);return i>r&&n>o},s.axis=(t,e)=>{switch(e){case D.T:return t.y;case D.R:return t.x+t.width;case D.B:return t.y+t.height;case D.L:return t.x;default:return K(e)}},s.corner=(t,e)=>{switch(e){case C.TL:return{x:t.x,y:t.y};case C.TR:return{x:t.x+t.width,y:t.y};case C.BR:return{x:t.x+t.width,y:t.y+t.height};case C.BL:return{x:t.x,y:t.y+t.height};default:return K(e)}},s.center=t=>({x:t.x+t.width*.5,y:t.y+t.height*.5}),s.isEmpty=t=>t.width===0||t.height===0,s.union=(t,e)=>{if(s.isEmpty(t))s.isEmpty(e)||(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height);else if(!s.isEmpty(e)){let r=e.x,i=e.y,n=Math.min(t.x,r),o=Math.min(t.y,i);t.width=Math.max(t.x+t.width,r+e.width)-n,t.height=Math.max(t.y+t.height,i+e.height)-o,t.x=n,t.y=o}}})(Pt||(Pt={}));var _t;(function(s){s.width=t=>t.xMax-t.xMin,s.height=t=>t.yMax-t.yMin,s.from=(t,e)=>{t.xMin=e.xMin,t.xMax=e.xMax,t.yMin=e.yMin,t.yMax=e.yMax},s.extend=(t,e)=>{t.xMin-=e,t.yMin-=e,t.xMax+=e,t.yMax+=e},s.padding=(t,[e,r,i,n])=>(t.xMin+=n,t.yMin+=e,t.xMax-=r,t.yMax-=i,t),s.intersectPoint=(t,e)=>t.xMin<=e.x&&e.x<t.xMax&&t.yMin<=e.y&&e.y<t.yMax,s.intersectThat=(t,e)=>e.xMin<t.xMax&&e.xMax>t.xMin&&e.yMin<t.yMax&&e.yMax>t.yMin,s.center=t=>({x:(t.xMin+t.xMax)*.5,y:(t.yMin+t.yMax)*.5})})(_t||(_t={}));var kt;(function(s){s.Identity=Object.freeze([0,0,0,0])})(kt||(kt={}));var Ot;(function(s){s.intersects=(r,i,n,o,a,h,l,u)=>{let f=t(r,i,n,o,a,h),c=t(r,i,n,o,l,u);if((f|c)===0||(f&c)!==0)return!1;let m=e(a,h,l,u,r,n);return m!==e(a,h,l,u,i,n)||m!==e(a,h,l,u,i,o)||m!==e(a,h,l,u,r,o)};let t=(r,i,n,o,a,h)=>{let l=0;return a<=r?l|=1:a>=i&&(l|=2),h<=n?l|=8:h>=o&&(l|=4),l},e=(r,i,n,o,a,h)=>(n-r)*(h-i)-(a-r)*(o-i)>=0})(Ot||(Ot={}));var Rt;(function(s){s.Identity={valueToAxis:t=>t,axisToValue:t=>t},s.toClamped=(t,e,r)=>({valueToAxis:i=>t.valueToAxis(d(i,e,r)),axisToValue:i=>d(t.axisToValue(i),e,r)}),s.createClamped=(t,e)=>({valueToAxis:r=>d(r,t,e),axisToValue:r=>d(r,t,e)})})(Rt||(Rt={}));var Dt;(function(s){s.fromBuffers=async(...t)=>{let e=t.reduce((n,o)=>n+o.byteLength,0),r=new Uint8Array(e),i=0;for(let n of t)r.set(new Uint8Array(n),i),i+=n.byteLength;return await crypto.subtle.digest("SHA-256",r)},s.equals=(t,e)=>{E(t.byteLength===32,"First hash has invalid length"),E(e.byteLength===32,"Second hash has invalid length");let r=new Uint8Array(t),i=new Uint8Array(e);for(let n=0;n<32;n++)if(r[n]!==i[n])return!1;return!0},s.toString=t=>Array.from(new Uint8Array(t)).map(e=>e.toString(16).padStart(2,"0")).join("")})(Dt||(Dt={}));var Ct;(function(s){s.intersect1D=(t,e,r,i)=>Math.max(t,r)<=Math.min(e,i)})(Ct||(Ct={}));var mt=class s{static#t=Object.freeze(new Set);static empty=()=>s.#t};var $t;(function(s){s.mergeNoOverlap=(t,e)=>{let r=new Set(Object.keys(t));for(let i of Object.keys(e))if(r.has(i))return p(`'${i}' is an overlapping key`);return{...t,...e}},s.include=(t,...e)=>e.reduce((r,i)=>(r[i]=t[i],r),{}),s.exclude=(t,...e)=>{let r=new Set(e);return Object.entries(t).reduce((i,[n,o])=>(r.has(n)||(i[n]=o),i),{})},s.overwrite=(t,e)=>Object.assign(t,e)})($t||($t={}));var $=Object.freeze({Empty:{terminate:It},create:s=>({terminate:s}),many:(...s)=>({terminate:()=>{for(;s.length>0;)s.pop().terminate()}})});var Vt;(function(s){s.make=t=>new class{getValue(){return t}subscribe(e){return $.Empty}catchupAndSubscribe(e){return e(this),$.Empty}}})(Vt||(Vt={}));var zt;(function(s){s.False=new class{getValue(){return!1}setValue(t){}subscribe(t){return $.Empty}catchupAndSubscribe(t){return t(this),$.Empty}},s.inverseBoolean=t=>new class{getValue(){return!t.getValue()}setValue(e){t.setValue(!e)}subscribe(e){return t.subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}}})(zt||(zt={}));var dt=class{#t;#e;#s;constructor(t,e){this.#t=t,this.#e=e,this.#s=e-t}x(t){return(this.clamp(t)-this.#t)/this.#s}y(t){return this.#t+d(t,0,1)*this.#s}clamp(t){return d(t,this.#t,this.#e)}floating(){return!0}},xt=class{#t;#e;#s;constructor(t,e){this.#t=d(Math.round(t),P.MIN_VALUE,P.MAX_VALUE),this.#e=d(Math.round(e),P.MIN_VALUE,P.MAX_VALUE),this.#s=this.#e-this.#t}x(t){return(this.clamp(t)-this.#t)/this.#s}y(t){return this.#t+Math.round(d(t,0,1)*this.#s)}clamp(t){return d(Math.round(t),this.#t,this.#e)}floating(){return!1}},yt=class{#t;#e;#s;constructor(t,e){this.#t=t,this.#e=e,this.#s=Math.log(e/t)}x(t){return Math.log(d(t,this.#t,this.#e)/this.#t)/this.#s}y(t){return this.#t*Math.exp(d(t,0,1)*this.#s)}clamp(t){return Math.min(this.#e,Math.max(this.#t,t))}floating(){return!0}},gt=class{#t;constructor(t){this.#t=t}x(t){let e=this.#t.findIndex(r=>r===t);return e===-1?p(`Could not find index for ${t}`):e/(this.#t.length-1)}y(t){let e=Math.round(d(t,0,1)*(this.#t.length-1));return e>-1?S(this.#t.at(e),`Could not find value for ${t}`):p(`Index ${e} is out of box.`)}clamp(t){return t}floating(){return!1}},wt=class{#t;#e;#s;#r;#i;constructor(t,e,r){this.#t=t,this.#e=r;let i=t*t,n=r*r,o=e*e,a=t+r-2*e,h=r-e;this.#s=((2*r-e)*t-e*r)/a,this.#r=(h*i+(o-n)*t+e*n-o*r)/(i+(2*r-4*e)*t+n-4*e*r+4*o),this.#i=-h/a}y(t){return t<=0?Number.NEGATIVE_INFINITY:t>=1?this.#e:this.#s-this.#r/(t+this.#i)}x(t){return this.#t>=t?0:this.#e<=t?1:-this.#r/(t-this.#s)-this.#i}clamp(t){return Math.min(this.#e,t)}floating(){return!0}},Mt;(function(s){s.linear=(n,o)=>new dt(n,o),s.linearInteger=(n,o)=>new xt(n,o),s.exponential=(n,o)=>new yt(n,o),s.values=n=>new gt(n),s.decibel=(n,o,a)=>new wt(n,o,a);let t=new class{x(n){return n?1:0}y(n){return n>=.5}clamp(n){return n}floating(){return!1}},e=s.linear(0,1),r=s.linear(-1,1);s.bool=t;let i=s.decibel(-72,-12,0);s.unipolar=()=>e,s.bipolar=()=>r,s.DefaultDecibel=i})(Mt||(Mt={}));var Et;(function(s){s.percent=({bipolar:n,fractionDigits:o}={})=>new t("%",o,!1,n),s.numeric=({unit:n,fractionDigits:o,unitPrefix:a,bipolar:h}={})=>new t(n,o,a,h),s.indices=(n,o)=>new class{x(a){return{unit:n,value:o[a]}}y(a){let h=o.indexOf(a);return h===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:h}}},s.values=(n,o,a)=>new class{x(h){return{unit:n,value:a.at(o.indexOf(h))??"N/A"}}y(h){let l=a.indexOf(h);return l===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:o[l]}}},s.bool=new class{y(n){switch(n.trim()){case"on":case"yes":case"true":return{type:"explicit",value:!0};default:return{type:"explicit",value:!1}}}x(n){return{value:String(n),unit:""}}};class t{#t;#e;#s;#r;constructor(o,a,h,l){this.#t=o??"",this.#e=a??0,this.#s=h??!1,this.#r=l??!1}y(o){let a=o.trim(),h=parseFloat(a);if(isNaN(h))return{type:"unknown",value:a};if(this.#t==="%")return{type:"explicit",value:h/100};if(a.endsWith("%"))return{type:"unitValue",value:this.#r?d(h/200+.5,0,1):d(h/100,0,1)};{a.endsWith(this.#t)&&this.#t.length>0&&(a=a.slice(0,-this.#t.length));let f=/(\d+)(\D+)/.exec(a)?.at(2)?.at(0);if(x(f)){let c=e.indexOf(f);if(c>-1)return{type:"explicit",value:h*Math.pow(10,(c-4)*3)}}return{type:"explicit",value:h}}}x(o){if(Number.isNaN(o))return{value:"\u{1F4A3}",unit:this.#t};if(Number.isFinite(o)){if(this.#t==="%")return this.#r?{value:(o*200-100).toFixed(this.#e),unit:this.#t}:{value:(o*100).toFixed(this.#e),unit:this.#t};if(this.#s){let{value:a,prefix:h}=i(o);return{value:a.toFixed(this.#e),unit:`${h}${this.#t}`}}else return{value:o.toFixed(this.#e),unit:this.#t}}else return{value:o===Number.POSITIVE_INFINITY?"\u221E":"-\u221E",unit:this.#t}}}let e=Object.freeze(["p","n","\u03BC","m","","k","M","G","T"]),r=n=>Math.log(n)/Math.log(9.999999999999998),i=n=>{let o=Math.floor(r(n)/3),a=e[o+4];return x(a)?{value:n*Math.pow(10,o*-3),prefix:a}:{value:n,prefix:""}};s.decible=s.numeric({unit:"db",fractionDigits:1}),s.panning=s.percent({unit:"%",fractionDigits:0})})(Et||(Et={}));var bt;(function(s){s.alwaysTrue=()=>!0,s.alwaysFalse=()=>!1,s.definedPredicate=t=>t!=null})(bt||(bt={}));var Gt;(function(s){s.split=(t,e)=>{let r=new Float32Array(e);return w.create(i=>n=>{r[i]=n,t(r.reduce((o,a)=>o+a,0)/e)},e)}})(Gt||(Gt={}));var Yt;(function(s){s.create=(t=252854082)=>new vt(t),s.monotoneAscending=(t,e=128,r=s.create())=>{let i=t.length;if(i<2)return p("Array must have at least 2 elements");let n=0;for(let a=1;a<i;a++){let h=Math.floor(r.uniform()*(1+e))+1;t[a]=h,n+=h}let o=0;t[0]=0;for(let a=1;a<i;a++)o+=t[a],t[a]=o/n;return t}})(Yt||(Yt={}));var vt=class{#t=0;constructor(t){this.setSeed(t)}setSeed(t){this.#t=t&4294967295}nextDouble(t,e){return t+this.uniform()*(e-t)}nextInt(t,e){return t+Math.floor(this.uniform()*(e-t))}nextElement(t){return t[Math.floor(this.uniform()*t.length)]}nextBoolean(){return this.uniform()<.5}uniform(){let t=this.#t+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}};var V;(function(s){class t{}s.createBuilder=r=>{let i=n=>{let o=n instanceof Array?[]:{};return Object.entries(n).forEach(([a,h])=>{h instanceof t?o[a]=h.initialValue():typeof h=="object"&&(o[a]=i(h))}),o};return()=>new e(r,Object.seal(i(r)))},s.bool=new class extends t{read(r){return r.readByte()===1}write(r,i){r.writeByte(i?1:0)}initialValue(){return!1}},s.int8=new class extends t{read(r){return r.readByte()}write(r,i){r.writeByte(i)}initialValue(){return 0}},s.int16=new class extends t{read(r){return r.readShort()}write(r,i){r.writeShort(i)}initialValue(){return 0}},s.int32=new class extends t{read(r){return r.readInt()}write(r,i){r.writeInt(i)}initialValue(){return 0}},s.float=new class extends t{read(r){return r.readFloat()}write(r,i){r.writeFloat(i)}initialValue(){return 0}},s.double=new class extends t{read(r){return r.readDouble()}write(r,i){r.writeDouble(i)}initialValue(){return 0}},s.int64=new class extends t{read(r){return r.readLong()}write(r,i){r.writeLong(i)}initialValue(){return 0n}},s.floats=r=>new class extends t{read(i,n){for(let o=0;o<n.length;o++)n[o]=i.readFloat();return n}write(i,n){for(let o=0;o<n.length;o++)i.writeFloat(n[o])}initialValue(){return new Float32Array(r)}},s.doubles=r=>new class extends t{read(i,n){for(let o=0;o<n.length;o++)n[o]=i.readDouble();return n}write(i,n){for(let o=0;o<n.length;o++)i.writeDouble(n[o])}initialValue(){return new Float64Array(r)}};class e{#t;#e;#s;constructor(i,n){this.#t=i,this.#e=n,this.#s=this.#r()}get object(){return this.#e}get bytesTotal(){return this.#s}read(i){let n=(o,a)=>{Object.entries(o).forEach(([h,l])=>{let u=a;l instanceof t?u[h]=l.read(i,u[h]):typeof l=="object"&&n(l,u[h])})};n(this.#t,this.#e)}write(i){let n=(o,a)=>{Object.entries(o).forEach(([h,l])=>{let u=a;l instanceof t?l.write(i,u[h]):typeof l=="object"&&n(l,u[h])})};n(this.#t,this.#e)}#r(){let i=new tt;return this.write(i),i.count}}})(V||(V={}));var st=class{#t;#e;#s;constructor(t,e){this.#t=t,this.#e=e,this.#s=[]}add(t,e=!1){let r=this.#t(t),i=v.leftMostMapped(this.#s,r,this.#e,this.#t),n=this.#s[i];return x(n)&&this.#e(this.#t(n),r)===0?e?(this.#s.splice(i,1,t),!0):!1:(this.#s.splice(i,0,t),!0)}getOrCreate(t,e){let r=v.leftMostMapped(this.#s,t,this.#e,this.#t),i=this.#s[r];if(x(i)&&this.#e(this.#t(i),t)===0)return i;let n=e(t);return this.#s.splice(r,0,n),n}addMany(t){for(let e of t)this.#s.push(e);try{return this.#s.sort((e,r)=>{let i=this.#e(this.#t(e),this.#t(r));if(i===0)throw"cancel";return i}),!0}catch(e){if(e==="cancel"){let r=new Map(this.entries());return this.#s.splice(0,this.#s.length,...r.values()),this.#s.sort((i,n)=>this.#e(this.#t(i),this.#t(n))),!1}return p(e)}}removeByValue(t){return this.removeByKey(this.#t(t))}removeByKey(t){let e=v.leftMostMapped(this.#s,t,this.#e,this.#t),r=this.#s[e];return x(r)&&this.#e(this.#t(r),t)===0?(this.#s.splice(e,1),r):p(`Could not remove ${t}`)}removeRange(t,e){this.#s.splice(t,(e??this.#s.length)-t)}removeByPredicate(t){let e=0,r=this.#s.length;for(;--r>=0;)t(this.#s[r])&&(this.#s.splice(r,1),e++);return e}get(t){let e=this.#r(t);return x(e)?e:p(`Unknown key: ${t}`)}getOrThrow(t,e){let r=this.#r(t);if(x(r))return r;throw e()}opt(t){return A.wrap(this.#r(t))}getOrNull(t){return this.#r(t)??null}getByIndex(t){return this.#s[t]}hasKey(t){return x(this.#r(t))}hasValue(t){return x(this.#r(this.#t(t)))}size(){return this.#s.length}isEmpty(){return this.#s.length===0}forEach(t){this.values().forEach(t)}values(){return this.#s}entries(){return this.#s.map(t=>[this.#t(t),t])}clear(){w.clear(this.#s)}[Symbol.iterator](){return this.#s.values()}#r(t){let e=v.leftMostMapped(this.#s,t,this.#e,this.#t),r=this.#s[e];return x(r)&&this.#e(this.#t(r),t)===0?r:void 0}};var Ht;(function(s){s.hyphenToCamelCase=t=>t.replace(/-([a-z])/g,e=>e[1].toUpperCase()),s.fallback=(t,e)=>x(t)&&t.length>0?t:e,s.endsWithDigit=t=>/\d$/.test(t),s.nonEmpty=(t,e)=>x(t)&&t.trim().length>0?t:e,s.toArrayBuffer=t=>{let e=new ArrayBuffer(t.length),r=new Uint8Array(e);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return e}})(Ht||(Ht={}));var Wt=class s{static POSITIVE_INFINITY=new s(Number.POSITIVE_INFINITY);static millis=t=>new s(t);static seconds=t=>new s(t*s.#t);static minutes=t=>new s(t*s.#e);static hours=t=>new s(t*s.#s);static days=t=>new s(t*s.#r);static#t=1e3;static#e=6e4;static#s=36e5;static#r=864e5;#i;constructor(t){this.#i=t}millis(){return this.#i}absSeconds(){return Math.abs(this.#i)/s.#t}absMinutes(){return Math.abs(this.#i)/s.#e}absHours(){return Math.abs(this.#i)/s.#s}absDays(){return Math.abs(this.#i)/s.#r}split(){return{d:Math.floor(this.absDays()),h:Math.floor(this.absHours())%24,m:Math.floor(this.absMinutes())%60,s:Math.floor(this.absSeconds())%60}}isNow(){return this.#i===0}isPast(){return this.#i<0}isFuture(){return this.#i>0}toUnitString(){let t,e,r=Math.floor(Math.abs(this.#i)/1e3),i=Math.floor(r/60),n=Math.floor(i/60),o=Math.floor(n/24);return r<60?(t=r,e="second"):i<60?(t=i,e="minute"):n<24?(t=n,e="hour"):(t=o,e="day"),new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"long"}).format(t*Math.sign(this.#i),e)}toString(){if(isNaN(this.#i))return"NaN";if(!isFinite(this.#i))return"\u221E";let{d:t,h:e,m:r,s:i}=this.split();return t>0?[s.#n("d",t),s.#n("h",e),s.#n("m",r),s.#n("s",i)].join(", "):e>0?[s.#n("h",e),s.#n("m",r),s.#n("s",i)].join(", "):r>0?[s.#n("m",r),s.#n("s",i)].join(", "):i>0?s.#n("s",i):"now"}static#n=(t,e)=>{switch(t){case"d":return`${e} ${e<2?"day":"days"}`;case"h":return`${e} ${e<2?"hour":"hours"}`;case"m":return`${e} ${e<2?"minute":"minutes"}`;case"s":return`${e} ${e<2?"second":"seconds"}`;default:return K(t)}}};var rt;(function(s){let t;(function(e){e[e.READING=0]="READING",e[e.READ=1]="READ",e[e.WRITING=2]="WRITING",e[e.WRITTEN=3]="WRITTEN"})(t||(t={})),s.writer=(e,r,i)=>{if(e.bytesTotal+1>r.byteLength)return p("Insufficient memory allocated.");let n=new Uint8Array(r),o=J.use(r,1);return Atomics.store(n,0,t.READ),{tryWrite:()=>Atomics.compareExchange(n,0,t.READ,t.WRITING)===t.WRITING?(i(e.object),o.position=0,e.write(o),Atomics.store(n,0,t.WRITTEN),!0):!1}},s.reader=(e,r)=>{let i=new SharedArrayBuffer(e.bytesTotal+1),n=new Uint8Array(i),o=new et(i,1);return{buffer:i,tryRead:()=>Atomics.compareExchange(n,0,t.WRITTEN,t.READING)===t.READING?(o.position=0,e.read(o),r(e.object),Atomics.store(n,0,t.READ),!0):!1}}})(rt||(rt={}));var jt;(function(s){s.length=16,s.generate=()=>t(crypto.getRandomValues(new Uint8Array(s.length))),s.sha256=async e=>crypto.subtle.digest("SHA-256",e).then(r=>t(new Uint8Array(r.slice(0,s.length)))),s.validate=e=>s.parse(s.toString(e)),s.fromDataInput=e=>{let r=new Uint8Array(s.length);return e.readBytes(new Int8Array(r.buffer)),r},s.toDataOutput=(e,r)=>e.writeBytes(new Int8Array(r.buffer)),s.toString=e=>{let r=w.create(i=>(i+256).toString(16).substring(1),256);return r[e[0]]+r[e[1]]+r[e[2]]+r[e[3]]+"-"+r[e[4]]+r[e[5]]+"-"+r[e[6]]+r[e[7]]+"-"+r[e[8]]+r[e[9]]+"-"+r[e[10]]+r[e[11]]+r[e[12]]+r[e[13]]+r[e[14]]+r[e[15]]},s.parse=e=>{let r=e.replace(/-/g,"").toLowerCase();if(r.length!==32)return p("Invalid UUID format");let i=new Uint8Array(s.length);for(let n=0,o=0;n<32;n+=2,o++)i[o]=parseInt(r.slice(n,n+2),16);return i},s.Comparator=(e,r)=>{if(e.length!==s.length||r.length!==s.length)return p("Unexpected array length for uuid(v4)");for(let i=0;i<s.length;i++){let n=e[i]-r[i];if(n!==0)return n}return 0},s.equals=(e,r)=>s.Comparator(e,r)===0,s.newSet=e=>new st(e,s.Comparator),s.Lowest=s.parse("00000000-0000-4000-8000-000000000000"),s.Highest=s.parse("FFFFFFFF-FFFF-4FFF-BFFF-FFFFFFFFFFFF"),s.fromInt=e=>{let r=new Uint8Array(s.Lowest),i=new Uint8Array(new Uint32Array([e]).buffer);for(let n=0;n<4;n++)r[n]=i[n];return r};let t=e=>(E(e.length===s.length,"UUID must be 16 bytes long"),e[6]=e[6]&15|64,e[8]=e[8]&63|128,e)})(jt||(jt={}));var Kt;(function(s){s.create=n=>x(n)?x(n?.snap)?s.snap(n?.trackLength,n?.snap?.snapLength,Array.isArray(n?.snap?.threshold)?n?.snap.threshold:[n?.snap?.threshold]):s.identity(n?.trackLength):s.identity(),s.snap=(n=t,o=e,a)=>new i(n,o/n,a),s.identity=(n=t)=>new r(n);let t=128,e=24;class r{length;#t=NaN;#e=NaN;#s=1;constructor(o){this.length=o}begin(o){this.#e=this.#t=o}moveBy(o){E(!isNaN(this.#e),()=>"value has never been set"),this.#t+=o/this.length*this.#s,this.#e=d(this.#t,0,1)}ratio(o){this.#s=o}value(){return E(!isNaN(this.#e),()=>"value has never been set"),this.#e}disable(){}enable(){}}class i{#t;#e;#s;#r;#i=NaN;#n=NaN;#a=1;#o=!0;constructor(o,a,h){E(a>0,()=>`margin(${a}) must be greater then 0`),E(w.isSorted(h),()=>"thresholds are not sorted"),E(a<o,()=>`margin(${a}) must be lower then length(${o})`),this.#t=o,this.#e=a,this.#s=h,this.#r=h.map((l,u)=>l+u*this.#e)}begin(o){this.#o&&(this.#i=this.valueToX(o)),this.#n=o}moveBy(o){E(!isNaN(this.#n),()=>"value has never been set"),this.#i+=o/this.#t*this.#a,this.#n=this.#o?this.xToValue(this.#i):d(this.#i,0,1)}ratio(o){this.#a=o}value(){return E(!isNaN(this.#n),()=>"value has never been set"),this.#n}disable(){this.#o&&(this.#o=!1,this.#i=this.xToValue(this.#i))}enable(){this.#o||(this.#o=!0,this.#i=this.valueToX(this.#i))}valueToX(o){let a=v.rightMost(this.#s,o,Q);if(a<0)return o;{let h=this.#r[a],l=this.#s[a];return o===l?h+this.#e/2:h+this.#e+(o-l)}}xToValue(o){let a=d(o,0,1+this.#e*this.#s.length),h=v.rightMost(this.#r,a,Q);if(h<0)return a;{let l=this.#r[h],u=this.#s[h];return a>l+this.#e?a-(l+this.#e)+u:u}}get margin(){return this.#e}}})(Kt||(Kt={}));var it=Symbol.for("@openDAW/lib-std");globalThis[it]?console.debug(`%c${it.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[it]=!0,console.debug(`%c${it.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var Qt;(function(s){function t(e,r,i={}){let{interval:n=64,scanSteps:o=1024,scanSamples:a=2048,minBPM:h=90,maxBPM:l=180}=i,u=new Float32Array(Math.floor(e.length/n)),f=0,c=0,m=0;for(let g of e){let M=Math.abs(g);f+=(M-f)*(M>f?1/8:1/512),++c===n&&(c=0,u[m++]=f)}if(!u.length)return NaN;let y=(g,M)=>g[Math.floor(M)]??0,b=g=>r/(g/60)/n,N=g=>r/(g*n)*60,T=[-32,-16,-8,-4,-2,-1,1,2,4,8,16,32],I=[-.5,-.25,.25,.5],B=g=>{let M=Math.random()*u.length,L=y(u,M),at=0,ht=0;for(let W of T){let j=1/Math.abs(W);at+=j*Math.abs(y(u,M+W*g)-L),ht+=j}for(let W of I){let j=Math.abs(W);at-=j*Math.abs(y(u,M+W*g)-L),ht+=j}return at/ht},q=g=>{let M=0;for(let L=0;L<a;++L)M+=B(g);return M/a},z=b(h),G=b(l),U=(z-G)/o,Y=h,H=1/0;for(let g=G;g<=z;g+=U){let M=N(g),L=q(g)*(h/M);L<H&&(H=L,Y=M)}return Y}s.detect=t})(Qt||(Qt={}));var Xt;(function(s){s.Major=[0,2,4,5,7,9,11],s.Minor=[0,2,3,5,7,8,10],s.NoteLabels=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],s.compile=(t,e,r,i)=>w.create(n=>{let o=r+n*2,a=t[o%7]+Math.floor(o/7)*12;return e+a},i),s.toString=t=>s.NoteLabels[t%12]+(Math.floor(t/12)-2)})(Xt||(Xt={}));var qt;(function(s){s.Comparator=(t,e)=>t.position-e.position,s.PositionExtractor=t=>t.position})(qt||(qt={}));var X;(function(s){s.complete=t=>t.position+t.duration,s.DescendingComparator=(t,e)=>s.complete(e)-s.complete(t)})(X||(X={}));var Ut;(function(s){s.globalToLocal=(e,r)=>St(r-e.position+e.loopOffset,e.loopDuration),s.locateLoop=({position:e,complete:r,loopOffset:i,loopDuration:n},o,a)=>{let h=e-i,l=h+n;if(h>=a||l<=o)return A.None;let u=Math.max(h,o),f=Math.min(l,a);return A.wrap({index:0,rawStart:h,rawEnd:l,regionStart:Math.max(h,e),regionEnd:Math.min(l,r),resultStart:u,resultEnd:f,resultStartValue:h<u?(u-h)/n:0,resultEndValue:l>f?(f-h)/n:1})};function*t({position:e,complete:r,loopOffset:i,loopDuration:n},o,a){let h=e-i,l=Math.max(e,o),u=Math.min(r,a),f=Math.floor((l-h)/n),c=h+f*n;for(;c<u;){let m=c+n,y=Math.max(c,e),b=Math.min(m,r),N=Math.max(c,l),T=Math.min(m,u),I=c<N?(N-c)/n:0,B=m>T?(T-c)/n:1;yield{index:f++,rawStart:c,rawEnd:m,regionStart:y,regionEnd:b,resultStart:N,resultEnd:T,resultStartValue:I,resultEndValue:B},c=m}}s.locateLoops=t})(Ut||(Ut={}));var At=(s,t)=>Math.floor(3840/t)*s,Zt=(s,t=4,e=4)=>{let r=At(1,e),i=Math.floor(s/r),n=Math.floor(i/t),a=(Math.floor(s)-At(n*t,e))%r,h=Math.floor(a/240),l=a%240;return{bars:n,beats:i-n*t,semiquavers:h,ticks:l}},Jt=(s,t)=>s*t/60*960,te=(s,t)=>s*60/960/t,me=(s,t,e)=>Jt(s/e,t),de=(s,t,e)=>te(s,t)*e,ee={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:At,toParts:Zt,secondsToPulses:Jt,pulsesToSeconds:te,samplesToPulses:me,pulsesToSamples:de,toString:(s,t=4,e=4)=>{let{bars:r,beats:i,semiquavers:n,ticks:o}=Zt(s|0,t,e);return`${r+1}.${i+1}.${n+1}:${o}`}};var se;(function(s){s.builder=()=>new t,s.toDouble=([e,r])=>e/r,s.toPPQN=([e,r])=>ee.fromSignature(e,r);class t{#t=[];add(r){return this.#t.push(r),this}asArray(){return this.#t}asAscendingArray(){return this.#t.toSorted((r,i)=>s.toDouble(r)-s.toDouble(i))}asDescendingArray(){return this.#t.toSorted((r,i)=>s.toDouble(i)-s.toDouble(r))}}})(se||(se={}));var re;(function(s){s.Identity={warp:t=>t,unwarp:t=>t}})(re||(re={}));var ie;(function(s){s.BlackKeyIndices=[1,3,6,8,10],s.BlackKeyBits=s.BlackKeyIndices.reduce((e,r)=>e|=1<<r,0),s.Names={English:["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],German:["C","Cis","D","Dis","E","F","Fis","G","Gis","A","Ais","H"],Solfege:["Do","Do#","R\xE9","R\xE9#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],French:["Do","Do#","R\xE9","R\xE9#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],Spanish:["Do","Do#","Re","Re#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],Japanese:["\u30C9","\u30C9\u266F","\u30EC","\u30EC\u266F","\u30DF","\u30D5\u30A1","\u30D5\u30A1\u266F","\u30BD","\u30BD\u266F","\u30E9","\u30E9\u266F","\u30B7"]},s.isBlackKey=e=>(s.BlackKeyBits&1<<e%12)!==0,s.toFullString=e=>`${s.Names.English[e%12]}${Math.floor(e/12)-2}`;class t{#t;#e;constructor(r,...i){this.#t=r,this.#e=i.reduce((n,o)=>n|=1<<o,0)}get name(){return this.#t}get bits(){return this.#e}has(r){return(this.#e&1<<r%12)!==0}equals(r){return this.#e===r.bits}}s.StockScales=[new t("Major",0,2,4,5,7,9,11),new t("Natural Minor",0,2,3,5,7,8,10),new t("Harmonic Minor",0,2,3,5,7,8,11),new t("Melodic Minor",0,2,3,5,7,9,11),new t("Dorian",0,2,3,5,7,9,10),new t("Phrygian",0,1,3,5,7,8,10),new t("Lydian",0,2,4,6,7,9,11),new t("Mixolydian",0,2,4,5,7,9,10),new t("Locrian",0,1,3,5,6,8,10),new t("Pentatonic Major",0,2,4,7,9),new t("Pentatonic Minor",0,3,5,7,10),new t("Blues",0,3,5,6,7,10),new t("Whole Tone",0,2,4,6,8,10),new t("Diminished",0,2,3,5,6,8,9,11),new t("Augmented",0,3,4,7,8,11)]})(ie||(ie={}));var ne;(function(s){s.isOfType=t=>t.type==="note-event",s.Comparator=(t,e)=>{let r=t.position-e.position;if(r!==0)return r;let i=t.pitch-e.pitch;return i!==0?i:0},s.curveFunc=(t,e)=>e<0?t**2**-e:1-(1-t)**2**e,s.inverseCurveFunc=(t,e)=>e<0?t**2**e:1-Math.max(0,1-t)**2**-e,s.CompleteComparator=(t,e)=>{let r=X.complete(t)-X.complete(e);return r!==0?r:t.pitch-e.pitch}})(ne||(ne={}));var oe;(function(s){s[s.sine=0]="sine",s[s.triangle=1]="triangle",s[s.sawtooth=2]="sawtooth",s[s.square=3]="square"})(oe||(oe={}));var _;(function(s){let t;(function(e){e[e.Linear=0]="Linear",e[e.EqualPower=1]="EqualPower"})(t=s.Mixing||(s.Mixing={})),s.zero=()=>({ll:0,lr:0,rl:0,rr:0}),s.identity=()=>({ll:1,lr:0,rl:0,rr:1}),s.update=(e,{gain:r,panning:i,invertL:n,invertR:o,stereo:a,swap:h},l=t.EqualPower)=>{let[u,f]=s.panningToGains(i,l),c=u*r,m=f*r;n&&(c*=-1),o&&(m*=-1);let y=Math.max(0,-a),b=Math.max(0,a),N=1-b,T=1+b,I=y*.5,B=1-y,q=(N+T)*.5,z=(N-T)*.5,G=(N-T)*.5,U=(N+T)*.5,Y=c*(I+B)*q+m*I*z,H=c*(I+B)*G+m*I*U,g=c*I*q+m*(I+B)*z,M=c*I*G+m*(I+B)*U;h?(e.ll=H,e.rl=Y,e.lr=M,e.rr=g):(e.ll=Y,e.lr=g,e.rl=H,e.rr=M)},s.panningToGains=(e,r)=>{let i=d(e,-1,1);switch(r){case t.Linear:return[Math.min(1-i,1),Math.min(i+1,1)];case t.EqualPower:return[Math.cos((i+1)*ct),Math.sin((i+1)*ct)]}},s.applyFrame=(e,r,i)=>[e.ll*r+e.rl*i,e.lr*r+e.rr*i],s.processFrames=(e,r,i,n,o)=>{let[a,h]=r,[l,u]=i;for(let f=n;f<o;f++){let c=a[f],m=h[f];l[f]=e.ll*c+e.rl*m,u[f]=e.lr*c+e.rr*m}},s.replaceFrames=(e,[r,i],n,o)=>{for(let a=n;a<o;a++){let h=r[a],l=i[a];r[a]=e.ll*h+e.rl*l,i[a]=e.lr*h+e.rr*l}}})(_||(_={}));var ae;(function(s){s.linear=(r,i=.005)=>new t(Math.ceil(r*i)|0),s.stereoMatrix=(r,i=.005)=>new e(Math.ceil(r*i)|0);class t{#t;#e=0;#s=0;#r=0;#i=0;constructor(i){this.#t=i}set(i,n){this.#e!==i&&(n===!0?(this.#s=i,this.#r=(i-this.#e)/this.#t,this.#i=this.#t):(this.#e=this.#s=i,this.#r=0,this.#i=0))}get(){return this.#e}moveAndGet(){return 0<this.#i&&(this.#e+=this.#r,--this.#i===0&&(this.#r=0,this.#e=this.#s)),this.#e}isFixed(i){return this.#e===i&&this.#i===0}isInterpolating(){return this.#i>0}}class e{#t;#e=_.zero();#s=_.zero();#r=_.zero();#i=0;constructor(i){this.#t=i}update(i,n,o){_.update(this.#s,i,n),o===!0?(this.#r.ll=(this.#s.ll-this.#e.ll)/this.#t,this.#r.lr=(this.#s.lr-this.#e.lr)/this.#t,this.#r.rl=(this.#s.rl-this.#e.rl)/this.#t,this.#r.rr=(this.#s.rr-this.#e.rr)/this.#t,this.#i=this.#t):(this.#e.ll=this.#s.ll,this.#e.lr=this.#s.lr,this.#e.rl=this.#s.rl,this.#e.rr=this.#s.rr,this.#r.ll=0,this.#r.lr=0,this.#r.rl=0,this.#r.rr=0,this.#i=0)}processFrames(i,n,o,a){let[h,l]=i,[u,f]=n;if(this.isInterpolating())for(let c=o;c<a;c++){let m=h[c],y=l[c],b=this.moveAndGet();u[c]=b.ll*m+b.rl*y,f[c]=b.lr*m+b.rr*y}else{let c=this.#s;for(let m=o;m<a;m++){let y=h[m],b=l[m];u[m]=c.ll*y+c.rl*b,f[m]=c.lr*y+c.rr*b}}}set(i,n){this.#n(i)||(n===!0?(this.#s.ll=i.ll,this.#s.lr=i.lr,this.#s.rl=i.rl,this.#s.rr=i.rr,this.#r.ll=(i.ll-this.#e.ll)/this.#t,this.#r.lr=(i.lr-this.#e.lr)/this.#t,this.#r.rl=(i.rl-this.#e.rl)/this.#t,this.#r.rr=(i.rr-this.#e.rr)/this.#t,this.#i=this.#t):(this.#e.ll=this.#s.ll=i.ll,this.#e.lr=this.#s.lr=i.lr,this.#e.rl=this.#s.rl=i.rl,this.#e.rr=this.#s.rr=i.rr,this.#r.ll=0,this.#r.lr=0,this.#r.rl=0,this.#r.rr=0,this.#i=0))}get(){return this.#e}moveAndGet(){return 0<this.#i&&(this.#e.ll+=this.#r.ll,this.#e.lr+=this.#r.lr,this.#e.rl+=this.#r.rl,this.#e.rr+=this.#r.rr,--this.#i===0&&(this.#r.ll=0,this.#r.lr=0,this.#r.rl=0,this.#r.rr=0,this.#e.ll=this.#s.ll,this.#e.lr=this.#s.lr,this.#e.rl=this.#s.rl,this.#e.rr=this.#s.rr)),this.#e}isFixed(i){return this.#n(i)&&this.#i===0}isInterpolating(){return this.#i>0}#n(i){return this.#e.ll===i.ll&&this.#e.lr===i.lr&&this.#e.rl===i.rl&&this.#e.rr===i.rr}}s.StereoMatrixRamp=e})(ae||(ae={}));var nt=class{#t;#e;#s;#r;constructor(t){this.#t=new Float32Array(t),this.#e=1/t,this.#s=0,this.#r=0}pushPop(t){let e=t*t;return this.#r-=this.#t[this.#s],this.#r+=e,this.#t[this.#s]=e,++this.#s===this.#t.length&&(this.#s=0),this.#r<=0?0:Math.sqrt(this.#r*this.#e)}clear(){this.#t.fill(0),this.#r=0,this.#s=0}};var Ui=Math.log(10)/20;var he={None:{type:"none"},Linear:{type:"linear"},Curve:s=>({type:"curve",slope:s})},le;(function(s){s.Comparator=(i,n)=>{let o=i.position-n.position;if(o!==0)return o;let a=i.index-n.index;return a!==0?a:i===n?0:p(`${i} and ${n} are identical in terms of comparison`)};function*t(i,n,o){if(i.isEmpty())return R.empty();for(let a of i.iterateFrom(n))if(yield a,a.position>=o)return}s.iterateWindow=t,s.nextEvent=(i,n)=>{let o=i.asArray(),a=v.rightMost(o,n,s.Comparator);return a===-1?null:o[a+1]??null},s.valueAt=(i,n,o)=>{if(i.isEmpty())return o;let a=i.iterateFrom(n),{done:h,value:l}=a.next();if(h)return o;if(l.position<=n){let{done:u,value:f}=a.next();if(u)return l.value;if(n<f.position)return r(l,f,n);if(l.interpolation===he.None)return l.value}return l.value};function*e(i,n,o,a){if(i.isEmpty())return;let h=i.iterateFrom(n),{done:l,value:u}=h.next();if(l)return;let f=o/a,c=u;if(c.position>n){for(;n<c.position;)if(yield{position:n,value:c.value},n+=f,n>o)return;c.position<=o&&(yield c)}for(;n<=o;){let{done:m,value:y}=h.next();if(m)break;for(;n<y.position;){if(n>o)return;yield{position:n,value:r(c,y,n)},n+=f}y.position<o&&(c.interpolation===he.None&&(yield{position:y.position,value:c.value}),yield y),c=y}for(;n<=o;)yield{position:n,value:c.value},n+=f}s.quantise=e;let r=({value:i,position:n,interpolation:o},a,h)=>o.type==="none"?i:o.type==="linear"?i+(h-n)/(a.position-n)*(a.value-i):o.type==="curve"?Z.valueAt({slope:o.slope,steps:a.position-n,y0:i,y1:a.value},h-n):p("Unknown interpolation")})(le||(le={}));var ce;(function(s){let t;(function(e){e[e.Bartlett=0]="Bartlett",e[e.Blackman=1]="Blackman",e[e.BlackmanHarris=2]="BlackmanHarris",e[e.Hamming=3]="Hamming",e[e.Hanning=4]="Hanning"})(t=s.Type||(s.Type={})),s.create=(e,r)=>{let i=new Float32Array(r),n=Math.PI/(r-1);switch(e){case t.Bartlett:{let o=(r>>1)-1,a=0;for(;a<=o;++a)i[a]=2*a/(r-1);for(;a<r;++a)i[a]=2-2*a/(r-1);return i}case t.Blackman:{let o=2*n,a=4*n;for(let h=0;h<r;++h)i[h]=.42323-.49755*Math.cos(o*h)+.07922*Math.cos(a*h);return i}case t.BlackmanHarris:{let o=2*n,a=4*n,h=6*n;for(let l=0;l<r;++l)i[l]=.35875-.48829*Math.cos(o*l)+.14128*Math.cos(a*l)-.01168*Math.cos(h*l);return i}case t.Hamming:{let o=2*n;for(let a=0;a<r;++a)i[a]=.54-.46*Math.cos(o*a);return i}case t.Hanning:{let o=2*n;for(let a=0;a<r;++a)i[a]=.5-.5*Math.cos(o*a);return i}}}})(ce||(ce={}));var ot=Symbol.for("@openDAW/lib-dsp");globalThis[ot]?console.debug(`%c${ot.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[ot]=!0,console.debug(`%c${ot.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));registerProcessor("peak-meter-processor",class extends AudioWorkletProcessor{#t;#e;#s;#r;#i;#n=0;constructor({processorOptions:{sab:s,numberOfChannels:t,rmsWindowInSeconds:e,valueDecay:r}}){super(),this.#t=t,this.#e=new Float32Array(t),this.#s=new Float32Array(t),this.#r=w.create(()=>new nt(sampleRate*e),t);let i=V.createBuilder({peak:V.floats(t),rms:V.floats(t)})();this.#i=rt.writer(i,s,n=>{let o=Math.exp(-(128*this.#n)/(sampleRate*r));for(let a=0;a<t;++a){let h=this.#e[a],l=this.#s[a];n.peak[a]=h,n.rms[a]=Math.sqrt(l),this.#e[a]=h*o,this.#s[a]=l*o}this.#n=0})}process([s]){for(let t=0;t<this.#t;++t){let e=s[t];if(e===void 0)this.#e[t]=0,this.#s[t]=0;else{let r=this.#r[t],i=this.#e[t],n=this.#s[t];for(let o=0;o<128;++o){let a=e[o];i=Math.max(i,Math.abs(a)),n=Math.max(n,r.pushPop(a*a))}this.#e[t]=i,this.#s[t]=n}}return this.#n++,this.#i.tryWrite(),!0}});
|
2
|
-
//# sourceMappingURL=meter-processor.js.map
|