Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CompiledGraphAudioWorkletProcessor extends AudioWorkletProcessor {
- x0 = 0.0;
- x1 = 0.0;
- x2 = 0.0;
- x3 = 0.0;
- x4 = 0.0;
- x5 = 0.0;
- x6 = 0.0;
- x7 = 0.0;
- x8 = 0.0;
- x9 = 0.0;
- x10 = 0.0;
- x11 = 0.0;
- x12 = 0.0;
- x13 = 0.0;
- x14 = 0.0;
- x15 = 0.0;
- x16 = 0.0;
- x17 = 0.0;
- x18 = 0.0;
- x19 = 0.0;
- x20 = 0.0;
- x21 = 0.0;
- x22 = 0.0;
- x23 = 0.0;
- x24 = 0.0;
- x25 = 0.0;
- x26 = 0.0;
- x27 = 0.0;
- x28 = 0.0;
- x29 = 0.0;
- x30 = 0.0;
- x31 = 0.0;
- x32 = 0.0;
- x33 = 0.0;
- x34 = 0.0;
- x35 = 0.0;
- process(inputs, outputs, parameters) {
- let output = outputs[0][0];
- for (let i = 0; i < output.length; ++i) {
- let result = 0.0;
- if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/C"]) {
- this.x0 = 261.63;
- } else {
- this.x0 = 0.0;
- }
- if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/C#"]) {
- this.x1 = 277.18732937722245;
- } else {
- this.x1 = 0.0;
- }
- if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/D"]) {
- this.x2 = 293.66974569918125;
- } else {
- this.x2 = 0.0;
- }
- if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/D#"]) {
- this.x3 = 311.1322574981619;
- } else {
- this.x3 = 0.0;
- }
- if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/E"]) {
- this.x4 = 329.63314428399565;
- } else {
- this.x4 = 0.0;
- }
- if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/F"]) {
- this.x5 = 349.2341510465061;
- } else {
- this.x5 = 0.0;
- }
- if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/F#"]) {
- this.x6 = 370.00069432367286;
- } else {
- this.x6 = 0.0;
- }
- if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/G"]) {
- this.x7 = 392.0020805232462;
- } else {
- this.x7 = 0.0;
- }
- if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/G#"]) {
- this.x8 = 415.31173722644;
- } else {
- this.x8 = 0.0;
- }
- if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/A"]) {
- this.x9 = 440.00745824565865;
- } else {
- this.x9 = 0.0;
- }
- if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/A#"]) {
- this.x10 = 466.1716632541139;
- } else {
- this.x10 = 0.0;
- }
- if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/B"]) {
- this.x11 = 493.8916728538229;
- } else {
- this.x11 = 0.0;
- }
- this.x12 += (2 * Math.PI * this.x0) / sampleRate;
- this.x13 = 1.0 * Math.sin(this.x12) + 0.0;
- this.x12 %= 2 * Math.PI;
- this.x14 += (2 * Math.PI * this.x1) / sampleRate;
- this.x15 = 1.0 * Math.sin(this.x14) + 0.0;
- this.x14 %= 2 * Math.PI;
- this.x16 += (2 * Math.PI * this.x2) / sampleRate;
- this.x17 = 1.0 * Math.sin(this.x16) + 0.0;
- this.x16 %= 2 * Math.PI;
- this.x18 += (2 * Math.PI * this.x3) / sampleRate;
- this.x19 = 1.0 * Math.sin(this.x18) + 0.0;
- this.x18 %= 2 * Math.PI;
- this.x20 += (2 * Math.PI * this.x4) / sampleRate;
- this.x21 = 1.0 * Math.sin(this.x20) + 0.0;
- this.x20 %= 2 * Math.PI;
- this.x22 += (2 * Math.PI * this.x5) / sampleRate;
- this.x23 = 1.0 * Math.sin(this.x22) + 0.0;
- this.x22 %= 2 * Math.PI;
- this.x24 += (2 * Math.PI * this.x6) / sampleRate;
- this.x25 = 1.0 * Math.sin(this.x24) + 0.0;
- this.x24 %= 2 * Math.PI;
- this.x26 += (2 * Math.PI * this.x7) / sampleRate;
- this.x27 = 1.0 * Math.sin(this.x26) + 0.0;
- this.x26 %= 2 * Math.PI;
- this.x28 += (2 * Math.PI * this.x8) / sampleRate;
- this.x29 = 1.0 * Math.sin(this.x28) + 0.0;
- this.x28 %= 2 * Math.PI;
- this.x30 += (2 * Math.PI * this.x9) / sampleRate;
- this.x31 = 1.0 * Math.sin(this.x30) + 0.0;
- this.x30 %= 2 * Math.PI;
- this.x32 += (2 * Math.PI * this.x10) / sampleRate;
- this.x33 = 1.0 * Math.sin(this.x32) + 0.0;
- this.x32 %= 2 * Math.PI;
- this.x34 += (2 * Math.PI * this.x11) / sampleRate;
- this.x35 = 1.0 * Math.sin(this.x34) + 0.0;
- this.x34 %= 2 * Math.PI;
- result += this.x13
- result += this.x15
- result += this.x17
- result += this.x19
- result += this.x21
- result += this.x23
- result += this.x25
- result += this.x27
- result += this.x29
- result += this.x31
- result += this.x33
- result += this.x35
- output[i] = result;
- }
- return true;
- }
- }
- registerProcessor("compiled-graph-audio-worklet-processor", CompiledGraphAudioWorkletProcessor);
Advertisement
Add Comment
Please, Sign In to add comment