@vessel-dsp/runtime 0.4.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/taper.d.ts CHANGED
@@ -1,10 +1,38 @@
1
- import type { TaperKind } from "@vessel-dsp/compiler";
1
+ import type { Program, TaperKind } from "@vessel-dsp/compiler";
2
+ /** The closed vocabulary as text, for refusals that name what a console could have read. */
3
+ export declare const IMPLEMENTED_TAPER_NAMES: readonly string[];
4
+ /**
5
+ * A taper a program names and this runtime does not implement, and where it names it.
6
+ *
7
+ * `taper` is `string`, not `TaperKind`: a program that arrived through `decode` was cast from
8
+ * JSON, so what it names is untrusted text from another producer, possibly a newer compiler.
9
+ */
10
+ export type UnrecognisedTaper = {
11
+ readonly where: string;
12
+ readonly taper: string;
13
+ };
14
+ /**
15
+ * Every taper in `program` that is not one of the five this runtime implements.
16
+ *
17
+ * **Why this exists: a taper string used to be read by falling through to linear.** An unknown
18
+ * name played the wrong curve in silence on both consoles, which is the outcome the
19
+ * console/ROM contract forbids ("an operator the runtime does not implement is a refusal that
20
+ * names it, never silence"). `requiredOperators` cannot carry it: it is typed by stamp kind. So
21
+ * the vocabulary is checked where the program is loaded, at the three places a program names a
22
+ * taper -- a control, an MNA stamp, a macro or composed block's `clockControl` -- the same three
23
+ * the C++ loader reads.
24
+ */
25
+ export declare function unrecognisedTapers(program: Program): readonly UnrecognisedTaper[];
2
26
  /**
3
27
  * The fraction of the track at `position`, clamped to 0..1.
4
28
  *
5
29
  * `reverse-linear` is a real track (`klon-centaur`, `vemuram-jan-ray`) and is not the
6
30
  * same device as `reverse-logarithmic`: it is linear travelling the other way, so half
7
31
  * rotation is half the track rather than a tenth of it.
32
+ *
33
+ * A taper outside the five implemented is read as linear here only because this is a pure
34
+ * function with no way to refuse; a program is refused before it can reach it
35
+ * (`unrecognisedTapers`, checked at `prepare()`).
8
36
  */
9
37
  export declare function taperFraction(taper: TaperKind, position: number): number;
10
38
  //# sourceMappingURL=taper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"taper.d.ts","sourceRoot":"","sources":["../src/taper.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAoBxE"}
1
+ {"version":3,"file":"taper.d.ts","sourceRoot":"","sources":["../src/taper.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAiB/D,4FAA4F;AAC5F,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAAoC,CAAC;AAE1F;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,iBAAiB,EAAE,CA0BjF;AAsDD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAuBxE"}
package/dist/taper.js CHANGED
@@ -7,12 +7,124 @@
7
7
  // unviolable by construction: a stage cannot evaluate a function it does not contain.
8
8
  //
9
9
  // Two front ends therefore cannot disagree about a knob's curve, because neither owns it.
10
+ /**
11
+ * The tapers this runtime implements: the whole of `TaperKind`, and nothing else.
12
+ *
13
+ * A record, so a new `TaperKind` is a compile error here until someone decides whether this
14
+ * console executes it; `satisfies` also rejects an entry `TaperKind` does not have. The C++
15
+ * console's `parseTaperKind` holds the same five names and refuses everything else.
16
+ */
17
+ const IMPLEMENTED_TAPERS = {
18
+ linear: true,
19
+ logarithmic: true,
20
+ "reverse-logarithmic": true,
21
+ "reverse-linear": true,
22
+ "s-curve": true,
23
+ };
24
+ /** The closed vocabulary as text, for refusals that name what a console could have read. */
25
+ export const IMPLEMENTED_TAPER_NAMES = Object.keys(IMPLEMENTED_TAPERS);
26
+ /**
27
+ * Every taper in `program` that is not one of the five this runtime implements.
28
+ *
29
+ * **Why this exists: a taper string used to be read by falling through to linear.** An unknown
30
+ * name played the wrong curve in silence on both consoles, which is the outcome the
31
+ * console/ROM contract forbids ("an operator the runtime does not implement is a refusal that
32
+ * names it, never silence"). `requiredOperators` cannot carry it: it is typed by stamp kind. So
33
+ * the vocabulary is checked where the program is loaded, at the three places a program names a
34
+ * taper -- a control, an MNA stamp, a macro or composed block's `clockControl` -- the same three
35
+ * the C++ loader reads.
36
+ */
37
+ export function unrecognisedTapers(program) {
38
+ const found = [];
39
+ const check = (where, taper) => {
40
+ // A key that is absent names nothing, and both consoles read it as linear (the C++
41
+ // loader's `readTaperKind`). Present and not one of the five, `null` and `""` included,
42
+ // is a name this runtime does not implement.
43
+ if (taper === undefined)
44
+ return;
45
+ if (typeof taper !== "string" || !Object.hasOwn(IMPLEMENTED_TAPERS, taper)) {
46
+ found.push({ where, taper: String(taper) });
47
+ }
48
+ };
49
+ for (const control of program.controls) {
50
+ check(`control "${control.id}"`, control.taper);
51
+ }
52
+ for (const block of program.blocks) {
53
+ if (block.kind === "mna") {
54
+ for (const stamp of block.stamps) {
55
+ if ("taper" in stamp) {
56
+ check(`${stamp.kind} stamp in block "${block.id}"`, stamp.taper);
57
+ }
58
+ }
59
+ }
60
+ else if (block.clockControl != null) {
61
+ check(`clockControl of block "${block.id}"`, block.clockControl.taper);
62
+ }
63
+ }
64
+ return found;
65
+ }
66
+ /**
67
+ * Alpha RV16AF W(4B), the one S-curve a vendor sheet on file prints (SP16050157 p. 4 section
68
+ * 2.4, terminal 1-2, of the 300-degree rotation stated on p. 3 section 1.1):
69
+ *
70
+ * 90 +- 5 degrees 5-15 % -> 0.30 of rotation, nominal 0.10
71
+ * 150 degrees 40-60 % -> 0.50 of rotation, nominal 0.50
72
+ * 210 +- 5 degrees 85-95 % -> 0.70 of rotation, nominal 0.90
73
+ *
74
+ * The sheet prints bands, not typicals; the nominal is each band's midpoint, the same rule that
75
+ * puts the A taper at 0.175 (the midpoint of 10-25 %). **The shape between the points is an
76
+ * engine convention, not a printed fact**: a monotone cubic Hermite (the PCHIP rule) through
77
+ * (0, 0), (0.30, 0.10), (0.50, 0.50), (0.70, 0.90), (1, 1) with zero slope at the stops. Only the
78
+ * printed points and the stops are claims; a piecewise-linear interpolant through the same five
79
+ * points would read 0.033 where this reads 0.013 at 10 % of rotation, and the sheet cannot say
80
+ * which is right.
81
+ *
82
+ * The interior slopes are the Fritsch-Butland weighted harmonic mean of the neighbouring
83
+ * secants, computed once and written as literals so that this file and `Engine.cpp` evaluate
84
+ * identical numbers in identical order (`taper.test.ts` re-derives them from the knots):
85
+ *
86
+ * knot 0.30: h = (0.3, 0.2), secants (1/3, 2), weights (0.7, 0.8): 1.5 / (2.1 + 0.4) = 0.6
87
+ * knot 0.50: equal secants of 2: 2
88
+ * knot 0.70: the mirror of 0.30: 0.6
89
+ *
90
+ * The curve is odd about the centre (`f(1 - x) = 1 - f(x)`), so which end of the track a
91
+ * lug sits on does not change the law, only the orientation, which is a separate claim.
92
+ * No `pow` and no libm: only `+ - * /`, so the two consoles agree bit for bit.
93
+ */
94
+ const S_CURVE_SEGMENTS = [
95
+ { x0: 0, h: 0.3, y0: 0, y1: 0.1, m0: 0, m1: 0.6 },
96
+ { x0: 0.3, h: 0.2, y0: 0.1, y1: 0.5, m0: 0.6, m1: 2 },
97
+ { x0: 0.5, h: 0.2, y0: 0.5, y1: 0.9, m0: 2, m1: 0.6 },
98
+ { x0: 0.7, h: 0.3, y0: 0.9, y1: 1, m0: 0.6, m1: 0 },
99
+ ];
100
+ function sCurveFraction(x) {
101
+ // The stops are exact, and each interior knot is the t = 0 of its own segment, so the
102
+ // three printed midpoints come back as exactly 0.1, 0.5 and 0.9.
103
+ if (x <= 0)
104
+ return 0;
105
+ if (x >= 1)
106
+ return 1;
107
+ const segment = x < 0.3 ? 0 : x < 0.5 ? 1 : x < 0.7 ? 2 : 3;
108
+ const { x0, h, y0, y1, m0, m1 } = S_CURVE_SEGMENTS[segment];
109
+ const t = (x - x0) / h;
110
+ const t2 = t * t;
111
+ const t3 = t2 * t;
112
+ const h00 = 2 * t3 - 3 * t2 + 1;
113
+ const h10 = t3 - 2 * t2 + t;
114
+ const h01 = -2 * t3 + 3 * t2;
115
+ const h11 = t3 - t2;
116
+ return h00 * y0 + h10 * h * m0 + h01 * y1 + h11 * h * m1;
117
+ }
10
118
  /**
11
119
  * The fraction of the track at `position`, clamped to 0..1.
12
120
  *
13
121
  * `reverse-linear` is a real track (`klon-centaur`, `vemuram-jan-ray`) and is not the
14
122
  * same device as `reverse-logarithmic`: it is linear travelling the other way, so half
15
123
  * rotation is half the track rather than a tenth of it.
124
+ *
125
+ * A taper outside the five implemented is read as linear here only because this is a pure
126
+ * function with no way to refuse; a program is refused before it can reach it
127
+ * (`unrecognisedTapers`, checked at `prepare()`).
16
128
  */
17
129
  export function taperFraction(taper, position) {
18
130
  const x = Math.min(1, Math.max(0, position));
@@ -33,6 +145,9 @@ export function taperFraction(taper, position) {
33
145
  if (taper === "reverse-linear") {
34
146
  return 1 - x;
35
147
  }
148
+ if (taper === "s-curve") {
149
+ return sCurveFraction(x);
150
+ }
36
151
  return x;
37
152
  }
38
153
  //# sourceMappingURL=taper.js.map
package/dist/taper.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"taper.js","sourceRoot":"","sources":["../src/taper.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,EAAE;AACF,mFAAmF;AACnF,qFAAqF;AACrF,wFAAwF;AACxF,kFAAkF;AAClF,sFAAsF;AACtF,EAAE;AACF,0FAA0F;AAI1F;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,KAAgB,EAAE,QAAgB;IAC/D,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IACzD,CAAC;IACD,IAAI,KAAK,KAAK,gBAAgB,EAAE,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,CAAC;IACd,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,CAAC,CAAC;AACV,CAAC"}
@@ -6,7 +6,7 @@ var createV2DspModule = (() => {
6
6
  function(moduleArg = {}) {
7
7
  var moduleRtn;
8
8
 
9
- var Module=moduleArg;var readyPromiseResolve,readyPromiseReject;var readyPromise=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject});var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope!="undefined";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";if(ENVIRONMENT_IS_NODE){}var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");var nodePath=require("path");scriptDirectory=__dirname+"/";readBinary=filename=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename);return ret};readAsync=async(filename,binary=true)=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename,binary?undefined:"utf8");return ret};if(!Module["thisProgram"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptName){scriptDirectory=_scriptName}if(scriptDirectory.startsWith("blob:")){scriptDirectory=""}else{scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}{if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{if(isFileURI(url)){return new Promise((resolve,reject)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){resolve(xhr.response);return}reject(xhr.status)};xhr.onerror=reject;xhr.send(null)})}var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.error.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];var wasmBinary=Module["wasmBinary"];var wasmMemory;var ABORT=false;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module["HEAP8"]=HEAP8=new Int8Array(b);Module["HEAP16"]=HEAP16=new Int16Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAPU16"]=HEAPU16=new Uint16Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);Module["HEAPF64"]=HEAPF64=new Float64Array(b)}var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;Module["monitorRunDependencies"]?.(runDependencies)}function removeRunDependency(id){runDependencies--;Module["monitorRunDependencies"]?.(runDependencies);if(runDependencies==0){if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){Module["onAbort"]?.(what);what="Aborted("+what+")";err(what);ABORT=true;what+=". Build with -sASSERTIONS for more info.";if(runtimeInitialized){___trap()}var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";var isDataURI=filename=>filename.startsWith(dataURIPrefix);var isFileURI=filename=>filename.startsWith("file://");function findWasmBinary(){var f="v2_dsp.wasm";if(!isDataURI(f)){return locateFile(f)}return f}var wasmBinaryFile;function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(binaryFile){if(!wasmBinary){try{var response=await readAsync(binaryFile);return new Uint8Array(response)}catch{}}return getBinarySync(binaryFile)}async function instantiateArrayBuffer(binaryFile,imports){try{var binary=await getWasmBinary(binaryFile);var instance=await WebAssembly.instantiate(binary,imports);return instance}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)}}async function instantiateAsync(binary,binaryFile,imports){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){try{var response=fetch(binaryFile,{credentials:"same-origin"});var instantiationResult=await WebAssembly.instantiateStreaming(response,imports);return instantiationResult}catch(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation")}}return instantiateArrayBuffer(binaryFile,imports)}function getWasmImports(){return{a:wasmImports}}async function createWasm(){function receiveInstance(instance,module){wasmExports=instance.exports;wasmMemory=wasmExports["d"];updateMemoryViews();addOnInit(wasmExports["e"]);removeRunDependency("wasm-instantiate");return wasmExports}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}var info=getWasmImports();if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err(`Module.instantiateWasm callback failed with error: ${e}`);readyPromiseReject(e)}}wasmBinaryFile??=findWasmBinary();try{var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);receiveInstantiationResult(result);return result}catch(e){readyPromiseReject(e);return}}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};function getValue(ptr,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":return HEAP8[ptr];case"i8":return HEAP8[ptr];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];case"*":return HEAPU32[ptr>>2];default:abort(`invalid type for getValue: ${type}`)}}var noExitRuntime=Module["noExitRuntime"]||true;function setValue(ptr,value,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":HEAP8[ptr]=value;break;case"i8":HEAP8[ptr]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;case"*":HEAPU32[ptr>>2]=value;break;default:abort(`invalid type for setValue: ${type}`)}}var __abort_js=()=>abort("");var __emscripten_memcpy_js=(dest,src,num)=>HEAPU8.copyWithin(dest,src,src+num);var getHeapMax=()=>2147483648;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var b=wasmMemory.buffer;var pages=(size-b.byteLength+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var getCFunc=ident=>{var func=Module["_"+ident];return func};var writeArrayToMemory=(array,buffer)=>{HEAP8.set(array,buffer)};var lengthBytesUTF8=str=>{var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);var stackAlloc=sz=>__emscripten_stack_alloc(sz);var stringToUTF8OnStack=str=>{var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret};var stackSave=()=>_emscripten_stack_get_current();var stackRestore=val=>__emscripten_stack_restore(val);var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder:undefined;var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead=NaN)=>{var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"";var ccall=(ident,returnType,argTypes,args,opts)=>{var toC={string:str=>{var ret=0;if(str!==null&&str!==undefined&&str!==0){ret=stringToUTF8OnStack(str)}return ret},array:arr=>{var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string"){return UTF8ToString(ret)}if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func(...cArgs);function onDone(ret){if(stack!==0)stackRestore(stack);return convertReturnValue(ret)}ret=onDone(ret);return ret};var cwrap=(ident,returnType,argTypes,opts)=>{var numericArgs=!argTypes||argTypes.every(type=>type==="number"||type==="boolean");var numericRet=returnType!=="string";if(numericRet&&numericArgs&&!opts){return getCFunc(ident)}return(...args)=>ccall(ident,returnType,argTypes,args,opts)};var wasmImports={a:__abort_js,c:__emscripten_memcpy_js,b:_emscripten_resize_heap};var wasmExports;createWasm();var ___wasm_call_ctors=()=>(___wasm_call_ctors=wasmExports["e"])();var _v2_engine_create=Module["_v2_engine_create"]=()=>(_v2_engine_create=Module["_v2_engine_create"]=wasmExports["g"])();var _v2_engine_destroy=Module["_v2_engine_destroy"]=a0=>(_v2_engine_destroy=Module["_v2_engine_destroy"]=wasmExports["h"])(a0);var _v2_engine_load_json=Module["_v2_engine_load_json"]=(a0,a1)=>(_v2_engine_load_json=Module["_v2_engine_load_json"]=wasmExports["i"])(a0,a1);var _v2_engine_prepare=Module["_v2_engine_prepare"]=(a0,a1,a2,a3,a4)=>(_v2_engine_prepare=Module["_v2_engine_prepare"]=wasmExports["j"])(a0,a1,a2,a3,a4);var _v2_engine_get_host_sample_rate=Module["_v2_engine_get_host_sample_rate"]=a0=>(_v2_engine_get_host_sample_rate=Module["_v2_engine_get_host_sample_rate"]=wasmExports["k"])(a0);var _v2_engine_get_oversample_latency=Module["_v2_engine_get_oversample_latency"]=a0=>(_v2_engine_get_oversample_latency=Module["_v2_engine_get_oversample_latency"]=wasmExports["l"])(a0);var _v2_resample_stage_count=Module["_v2_resample_stage_count"]=()=>(_v2_resample_stage_count=Module["_v2_resample_stage_count"]=wasmExports["m"])();var _v2_resample_prototype_length=Module["_v2_resample_prototype_length"]=a0=>(_v2_resample_prototype_length=Module["_v2_resample_prototype_length"]=wasmExports["n"])(a0);var _v2_resample_prototype_tap=Module["_v2_resample_prototype_tap"]=(a0,a1)=>(_v2_resample_prototype_tap=Module["_v2_resample_prototype_tap"]=wasmExports["o"])(a0,a1);var _v2_testonly_resample_create=Module["_v2_testonly_resample_create"]=a0=>(_v2_testonly_resample_create=Module["_v2_testonly_resample_create"]=wasmExports["p"])(a0);var _v2_testonly_resample_reset=Module["_v2_testonly_resample_reset"]=a0=>(_v2_testonly_resample_reset=Module["_v2_testonly_resample_reset"]=wasmExports["q"])(a0);var _v2_testonly_resample_process=Module["_v2_testonly_resample_process"]=(a0,a1)=>(_v2_testonly_resample_process=Module["_v2_testonly_resample_process"]=wasmExports["r"])(a0,a1);var _v2_testonly_resample_destroy=Module["_v2_testonly_resample_destroy"]=a0=>(_v2_testonly_resample_destroy=Module["_v2_testonly_resample_destroy"]=wasmExports["s"])(a0);var _v2_engine_reset=Module["_v2_engine_reset"]=a0=>(_v2_engine_reset=Module["_v2_engine_reset"]=wasmExports["t"])(a0);var _v2_engine_set_control=Module["_v2_engine_set_control"]=(a0,a1,a2)=>(_v2_engine_set_control=Module["_v2_engine_set_control"]=wasmExports["u"])(a0,a1,a2);var _v2_engine_get_control=Module["_v2_engine_get_control"]=(a0,a1)=>(_v2_engine_get_control=Module["_v2_engine_get_control"]=wasmExports["v"])(a0,a1);var _v2_engine_set_supply=Module["_v2_engine_set_supply"]=(a0,a1,a2,a3,a4)=>(_v2_engine_set_supply=Module["_v2_engine_set_supply"]=wasmExports["w"])(a0,a1,a2,a3,a4);var _v2_engine_process_sample=Module["_v2_engine_process_sample"]=(a0,a1)=>(_v2_engine_process_sample=Module["_v2_engine_process_sample"]=wasmExports["x"])(a0,a1);var _v2_engine_process_block=Module["_v2_engine_process_block"]=(a0,a1,a2,a3)=>(_v2_engine_process_block=Module["_v2_engine_process_block"]=wasmExports["y"])(a0,a1,a2,a3);var _v2_engine_get_input_buffer=Module["_v2_engine_get_input_buffer"]=(a0,a1)=>(_v2_engine_get_input_buffer=Module["_v2_engine_get_input_buffer"]=wasmExports["z"])(a0,a1);var _v2_engine_get_output_buffer=Module["_v2_engine_get_output_buffer"]=(a0,a1)=>(_v2_engine_get_output_buffer=Module["_v2_engine_get_output_buffer"]=wasmExports["A"])(a0,a1);var _v2_engine_process_internal=Module["_v2_engine_process_internal"]=(a0,a1)=>(_v2_engine_process_internal=Module["_v2_engine_process_internal"]=wasmExports["B"])(a0,a1);var _v2_engine_get_last_iteration_count=Module["_v2_engine_get_last_iteration_count"]=a0=>(_v2_engine_get_last_iteration_count=Module["_v2_engine_get_last_iteration_count"]=wasmExports["C"])(a0);var _v2_engine_get_last_converged=Module["_v2_engine_get_last_converged"]=a0=>(_v2_engine_get_last_converged=Module["_v2_engine_get_last_converged"]=wasmExports["D"])(a0);var _v2_engine_get_max_iterations=Module["_v2_engine_get_max_iterations"]=a0=>(_v2_engine_get_max_iterations=Module["_v2_engine_get_max_iterations"]=wasmExports["E"])(a0);var _v2_engine_get_operating_point=Module["_v2_engine_get_operating_point"]=(a0,a1,a2)=>(_v2_engine_get_operating_point=Module["_v2_engine_get_operating_point"]=wasmExports["F"])(a0,a1,a2);var _v2_engine_get_state=Module["_v2_engine_get_state"]=(a0,a1,a2)=>(_v2_engine_get_state=Module["_v2_engine_get_state"]=wasmExports["G"])(a0,a1,a2);var _v2_engine_get_last_error=Module["_v2_engine_get_last_error"]=a0=>(_v2_engine_get_last_error=Module["_v2_engine_get_last_error"]=wasmExports["H"])(a0);var _v2_engine_get_schedule_solves=Module["_v2_engine_get_schedule_solves"]=a0=>(_v2_engine_get_schedule_solves=Module["_v2_engine_get_schedule_solves"]=wasmExports["I"])(a0);var _v2_engine_get_schedule_fallbacks=Module["_v2_engine_get_schedule_fallbacks"]=a0=>(_v2_engine_get_schedule_fallbacks=Module["_v2_engine_get_schedule_fallbacks"]=wasmExports["J"])(a0);var _v2_engine_get_predictor_seeds=Module["_v2_engine_get_predictor_seeds"]=a0=>(_v2_engine_get_predictor_seeds=Module["_v2_engine_get_predictor_seeds"]=wasmExports["K"])(a0);var _v2_engine_get_one_iteration_solves=Module["_v2_engine_get_one_iteration_solves"]=a0=>(_v2_engine_get_one_iteration_solves=Module["_v2_engine_get_one_iteration_solves"]=wasmExports["L"])(a0);var _v2_engine_get_total_iterations=Module["_v2_engine_get_total_iterations"]=a0=>(_v2_engine_get_total_iterations=Module["_v2_engine_get_total_iterations"]=wasmExports["M"])(a0);var _v2_engine_get_predictor_order=Module["_v2_engine_get_predictor_order"]=(a0,a1)=>(_v2_engine_get_predictor_order=Module["_v2_engine_get_predictor_order"]=wasmExports["N"])(a0,a1);var _v2_engine_get_kernel_solves=Module["_v2_engine_get_kernel_solves"]=a0=>(_v2_engine_get_kernel_solves=Module["_v2_engine_get_kernel_solves"]=wasmExports["O"])(a0);var _v2_engine_get_repivoted_schedule_blocks=Module["_v2_engine_get_repivoted_schedule_blocks"]=a0=>(_v2_engine_get_repivoted_schedule_blocks=Module["_v2_engine_get_repivoted_schedule_blocks"]=wasmExports["P"])(a0);var _v2_engine_get_abandoned_schedule_blocks=Module["_v2_engine_get_abandoned_schedule_blocks"]=a0=>(_v2_engine_get_abandoned_schedule_blocks=Module["_v2_engine_get_abandoned_schedule_blocks"]=wasmExports["Q"])(a0);var _v2_engine_get_dropped_schedule_blocks=Module["_v2_engine_get_dropped_schedule_blocks"]=a0=>(_v2_engine_get_dropped_schedule_blocks=Module["_v2_engine_get_dropped_schedule_blocks"]=wasmExports["R"])(a0);var _malloc=Module["_malloc"]=a0=>(_malloc=Module["_malloc"]=wasmExports["S"])(a0);var _free=Module["_free"]=a0=>(_free=Module["_free"]=wasmExports["T"])(a0);var ___trap=()=>(___trap=wasmExports["U"])();var __emscripten_stack_restore=a0=>(__emscripten_stack_restore=wasmExports["V"])(a0);var __emscripten_stack_alloc=a0=>(__emscripten_stack_alloc=wasmExports["W"])(a0);var _emscripten_stack_get_current=()=>(_emscripten_stack_get_current=wasmExports["X"])();Module["ccall"]=ccall;Module["cwrap"]=cwrap;Module["setValue"]=setValue;Module["getValue"]=getValue;Module["UTF8ToString"]=UTF8ToString;Module["stringToUTF8"]=stringToUTF8;Module["lengthBytesUTF8"]=lengthBytesUTF8;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(){if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);Module["onRuntimeInitialized"]?.();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(()=>{setTimeout(()=>Module["setStatus"](""),1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();moduleRtn=readyPromise;
9
+ var Module=moduleArg;var readyPromiseResolve,readyPromiseReject;var readyPromise=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject});var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope!="undefined";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";if(ENVIRONMENT_IS_NODE){}var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");var nodePath=require("path");scriptDirectory=__dirname+"/";readBinary=filename=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename);return ret};readAsync=async(filename,binary=true)=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename,binary?undefined:"utf8");return ret};if(!Module["thisProgram"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptName){scriptDirectory=_scriptName}if(scriptDirectory.startsWith("blob:")){scriptDirectory=""}else{scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}{if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{if(isFileURI(url)){return new Promise((resolve,reject)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){resolve(xhr.response);return}reject(xhr.status)};xhr.onerror=reject;xhr.send(null)})}var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.error.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];var wasmBinary=Module["wasmBinary"];var wasmMemory;var ABORT=false;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module["HEAP8"]=HEAP8=new Int8Array(b);Module["HEAP16"]=HEAP16=new Int16Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAPU16"]=HEAPU16=new Uint16Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);Module["HEAPF64"]=HEAPF64=new Float64Array(b)}var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;Module["monitorRunDependencies"]?.(runDependencies)}function removeRunDependency(id){runDependencies--;Module["monitorRunDependencies"]?.(runDependencies);if(runDependencies==0){if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){Module["onAbort"]?.(what);what="Aborted("+what+")";err(what);ABORT=true;what+=". Build with -sASSERTIONS for more info.";if(runtimeInitialized){___trap()}var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";var isDataURI=filename=>filename.startsWith(dataURIPrefix);var isFileURI=filename=>filename.startsWith("file://");function findWasmBinary(){var f="v2_dsp.wasm";if(!isDataURI(f)){return locateFile(f)}return f}var wasmBinaryFile;function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(binaryFile){if(!wasmBinary){try{var response=await readAsync(binaryFile);return new Uint8Array(response)}catch{}}return getBinarySync(binaryFile)}async function instantiateArrayBuffer(binaryFile,imports){try{var binary=await getWasmBinary(binaryFile);var instance=await WebAssembly.instantiate(binary,imports);return instance}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)}}async function instantiateAsync(binary,binaryFile,imports){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){try{var response=fetch(binaryFile,{credentials:"same-origin"});var instantiationResult=await WebAssembly.instantiateStreaming(response,imports);return instantiationResult}catch(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation")}}return instantiateArrayBuffer(binaryFile,imports)}function getWasmImports(){return{a:wasmImports}}async function createWasm(){function receiveInstance(instance,module){wasmExports=instance.exports;wasmMemory=wasmExports["d"];updateMemoryViews();addOnInit(wasmExports["e"]);removeRunDependency("wasm-instantiate");return wasmExports}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}var info=getWasmImports();if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err(`Module.instantiateWasm callback failed with error: ${e}`);readyPromiseReject(e)}}wasmBinaryFile??=findWasmBinary();try{var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);receiveInstantiationResult(result);return result}catch(e){readyPromiseReject(e);return}}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};function getValue(ptr,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":return HEAP8[ptr];case"i8":return HEAP8[ptr];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];case"*":return HEAPU32[ptr>>2];default:abort(`invalid type for getValue: ${type}`)}}var noExitRuntime=Module["noExitRuntime"]||true;function setValue(ptr,value,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":HEAP8[ptr]=value;break;case"i8":HEAP8[ptr]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;case"*":HEAPU32[ptr>>2]=value;break;default:abort(`invalid type for setValue: ${type}`)}}var __abort_js=()=>abort("");var __emscripten_memcpy_js=(dest,src,num)=>HEAPU8.copyWithin(dest,src,src+num);var getHeapMax=()=>2147483648;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var b=wasmMemory.buffer;var pages=(size-b.byteLength+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var getCFunc=ident=>{var func=Module["_"+ident];return func};var writeArrayToMemory=(array,buffer)=>{HEAP8.set(array,buffer)};var lengthBytesUTF8=str=>{var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);var stackAlloc=sz=>__emscripten_stack_alloc(sz);var stringToUTF8OnStack=str=>{var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret};var stackSave=()=>_emscripten_stack_get_current();var stackRestore=val=>__emscripten_stack_restore(val);var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder:undefined;var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead=NaN)=>{var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"";var ccall=(ident,returnType,argTypes,args,opts)=>{var toC={string:str=>{var ret=0;if(str!==null&&str!==undefined&&str!==0){ret=stringToUTF8OnStack(str)}return ret},array:arr=>{var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string"){return UTF8ToString(ret)}if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func(...cArgs);function onDone(ret){if(stack!==0)stackRestore(stack);return convertReturnValue(ret)}ret=onDone(ret);return ret};var cwrap=(ident,returnType,argTypes,opts)=>{var numericArgs=!argTypes||argTypes.every(type=>type==="number"||type==="boolean");var numericRet=returnType!=="string";if(numericRet&&numericArgs&&!opts){return getCFunc(ident)}return(...args)=>ccall(ident,returnType,argTypes,args,opts)};var wasmImports={a:__abort_js,c:__emscripten_memcpy_js,b:_emscripten_resize_heap};var wasmExports;createWasm();var ___wasm_call_ctors=()=>(___wasm_call_ctors=wasmExports["e"])();var _v2_engine_create=Module["_v2_engine_create"]=()=>(_v2_engine_create=Module["_v2_engine_create"]=wasmExports["g"])();var _v2_engine_destroy=Module["_v2_engine_destroy"]=a0=>(_v2_engine_destroy=Module["_v2_engine_destroy"]=wasmExports["h"])(a0);var _v2_engine_load_json=Module["_v2_engine_load_json"]=(a0,a1)=>(_v2_engine_load_json=Module["_v2_engine_load_json"]=wasmExports["i"])(a0,a1);var _v2_engine_prepare=Module["_v2_engine_prepare"]=(a0,a1,a2,a3,a4)=>(_v2_engine_prepare=Module["_v2_engine_prepare"]=wasmExports["j"])(a0,a1,a2,a3,a4);var _v2_engine_get_host_sample_rate=Module["_v2_engine_get_host_sample_rate"]=a0=>(_v2_engine_get_host_sample_rate=Module["_v2_engine_get_host_sample_rate"]=wasmExports["k"])(a0);var _v2_engine_get_oversample_latency=Module["_v2_engine_get_oversample_latency"]=a0=>(_v2_engine_get_oversample_latency=Module["_v2_engine_get_oversample_latency"]=wasmExports["l"])(a0);var _v2_resample_stage_count=Module["_v2_resample_stage_count"]=()=>(_v2_resample_stage_count=Module["_v2_resample_stage_count"]=wasmExports["m"])();var _v2_resample_prototype_length=Module["_v2_resample_prototype_length"]=a0=>(_v2_resample_prototype_length=Module["_v2_resample_prototype_length"]=wasmExports["n"])(a0);var _v2_resample_prototype_tap=Module["_v2_resample_prototype_tap"]=(a0,a1)=>(_v2_resample_prototype_tap=Module["_v2_resample_prototype_tap"]=wasmExports["o"])(a0,a1);var _v2_testonly_resample_create=Module["_v2_testonly_resample_create"]=a0=>(_v2_testonly_resample_create=Module["_v2_testonly_resample_create"]=wasmExports["p"])(a0);var _v2_testonly_resample_reset=Module["_v2_testonly_resample_reset"]=a0=>(_v2_testonly_resample_reset=Module["_v2_testonly_resample_reset"]=wasmExports["q"])(a0);var _v2_testonly_resample_process=Module["_v2_testonly_resample_process"]=(a0,a1)=>(_v2_testonly_resample_process=Module["_v2_testonly_resample_process"]=wasmExports["r"])(a0,a1);var _v2_testonly_resample_destroy=Module["_v2_testonly_resample_destroy"]=a0=>(_v2_testonly_resample_destroy=Module["_v2_testonly_resample_destroy"]=wasmExports["s"])(a0);var _v2_testonly_taper_fraction=Module["_v2_testonly_taper_fraction"]=(a0,a1)=>(_v2_testonly_taper_fraction=Module["_v2_testonly_taper_fraction"]=wasmExports["t"])(a0,a1);var _v2_engine_reset=Module["_v2_engine_reset"]=a0=>(_v2_engine_reset=Module["_v2_engine_reset"]=wasmExports["u"])(a0);var _v2_engine_set_control=Module["_v2_engine_set_control"]=(a0,a1,a2)=>(_v2_engine_set_control=Module["_v2_engine_set_control"]=wasmExports["v"])(a0,a1,a2);var _v2_engine_get_control=Module["_v2_engine_get_control"]=(a0,a1)=>(_v2_engine_get_control=Module["_v2_engine_get_control"]=wasmExports["w"])(a0,a1);var _v2_engine_set_supply=Module["_v2_engine_set_supply"]=(a0,a1,a2,a3,a4)=>(_v2_engine_set_supply=Module["_v2_engine_set_supply"]=wasmExports["x"])(a0,a1,a2,a3,a4);var _v2_engine_process_sample=Module["_v2_engine_process_sample"]=(a0,a1)=>(_v2_engine_process_sample=Module["_v2_engine_process_sample"]=wasmExports["y"])(a0,a1);var _v2_engine_process_block=Module["_v2_engine_process_block"]=(a0,a1,a2,a3)=>(_v2_engine_process_block=Module["_v2_engine_process_block"]=wasmExports["z"])(a0,a1,a2,a3);var _v2_engine_get_input_buffer=Module["_v2_engine_get_input_buffer"]=(a0,a1)=>(_v2_engine_get_input_buffer=Module["_v2_engine_get_input_buffer"]=wasmExports["A"])(a0,a1);var _v2_engine_get_output_buffer=Module["_v2_engine_get_output_buffer"]=(a0,a1)=>(_v2_engine_get_output_buffer=Module["_v2_engine_get_output_buffer"]=wasmExports["B"])(a0,a1);var _v2_engine_process_internal=Module["_v2_engine_process_internal"]=(a0,a1)=>(_v2_engine_process_internal=Module["_v2_engine_process_internal"]=wasmExports["C"])(a0,a1);var _v2_engine_get_last_iteration_count=Module["_v2_engine_get_last_iteration_count"]=a0=>(_v2_engine_get_last_iteration_count=Module["_v2_engine_get_last_iteration_count"]=wasmExports["D"])(a0);var _v2_engine_get_last_converged=Module["_v2_engine_get_last_converged"]=a0=>(_v2_engine_get_last_converged=Module["_v2_engine_get_last_converged"]=wasmExports["E"])(a0);var _v2_engine_get_max_iterations=Module["_v2_engine_get_max_iterations"]=a0=>(_v2_engine_get_max_iterations=Module["_v2_engine_get_max_iterations"]=wasmExports["F"])(a0);var _v2_engine_get_operating_point=Module["_v2_engine_get_operating_point"]=(a0,a1,a2)=>(_v2_engine_get_operating_point=Module["_v2_engine_get_operating_point"]=wasmExports["G"])(a0,a1,a2);var _v2_engine_get_state=Module["_v2_engine_get_state"]=(a0,a1,a2)=>(_v2_engine_get_state=Module["_v2_engine_get_state"]=wasmExports["H"])(a0,a1,a2);var _v2_engine_get_last_error=Module["_v2_engine_get_last_error"]=a0=>(_v2_engine_get_last_error=Module["_v2_engine_get_last_error"]=wasmExports["I"])(a0);var _v2_engine_get_schedule_solves=Module["_v2_engine_get_schedule_solves"]=a0=>(_v2_engine_get_schedule_solves=Module["_v2_engine_get_schedule_solves"]=wasmExports["J"])(a0);var _v2_engine_get_schedule_fallbacks=Module["_v2_engine_get_schedule_fallbacks"]=a0=>(_v2_engine_get_schedule_fallbacks=Module["_v2_engine_get_schedule_fallbacks"]=wasmExports["K"])(a0);var _v2_engine_get_predictor_seeds=Module["_v2_engine_get_predictor_seeds"]=a0=>(_v2_engine_get_predictor_seeds=Module["_v2_engine_get_predictor_seeds"]=wasmExports["L"])(a0);var _v2_engine_get_one_iteration_solves=Module["_v2_engine_get_one_iteration_solves"]=a0=>(_v2_engine_get_one_iteration_solves=Module["_v2_engine_get_one_iteration_solves"]=wasmExports["M"])(a0);var _v2_engine_get_total_iterations=Module["_v2_engine_get_total_iterations"]=a0=>(_v2_engine_get_total_iterations=Module["_v2_engine_get_total_iterations"]=wasmExports["N"])(a0);var _v2_engine_get_predictor_order=Module["_v2_engine_get_predictor_order"]=(a0,a1)=>(_v2_engine_get_predictor_order=Module["_v2_engine_get_predictor_order"]=wasmExports["O"])(a0,a1);var _v2_engine_get_kernel_solves=Module["_v2_engine_get_kernel_solves"]=a0=>(_v2_engine_get_kernel_solves=Module["_v2_engine_get_kernel_solves"]=wasmExports["P"])(a0);var _v2_engine_get_repivoted_schedule_blocks=Module["_v2_engine_get_repivoted_schedule_blocks"]=a0=>(_v2_engine_get_repivoted_schedule_blocks=Module["_v2_engine_get_repivoted_schedule_blocks"]=wasmExports["Q"])(a0);var _v2_engine_get_abandoned_schedule_blocks=Module["_v2_engine_get_abandoned_schedule_blocks"]=a0=>(_v2_engine_get_abandoned_schedule_blocks=Module["_v2_engine_get_abandoned_schedule_blocks"]=wasmExports["R"])(a0);var _v2_engine_get_dropped_schedule_blocks=Module["_v2_engine_get_dropped_schedule_blocks"]=a0=>(_v2_engine_get_dropped_schedule_blocks=Module["_v2_engine_get_dropped_schedule_blocks"]=wasmExports["S"])(a0);var _malloc=Module["_malloc"]=a0=>(_malloc=Module["_malloc"]=wasmExports["T"])(a0);var _free=Module["_free"]=a0=>(_free=Module["_free"]=wasmExports["U"])(a0);var ___trap=()=>(___trap=wasmExports["V"])();var __emscripten_stack_restore=a0=>(__emscripten_stack_restore=wasmExports["W"])(a0);var __emscripten_stack_alloc=a0=>(__emscripten_stack_alloc=wasmExports["X"])(a0);var _emscripten_stack_get_current=()=>(_emscripten_stack_get_current=wasmExports["Y"])();Module["ccall"]=ccall;Module["cwrap"]=cwrap;Module["setValue"]=setValue;Module["getValue"]=getValue;Module["UTF8ToString"]=UTF8ToString;Module["stringToUTF8"]=stringToUTF8;Module["lengthBytesUTF8"]=lengthBytesUTF8;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(){if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);Module["onRuntimeInitialized"]?.();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(()=>{setTimeout(()=>Module["setStatus"](""),1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();moduleRtn=readyPromise;
10
10
 
11
11
 
12
12
  return moduleRtn;
Binary file