analoglogicmaths
analogLogicMaths · utilities · schema v1Analog-logic mixer inspired by Mystic Instruments ANA (hardware-only — this is a from-spec implementation, not a port). Two continuous-signal inputs A and B feed bipolar attenuverters (-1..+1) and the post-attenuverter signals fan out into FIVE simultaneous algebraic outputs: MIN = min(A',B'), MAX = max(A',B'), DIFF = A'-B', SUM = tanh(A'+B') (soft-clipped), PRODUCT = tanh(A'*B') (soft-clipped, gives ring-mod-ish behavior for audio + smooth blending for CV). MIN/MAX of two waveforms mashes shapes; MAX of two envelopes = "either-trigger fires"; DIFF of two LFOs is anti-correlated motion; PRODUCT of two CVs is smooth blending. Continuous-signal "analog logic" — NOT the digital boolean logic that ILLOGIC ships. Tanh soft-clip on SUM + PRODUCT only (the operations that can leave [-1, +1]); MIN/MAX/DIFF stay bounded naturally.
the faceplate
inputs
| id | cable | what it does |
|---|---|---|
a | cv | Input A (bipolar CV or audio). Scaled by the ATT A attenuverter before feeding all five math operations. control voltage (CV) |
b | cv | Input B (bipolar CV or audio). Scaled by the ATT B attenuverter before the math. control voltage (CV) |
attA_cv | cv | CV control over the ATT A attenuverter knob — patch an LFO or envelope here to sweep how much of input A reaches the outputs (it adds to the knob's position). control voltage (CV); modulates attA (additive offset — ±1 CV sweeps the full range, centered on the knob) |
attB_cv | cv | CV control over the ATT B attenuverter knob — sweep how much of input B reaches the outputs (adds to the knob). control voltage (CV); modulates attB (additive offset — ±1 CV sweeps the full range, centered on the knob) |
outputs
| id | cable | what it does |
|---|---|---|
min | cv | The sample-wise minimum of the two attenuverted inputs, min(A', B') — follows whichever signal is lower at each moment. control voltage (CV) |
max | cv | The sample-wise maximum, max(A', B') — follows whichever signal is higher; MAX of two envelopes acts as an OR-style 'either triggers'. control voltage (CV) |
diff | cv | The signed difference A' − B' — zero when the two match, swinging positive or negative as they diverge. control voltage (CV) |
sum | cv | The sum A' + B' run through a tanh soft-clipper, so it stays within ±1 and saturates gracefully instead of hard-clipping when both inputs are loud (at low levels it is nearly transparent). control voltage (CV) |
product | cv | The product A' × B' through the same tanh soft-clip: ring modulation for two audio inputs, or a smooth multiplicative blend for two CVs. control voltage (CV) |
params
| id | label | range | default | curve |
|---|---|---|---|---|
attA | Att A | -1..1 | 1 | linear |
attB | Att B | -1..1 | 1 | linear |
controls
| control | what it does |
|---|---|
| Att A | Bipolar attenuverter for input A (-1 to +1, default +1): +1 passes A through, 0 removes it from the math, negative values invert its sign. The ATT A CV input adds to this position. |
| Att B | Bipolar attenuverter for input B (-1 to +1, default +1): +1 passes B, 0 removes it, negative inverts. The ATT B CV input adds to this position. |
source
analog-logic-maths.ts on GitHub.