@audiofab-io/fv1-core 0.2.3 → 0.4.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.
Files changed (130) hide show
  1. package/blocks/ATL_DEVELOPER_REFERENCE.md +156 -0
  2. package/blocks/control/constant.atl +36 -0
  3. package/blocks/control/entropy_lfo.atl +74 -0
  4. package/blocks/control/envelope.atl +121 -0
  5. package/blocks/control/invert.atl +33 -0
  6. package/blocks/control/pot.atl +150 -0
  7. package/blocks/control/power.atl +77 -0
  8. package/blocks/control/ramp_lfo.atl +122 -0
  9. package/blocks/control/scale_offset.atl +84 -0
  10. package/blocks/control/sincos_lfo.atl +126 -0
  11. package/blocks/control/smoother.atl +48 -0
  12. package/blocks/control/tremolizer.atl +55 -0
  13. package/blocks/effects/delay/micro_stutter.atl +77 -0
  14. package/blocks/effects/delay/mn3011.atl +281 -0
  15. package/blocks/effects/delay/simple_delay.atl +96 -0
  16. package/blocks/effects/delay/triple_tap_delay.atl +176 -0
  17. package/blocks/effects/lo-fi/bit_mangler.atl +74 -0
  18. package/blocks/effects/lo-fi/chiptune.atl +311 -0
  19. package/blocks/effects/lo-fi/tape_degrade.atl +181 -0
  20. package/blocks/effects/modulation/chorus.atl +141 -0
  21. package/blocks/effects/modulation/chorus_4voice.atl +188 -0
  22. package/blocks/effects/modulation/flanger.atl +184 -0
  23. package/blocks/effects/modulation/guitar_synth.atl +350 -0
  24. package/blocks/effects/modulation/harmonic_trem.atl +129 -0
  25. package/blocks/effects/modulation/organ_synth.atl +326 -0
  26. package/blocks/effects/modulation/phaser.atl +300 -0
  27. package/blocks/effects/pitch/octave_up_down.atl +80 -0
  28. package/blocks/effects/pitch/pitch_offset.atl +149 -0
  29. package/blocks/effects/pitch/pitch_offset_dual.atl +197 -0
  30. package/blocks/effects/pitch/pitch_shift.atl +115 -0
  31. package/blocks/effects/pitch/sub_octave.atl +100 -0
  32. package/blocks/effects/reverb/ducking_reverb.atl +145 -0
  33. package/blocks/effects/reverb/min_reverb.atl +132 -0
  34. package/blocks/effects/reverb/plate_reverb.atl +344 -0
  35. package/blocks/effects/reverb/room_reverb.atl +293 -0
  36. package/blocks/effects/reverb/smear.atl +90 -0
  37. package/blocks/effects/reverb/spring_reverb.atl +353 -0
  38. package/blocks/filter/1p_high_pass.atl +63 -0
  39. package/blocks/filter/1p_low_pass.atl +59 -0
  40. package/blocks/filter/auto_wah.atl +207 -0
  41. package/blocks/filter/bbd_loss.atl +79 -0
  42. package/blocks/filter/shelving_high_pass.atl +76 -0
  43. package/blocks/filter/shelving_low_pass.atl +76 -0
  44. package/blocks/filter/svf_2p.atl +116 -0
  45. package/blocks/gain_mix/crossfade.atl +93 -0
  46. package/blocks/gain_mix/crossfade2.atl +86 -0
  47. package/blocks/gain_mix/crossfade3.atl +71 -0
  48. package/blocks/gain_mix/gainboost.atl +54 -0
  49. package/blocks/gain_mix/mixer2.atl +76 -0
  50. package/blocks/gain_mix/mixer3.atl +109 -0
  51. package/blocks/gain_mix/mixer4.atl +152 -0
  52. package/blocks/gain_mix/volume.atl +51 -0
  53. package/blocks/io/adc.atl +53 -0
  54. package/blocks/io/dac.atl +61 -0
  55. package/blocks/other/stickynote.atl +24 -0
  56. package/blocks/other/tone_gen_adjustable.atl +137 -0
  57. package/blocks/other/tone_gen_fixed.atl +109 -0
  58. package/dist/blockDiagram/blocks/BlockDirectoryLoader.d.ts +13 -0
  59. package/dist/blockDiagram/blocks/BlockDirectoryLoader.d.ts.map +1 -0
  60. package/dist/blockDiagram/blocks/BlockDirectoryLoader.js +44 -0
  61. package/dist/blockDiagram/blocks/BlockDirectoryLoader.js.map +1 -0
  62. package/dist/blockDiagram/blocks/BlockRegistry.d.ts +48 -0
  63. package/dist/blockDiagram/blocks/BlockRegistry.d.ts.map +1 -0
  64. package/dist/blockDiagram/blocks/BlockRegistry.js +109 -0
  65. package/dist/blockDiagram/blocks/BlockRegistry.js.map +1 -0
  66. package/dist/blockDiagram/blocks/TemplateBlock.d.ts +20 -0
  67. package/dist/blockDiagram/blocks/TemplateBlock.d.ts.map +1 -0
  68. package/dist/blockDiagram/blocks/TemplateBlock.js +82 -0
  69. package/dist/blockDiagram/blocks/TemplateBlock.js.map +1 -0
  70. package/dist/blockDiagram/blocks/base/BaseBlock.d.ts +248 -0
  71. package/dist/blockDiagram/blocks/base/BaseBlock.d.ts.map +1 -0
  72. package/dist/blockDiagram/blocks/base/BaseBlock.js +402 -0
  73. package/dist/blockDiagram/blocks/base/BaseBlock.js.map +1 -0
  74. package/dist/blockDiagram/builtinBlocks.d.ts +9 -0
  75. package/dist/blockDiagram/builtinBlocks.d.ts.map +1 -0
  76. package/dist/blockDiagram/builtinBlocks.js +4912 -0
  77. package/dist/blockDiagram/builtinBlocks.js.map +1 -0
  78. package/dist/blockDiagram/compiler/BlockTemplate.d.ts +37 -0
  79. package/dist/blockDiagram/compiler/BlockTemplate.d.ts.map +1 -0
  80. package/dist/blockDiagram/compiler/BlockTemplate.js +860 -0
  81. package/dist/blockDiagram/compiler/BlockTemplate.js.map +1 -0
  82. package/dist/blockDiagram/compiler/CodeOptimizer.d.ts +75 -0
  83. package/dist/blockDiagram/compiler/CodeOptimizer.d.ts.map +1 -0
  84. package/dist/blockDiagram/compiler/CodeOptimizer.js +443 -0
  85. package/dist/blockDiagram/compiler/CodeOptimizer.js.map +1 -0
  86. package/dist/blockDiagram/compiler/GraphCompiler.d.ts +63 -0
  87. package/dist/blockDiagram/compiler/GraphCompiler.d.ts.map +1 -0
  88. package/dist/blockDiagram/compiler/GraphCompiler.js +656 -0
  89. package/dist/blockDiagram/compiler/GraphCompiler.js.map +1 -0
  90. package/dist/blockDiagram/compiler/TopologicalSort.d.ts +63 -0
  91. package/dist/blockDiagram/compiler/TopologicalSort.d.ts.map +1 -0
  92. package/dist/blockDiagram/compiler/TopologicalSort.js +268 -0
  93. package/dist/blockDiagram/compiler/TopologicalSort.js.map +1 -0
  94. package/dist/blockDiagram/index.d.ts +30 -0
  95. package/dist/blockDiagram/index.d.ts.map +1 -0
  96. package/dist/blockDiagram/index.js +29 -0
  97. package/dist/blockDiagram/index.js.map +1 -0
  98. package/dist/blockDiagram/types/Block.d.ts +178 -0
  99. package/dist/blockDiagram/types/Block.d.ts.map +1 -0
  100. package/dist/blockDiagram/types/Block.js +5 -0
  101. package/dist/blockDiagram/types/Block.js.map +1 -0
  102. package/dist/blockDiagram/types/CodeGenContext.d.ts +235 -0
  103. package/dist/blockDiagram/types/CodeGenContext.d.ts.map +1 -0
  104. package/dist/blockDiagram/types/CodeGenContext.js +554 -0
  105. package/dist/blockDiagram/types/CodeGenContext.js.map +1 -0
  106. package/dist/blockDiagram/types/Connection.d.ts +17 -0
  107. package/dist/blockDiagram/types/Connection.d.ts.map +1 -0
  108. package/dist/blockDiagram/types/Connection.js +5 -0
  109. package/dist/blockDiagram/types/Connection.js.map +1 -0
  110. package/dist/blockDiagram/types/Graph.d.ts +28 -0
  111. package/dist/blockDiagram/types/Graph.d.ts.map +1 -0
  112. package/dist/blockDiagram/types/Graph.js +24 -0
  113. package/dist/blockDiagram/types/Graph.js.map +1 -0
  114. package/dist/blockDiagram/types/IR.d.ts +79 -0
  115. package/dist/blockDiagram/types/IR.d.ts.map +1 -0
  116. package/dist/blockDiagram/types/IR.js +6 -0
  117. package/dist/blockDiagram/types/IR.js.map +1 -0
  118. package/dist/blockDiagram/utils/SpinCADConverter.d.ts +17 -0
  119. package/dist/blockDiagram/utils/SpinCADConverter.d.ts.map +1 -0
  120. package/dist/blockDiagram/utils/SpinCADConverter.js +307 -0
  121. package/dist/blockDiagram/utils/SpinCADConverter.js.map +1 -0
  122. package/dist/effect/compileEffect.d.ts +51 -0
  123. package/dist/effect/compileEffect.d.ts.map +1 -0
  124. package/dist/effect/compileEffect.js +133 -0
  125. package/dist/effect/compileEffect.js.map +1 -0
  126. package/dist/index.d.ts +2 -0
  127. package/dist/index.d.ts.map +1 -1
  128. package/dist/index.js +2 -0
  129. package/dist/index.js.map +1 -1
  130. package/package.json +17 -5
@@ -0,0 +1,293 @@
1
+ ---
2
+ {
3
+ "type": "effects.reverb.room",
4
+ "category": "Effects",
5
+ "subcategory": "Reverb",
6
+ "name": "Room Reverb",
7
+ "description": "Hall-style reverb with pre-delay, damping, and stereo output",
8
+ "color": "#7100FC",
9
+ "inputs": [
10
+ { "id": "input", "name": "Input", "type": "audio", "required": true },
11
+ { "id": "pre_delay", "name": "Pre Delay", "type": "control", "required": false, "parameter": "preDelay" },
12
+ { "id": "reverb_time", "name": "Reverb Time", "type": "control", "required": false, "parameter": "reverbTime" },
13
+ { "id": "hf_loss", "name": "HF Loss", "type": "control", "required": false, "parameter": "hfLoss" }
14
+ ],
15
+ "outputs": [
16
+ { "id": "outputL", "name": "Output L", "type": "audio" },
17
+ { "id": "outputR", "name": "Output R", "type": "audio" }
18
+ ],
19
+ "parameters": [
20
+ {
21
+ "id": "inputGain",
22
+ "name": "Input Gain",
23
+ "type": "number",
24
+ "min": -24,
25
+ "max": 0,
26
+ "default": -6,
27
+ "conversion": "DBLEVEL"
28
+ },
29
+ {
30
+ "id": "preDelay",
31
+ "name": "Pre-Delay (ms)",
32
+ "type": "number",
33
+ "default": 25,
34
+ "min": 0,
35
+ "max": 100,
36
+ "conversion": "MS_TO_SAMPLES",
37
+ "step": 1
38
+ },
39
+ {
40
+ "id": "reverbTime",
41
+ "name": "Reverb Time",
42
+ "type": "number",
43
+ "default": 0.5,
44
+ "min": 0.05,
45
+ "max": 0.95,
46
+ "step": 0.01
47
+ },
48
+ {
49
+ "id": "hfDamping",
50
+ "name": "HF Damping",
51
+ "type": "number",
52
+ "min": 40,
53
+ "max": 1000,
54
+ "default": 100,
55
+ "conversion": "LOGFREQ"
56
+ },
57
+ {
58
+ "id": "inputAllpassCoeff",
59
+ "name": "Input Allpass",
60
+ "type": "number",
61
+ "default": 0.5,
62
+ "min": 0.05,
63
+ "max": 0.95,
64
+ "step": 0.01
65
+ },
66
+ {
67
+ "id": "delayAllpassCoeff",
68
+ "name": "Delay Allpass",
69
+ "type": "number",
70
+ "default": 0.5,
71
+ "min": 0.05,
72
+ "max": 0.95,
73
+ "step": 0.01
74
+ },
75
+ {
76
+ "id": "hfLoss",
77
+ "name": "HF Loss",
78
+ "type": "number",
79
+ "default": 1.0,
80
+ "min": 0.0,
81
+ "max": 1.0,
82
+ "step": 0.01,
83
+ "description": "High-frequency loss applied in the reverb loops. 1.0 = full HF, 0.0 = maximum loss."
84
+ },
85
+ {
86
+ "id": "lfoRate",
87
+ "name": "LFO Rate (Hz)",
88
+ "type": "number",
89
+ "default": 0.25,
90
+ "min": 0.05,
91
+ "max": 2.0,
92
+ "conversion": "HZ_TO_LFO_RATE",
93
+ "description": "Frequency of the LFO modulation in Hz.",
94
+ "step": 0.01
95
+ }
96
+ ],
97
+ "memories": [
98
+ { "id": "pdel", "size": 3276 },
99
+ { "id": "tdel", "size": 4000 },
100
+ { "id": "ap1", "size": 473 },
101
+ { "id": "ap2", "size": 536 },
102
+ { "id": "ap3", "size": 667 },
103
+ { "id": "ap4", "size": 791 },
104
+ { "id": "tap1", "size": 452 },
105
+ { "id": "tap2", "size": 561 },
106
+ { "id": "lap1a", "size": 878 },
107
+ { "id": "lap1b", "size": 1287 },
108
+ { "id": "d1", "size": 1536 },
109
+ { "id": "lap2a", "size": 968 },
110
+ { "id": "lap2b", "size": 1367 },
111
+ { "id": "d2", "size": 1891 },
112
+ { "id": "lap3a", "size": 678 },
113
+ { "id": "lap3b", "size": 1127 },
114
+ { "id": "d3", "size": 1936 },
115
+ { "id": "lap4a", "size": 1263 },
116
+ { "id": "lap4b", "size": 1198 },
117
+ { "id": "d4", "size": 1781 }
118
+ ],
119
+ "registers": [
120
+ "apout", "temp", "kd", "rt_cv", "lp1", "lp2", "lp3", "lp4", "hp1", "hp2", "tlp"
121
+ ]
122
+ }
123
+ ---
124
+ @section init
125
+ @if pinConnected(input)
126
+ ; Room Reverb init
127
+ skp run, room_reverb_init
128
+ wrax ${reg.lp1}, 0.0
129
+ wrax ${reg.lp2}, 0.0
130
+ wrax ${reg.hp1}, 0.0
131
+ wrax ${reg.hp2}, 0.0
132
+ wrax ${reg.tlp}, 0.0
133
+ wlds SIN0, ${lfoRate}, 100
134
+ room_reverb_init:
135
+ @endif
136
+
137
+ @section main
138
+ @if pinConnected(input)
139
+
140
+ ; Room Reverb
141
+
142
+ ; Evaluate Control Voltages globally
143
+ @cv hf_loss
144
+ wrax ${reg.kd}, 0.0
145
+
146
+ @cv reverb_time
147
+ wrax ${reg.rt_cv}, 0.0
148
+
149
+ @cv pre_delay
150
+ sof 0.1, 0.0
151
+ wrax ADDR_PTR, 0.0
152
+
153
+ ; Feed input to pre-delay
154
+ rdax ${input.input}, ${inputGain}
155
+ wra ${mem.pdel}, 0.0
156
+
157
+ ; Read pre-delay and write to tap delay
158
+ rmpa 1.0
159
+ wra ${mem.tdel}, 1.0
160
+
161
+ ; 4 input allpass filters
162
+ rda ${mem.ap1}^, ${inputAllpassCoeff}
163
+ wrap ${mem.ap1}, -${inputAllpassCoeff}
164
+ rda ${mem.ap2}^, ${inputAllpassCoeff}
165
+ wrap ${mem.ap2}, -${inputAllpassCoeff}
166
+ rda ${mem.ap3}^, ${inputAllpassCoeff}
167
+ wrap ${mem.ap3}, -${inputAllpassCoeff}
168
+ rda ${mem.ap4}^, ${inputAllpassCoeff}
169
+ wrap ${mem.ap4}, -${inputAllpassCoeff}
170
+ wrax ${reg.apout}, 0.0
171
+
172
+ ; Delay loop 1
173
+ rda ${mem.d4}^, ${reverbTime}
174
+ mulx ${reg.rt_cv}
175
+ rdax ${reg.apout}, 1.0
176
+ rda ${mem.lap1a}^, ${delayAllpassCoeff}
177
+ wrap ${mem.lap1a}, -${delayAllpassCoeff}
178
+ rda ${mem.lap1b}^, -${delayAllpassCoeff}
179
+ wrap ${mem.lap1b}, ${delayAllpassCoeff}
180
+ rdfx ${reg.hp1}, ${hfDamping}
181
+ wrhx ${reg.hp1}, -0.5
182
+ wrax ${reg.temp}, -1.0
183
+ rdfx ${reg.lp1}, 0.5
184
+ wrhx ${reg.lp1}, -1.0
185
+ mulx ${reg.kd}
186
+ rdax ${reg.temp}, 1.0
187
+ wra ${mem.d1}, 0.0
188
+
189
+ ; Delay loop 2
190
+ rda ${mem.d1}^, -${reverbTime}
191
+ mulx ${reg.rt_cv}
192
+ rdax ${reg.apout}, 1.0
193
+ rda ${mem.lap2a}^, ${delayAllpassCoeff}
194
+ wrap ${mem.lap2a}, -${delayAllpassCoeff}
195
+ rda ${mem.lap2b}^, ${delayAllpassCoeff}
196
+ wrap ${mem.lap2b}, -${delayAllpassCoeff}
197
+ rdfx ${reg.hp2}, ${hfDamping}
198
+ wrhx ${reg.hp2}, -0.5
199
+ wrax ${reg.temp}, -1.0
200
+ rdfx ${reg.lp2}, 0.5
201
+ wrhx ${reg.lp2}, -1.0
202
+ mulx ${reg.kd}
203
+ rdax ${reg.temp}, 1.0
204
+ wra ${mem.d2}, 0.0
205
+
206
+ ; Delay loop 3
207
+ rda ${mem.d2}^, -1.0
208
+ mulx ${reg.rt_cv}
209
+ rdax ${reg.apout}, 1.0
210
+ rda ${mem.lap3a}^, ${delayAllpassCoeff}
211
+ wrap ${mem.lap3a}, -${delayAllpassCoeff}
212
+ rda ${mem.lap3b}^, ${delayAllpassCoeff}
213
+ wrap ${mem.lap3b}, -${delayAllpassCoeff}
214
+ rdfx ${reg.hp2}, 0.05
215
+ wrhx ${reg.hp2}, -0.5
216
+ wrax ${reg.temp}, -1.0
217
+ rdfx ${reg.lp3}, 0.5
218
+ wrhx ${reg.lp3}, -1.0
219
+ mulx ${reg.kd}
220
+ rdax ${reg.temp}, 1.0
221
+ wra ${mem.d3}, 0.0
222
+
223
+ ; Delay loop 4
224
+ rda ${mem.d3}^, -1.0
225
+ mulx ${reg.rt_cv}
226
+ rdax ${reg.apout}, 1.0
227
+ rda ${mem.lap4a}^, ${delayAllpassCoeff}
228
+ wrap ${mem.lap4a}, -${delayAllpassCoeff}
229
+ rda ${mem.lap4b}^, ${delayAllpassCoeff}
230
+ wrap ${mem.lap4b}, -${delayAllpassCoeff}
231
+ wrax ${reg.temp}, -1.0
232
+ rdfx ${reg.lp4}, 0.5
233
+ wrhx ${reg.lp4}, -1.0
234
+ mulx ${reg.kd}
235
+ rdax ${reg.temp}, 1.0
236
+ wra ${mem.d4}, 0.0
237
+
238
+ ; Tap delay processing
239
+ rda ${mem.tdel}+100, 1.0
240
+ rda ${mem.tap1}^, 0.5
241
+ wrap ${mem.tap1}, -0.5
242
+ wrax ${reg.temp}, 1.0
243
+ rdfx ${reg.tlp}, 0.1
244
+ wrhx ${reg.tlp}, -1.0
245
+ mulx ${reg.kd}
246
+ rdax ${reg.temp}, 1.0
247
+ wra ${mem.tdel}+101, 0.0
248
+
249
+ rda ${mem.tdel}+1000, 1.0
250
+ rda ${mem.tap2}^, 0.5
251
+ wrap ${mem.tap2}, -0.5
252
+ wra ${mem.tdel}+1001, 0.0
253
+
254
+ ; Left output mix
255
+ rda ${mem.tdel}+701, 0.7
256
+ rda ${mem.tdel}+956, 0.6
257
+ rda ${mem.tdel}+409, 0.5
258
+ rda ${mem.tdel}+1323, 0.4
259
+
260
+ @if pinConnected(outputR)
261
+ rda ${mem.d1}, 1.5
262
+ @else
263
+ rda ${mem.d1}^, 0.7
264
+ rda ${mem.d2}^, 0.8
265
+ @endif
266
+ @if pinConnected(outputL)
267
+ wrax ${output.outputL}, 0.0
268
+ @else
269
+ wrax ADDR_PTR, 0.0
270
+ @endif
271
+
272
+ ; Right output mix
273
+ @if pinConnected(outputR)
274
+ rda ${mem.tdel}+582, 0.7
275
+ rda ${mem.tdel}+956, 0.6
276
+ rda ${mem.tdel}+1047, 0.5
277
+ rda ${mem.tdel}+1323, 0.4
278
+ rda ${mem.d3}, 1.5
279
+ wrax ${output.outputR}, 0.0
280
+ @endif
281
+
282
+ ; LFO chorus modulation
283
+ cho rda, SIN0, REG|COMPC, ${mem.lap1b}+100
284
+ cho rda, SIN0, SIN, ${mem.lap1b}+101
285
+ wra ${mem.lap1b}+200, 0.0
286
+
287
+ cho rda, SIN0, COS|REG|COMPC, ${mem.lap3b}+100
288
+ cho rda, SIN0, COS, ${mem.lap3b}+101
289
+ wra ${mem.lap3b}+200, 0.0
290
+
291
+ @else
292
+ ; Room Reverb (no input connected)
293
+ @endif
@@ -0,0 +1,90 @@
1
+ ---
2
+ {
3
+ "type": "effects.smear",
4
+ "name": "Spectral Smear",
5
+ "category": "Effects",
6
+ "subcategory": "Reverb",
7
+ "description": "Diffusion bank of prime-numbered all-pass filters.",
8
+ "color": "#6f24f2",
9
+ "inputs": [
10
+ { "id": "input", "name": "Audio In", "type": "audio" },
11
+ { "id": "density", "name": "Density", "type": "control", "required": false, "parameter": "feedback" }
12
+ ],
13
+ "outputs": [
14
+ { "id": "out", "name": "Audio Out", "type": "audio" }
15
+ ],
16
+ "parameters": [
17
+ {
18
+ "id": "feedback",
19
+ "name": "Density (Feedback)",
20
+ "type": "number",
21
+ "default": 0.5,
22
+ "min": 0.0,
23
+ "max": 0.65,
24
+ "step": 0.01,
25
+ "description": "Density of the smear. Capped at 0.65 for stability."
26
+ }
27
+ ],
28
+ "memories": [
29
+ { "id": "ap1", "size": 151 },
30
+ { "id": "ap2", "size": 211 },
31
+ { "id": "ap3", "size": 331 },
32
+ { "id": "ap4", "size": 439 }
33
+ ],
34
+ "registers": [ "fb_reg", "ap_in", "ap_out", "ap_temp" ]
35
+ }
36
+ ---
37
+ ; Spectral Smear - Multi-tap Diffusion (Stable Unity Gain)
38
+
39
+ @section main
40
+ @if pinConnected(input)
41
+ ; Load feedback (parameter JSON already caps max at 0.65 for stability)
42
+ @cv density
43
+ wrax ${reg.fb_reg}, 0.0
44
+
45
+ rdax ${input.input}, 1.0
46
+ wrax ${reg.ap_in}, 1.0
47
+
48
+ ; --- AP Stages (Discrete Unrolled All-pass) ---
49
+ ; Stage 1
50
+ rda ${mem.ap1}#, 1.0
51
+ wrax ${reg.ap_out}, -1.0
52
+ mulx ${reg.fb_reg}
53
+ rdax ${reg.ap_in}, 1.0
54
+ wra ${mem.ap1}, 1.0
55
+ mulx ${reg.fb_reg}
56
+ rdax ${reg.ap_out}, 1.0
57
+ wrax ${reg.ap_in}, 0.0
58
+
59
+ ; Stage 2
60
+ rda ${mem.ap2}#, 1.0
61
+ wrax ${reg.ap_out}, -1.0
62
+ mulx ${reg.fb_reg}
63
+ rdax ${reg.ap_in}, 1.0
64
+ wra ${mem.ap2}, 1.0
65
+ mulx ${reg.fb_reg}
66
+ rdax ${reg.ap_out}, 1.0
67
+ wrax ${reg.ap_in}, 0.0
68
+
69
+ ; Stage 3
70
+ rda ${mem.ap3}#, 1.0
71
+ wrax ${reg.ap_out}, -1.0
72
+ mulx ${reg.fb_reg}
73
+ rdax ${reg.ap_in}, 1.0
74
+ wra ${mem.ap3}, 1.0
75
+ mulx ${reg.fb_reg}
76
+ rdax ${reg.ap_out}, 1.0
77
+ wrax ${reg.ap_in}, 0.0
78
+
79
+ ; Stage 4
80
+ rda ${mem.ap4}#, 1.0
81
+ wrax ${reg.ap_out}, -1.0
82
+ mulx ${reg.fb_reg}
83
+ rdax ${reg.ap_in}, 1.0
84
+ wra ${mem.ap4}, 1.0
85
+ mulx ${reg.fb_reg}
86
+ rdax ${reg.ap_out}, 1.0
87
+
88
+ ; Output (Unity Gain)
89
+ wrax ${output.out}, 0.0
90
+ @endif