Guest User

Code generation test 2

a guest
Aug 7th, 2025
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class CompiledGraphAudioWorkletProcessor extends AudioWorkletProcessor {
  2.   x0 = 0.0;
  3.   x1 = 0.0;
  4.   x2 = 0.0;
  5.   x3 = 0.0;
  6.   x4 = 0.0;
  7.   x5 = 0.0;
  8.   x6 = 0.0;
  9.   x7 = 0.0;
  10.   x8 = 0.0;
  11.   x9 = 0.0;
  12.   x10 = 0.0;
  13.   x11 = 0.0;
  14.   x12 = 0.0;
  15.   x13 = 0.0;
  16.   x14 = 0.0;
  17.   x15 = 0.0;
  18.   x16 = 0.0;
  19.   x17 = 0.0;
  20.   x18 = 0.0;
  21.   x19 = 0.0;
  22.   x20 = 0.0;
  23.   x21 = 0.0;
  24.   x22 = 0.0;
  25.   x23 = 0.0;
  26.   x24 = 0.0;
  27.   x25 = 0.0;
  28.   x26 = 0.0;
  29.   x27 = 0.0;
  30.   x28 = 0.0;
  31.   x29 = 0.0;
  32.   x30 = 0.0;
  33.   x31 = 0.0;
  34.   x32 = 0.0;
  35.   x33 = 0.0;
  36.   x34 = 0.0;
  37.   x35 = 0.0;
  38.  
  39.   process(inputs, outputs, parameters) {
  40.     let output = outputs[0][0];
  41.     for (let i = 0; i < output.length; ++i) {
  42.       let result = 0.0;
  43.       if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/C"]) {
  44.         this.x0 = 261.63;
  45.       } else {
  46.         this.x0 = 0.0;
  47.       }
  48.       if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/C#"]) {
  49.         this.x1 = 277.18732937722245;
  50.       } else {
  51.         this.x1 = 0.0;
  52.       }
  53.       if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/D"]) {
  54.         this.x2 = 293.66974569918125;
  55.       } else {
  56.         this.x2 = 0.0;
  57.       }
  58.       if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/D#"]) {
  59.         this.x3 = 311.1322574981619;
  60.       } else {
  61.         this.x3 = 0.0;
  62.       }
  63.       if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/E"]) {
  64.         this.x4 = 329.63314428399565;
  65.       } else {
  66.         this.x4 = 0.0;
  67.       }
  68.       if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/F"]) {
  69.         this.x5 = 349.2341510465061;
  70.       } else {
  71.         this.x5 = 0.0;
  72.       }
  73.       if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/F#"]) {
  74.         this.x6 = 370.00069432367286;
  75.       } else {
  76.         this.x6 = 0.0;
  77.       }
  78.       if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/G"]) {
  79.         this.x7 = 392.0020805232462;
  80.       } else {
  81.         this.x7 = 0.0;
  82.       }
  83.       if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/G#"]) {
  84.         this.x8 = 415.31173722644;
  85.       } else {
  86.         this.x8 = 0.0;
  87.       }
  88.       if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/A"]) {
  89.         this.x9 = 440.00745824565865;
  90.       } else {
  91.         this.x9 = 0.0;
  92.       }
  93.       if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/A#"]) {
  94.         this.x10 = 466.1716632541139;
  95.       } else {
  96.         this.x10 = 0.0;
  97.       }
  98.       if (noteDown["3d925a45-92a5-4b97-9f1e-78920cad410a/B"]) {
  99.         this.x11 = 493.8916728538229;
  100.       } else {
  101.         this.x11 = 0.0;
  102.       }
  103.       this.x12 += (2 * Math.PI * this.x0) / sampleRate;
  104.       this.x13 = 1.0 * Math.sin(this.x12) + 0.0;
  105.       this.x12 %= 2 * Math.PI;
  106.       this.x14 += (2 * Math.PI * this.x1) / sampleRate;
  107.       this.x15 = 1.0 * Math.sin(this.x14) + 0.0;
  108.       this.x14 %= 2 * Math.PI;
  109.       this.x16 += (2 * Math.PI * this.x2) / sampleRate;
  110.       this.x17 = 1.0 * Math.sin(this.x16) + 0.0;
  111.       this.x16 %= 2 * Math.PI;
  112.       this.x18 += (2 * Math.PI * this.x3) / sampleRate;
  113.       this.x19 = 1.0 * Math.sin(this.x18) + 0.0;
  114.       this.x18 %= 2 * Math.PI;
  115.       this.x20 += (2 * Math.PI * this.x4) / sampleRate;
  116.       this.x21 = 1.0 * Math.sin(this.x20) + 0.0;
  117.       this.x20 %= 2 * Math.PI;
  118.       this.x22 += (2 * Math.PI * this.x5) / sampleRate;
  119.       this.x23 = 1.0 * Math.sin(this.x22) + 0.0;
  120.       this.x22 %= 2 * Math.PI;
  121.       this.x24 += (2 * Math.PI * this.x6) / sampleRate;
  122.       this.x25 = 1.0 * Math.sin(this.x24) + 0.0;
  123.       this.x24 %= 2 * Math.PI;
  124.       this.x26 += (2 * Math.PI * this.x7) / sampleRate;
  125.       this.x27 = 1.0 * Math.sin(this.x26) + 0.0;
  126.       this.x26 %= 2 * Math.PI;
  127.       this.x28 += (2 * Math.PI * this.x8) / sampleRate;
  128.       this.x29 = 1.0 * Math.sin(this.x28) + 0.0;
  129.       this.x28 %= 2 * Math.PI;
  130.       this.x30 += (2 * Math.PI * this.x9) / sampleRate;
  131.       this.x31 = 1.0 * Math.sin(this.x30) + 0.0;
  132.       this.x30 %= 2 * Math.PI;
  133.       this.x32 += (2 * Math.PI * this.x10) / sampleRate;
  134.       this.x33 = 1.0 * Math.sin(this.x32) + 0.0;
  135.       this.x32 %= 2 * Math.PI;
  136.       this.x34 += (2 * Math.PI * this.x11) / sampleRate;
  137.       this.x35 = 1.0 * Math.sin(this.x34) + 0.0;
  138.       this.x34 %= 2 * Math.PI;
  139.       result += this.x13
  140.       result += this.x15
  141.       result += this.x17
  142.       result += this.x19
  143.       result += this.x21
  144.       result += this.x23
  145.       result += this.x25
  146.       result += this.x27
  147.       result += this.x29
  148.       result += this.x31
  149.       result += this.x33
  150.       result += this.x35
  151.       output[i] = result;
  152.     }
  153.     return true;
  154.   }
  155. }
  156.  
  157. registerProcessor("compiled-graph-audio-worklet-processor", CompiledGraphAudioWorkletProcessor);
  158.  
Advertisement
Add Comment
Please, Sign In to add comment