analoglogicmaths

analogLogicMaths · utilities

Analog-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.

An analog-logic processor that runs five continuous algebraic operations on two inputs at once — the 'analog' counterpart to ILLOGIC's digital 0/1 booleans. Two inputs A and B each pass through a bipolar attenuverter, then the module simultaneously outputs their sample-wise MINIMUM, MAXIMUM, DIFFERENCE (A-B), SUM (soft-clipped with tanh), and PRODUCT (AxB, soft-clipped). Unlike ILLOGIC nothing is ever thresholded — every output is a smooth function of the inputs, so it works equally on CV and on audio. Musically: MIN/MAX of two waveforms gives jagged or smoothed wave-mashing; MAX of two envelopes is an 'either fires' combiner; DIFF of two LFOs makes anti-correlated motion; PRODUCT of two audio signals is ring modulation, of two CVs a smooth crossfade-blend. The two attenuverters can themselves be swept by CV. FIVE THINGS TO KNOW BEFORE YOU PATCH IT, all measured on the shipping worklet through this module's own factory (art/scenarios/analog-logic-maths/face-audit.test.ts). First, SUM IS A SATURATOR, NOT A MIXER. Two dials at +1 have a nameplate gain of x2.00 and a full-scale signal in both inputs leaves SUM at x0.96 — a compression of -6.34 dB against the un-clipped sum, rising to -12.05 dB for two +/-2 sources. It reads -0.96 dB at +/-0.3 in each input and passes 1 dB by +/-0.4, so this is the normal case rather than a corner one, and it is a JOIN over BOTH dials: with ATT B at 0 the same input compresses by only -2.37 dB. The faceplate prints the live figure as `sum`. Second, DIFF IS THE ONLY JACK THAT CAN LEAVE THE +/-1 RAIL, and it is NOT soft-clipped. Its worst case is |ATT A| + |ATT B| = x2.00 at the shipped defaults, reached whenever the two inputs are anti-phase; even a modest 0.9 / -0.9 pair puts it at 1.80. SUM and PRODUCT are held under 1 by the tanh and MIN/MAX cannot exceed their own inputs, so DIFF is the one to attenuate downstream. The faceplate prints its live ceiling as `peak`. Third, DIFF IS A COMMON-MODE NULL AT THE SHIPPED DEFAULTS. Its gain on a signal present at both inputs is ATT A - ATT B, which is exactly 0.00 with both dials at +1 — so patching one LFO into both jacks gives SUM at x0.96 and DIFF at silence until you unbalance a dial. Inverting ATT B swaps the two. Fourth, WITH ONLY ONE INPUT PATCHED THE MODULE IS A RECTIFIER PAIR: the unpatched input reads 0, so MIN emits only the NEGATIVE half of what you fed it, MAX only the POSITIVE half, and PRODUCT is bit-exactly silent. That is useful (a free full-wave pair from MIN and MAX) but it is not what a jack labelled MIN suggests. Fifth, THE TWO CV INPUTS ARE HALF-DEAD AT THE FACTORY SETTINGS. ATT A and ATT B ship at +1, which is the top of their declared -1..+1 range, and a CV cable ADDS to the knob, so a positive CV of any size is bit-exactly ignored while the knob is at maximum. Turn the dial down to give the CV room; at +1 a bipolar LFO patched to ATT A CV is half-wave rectified.

the faceplate

analoglogicmathsacvbcvattA_cvcvattB_cvcvmincvmaxcvdiffcvsumcvproductcvaudiocvgatepitch
4 inputs · 5 outputs · 2 params

inputs

idcablewhat it does
acvInput A (bipolar CV or audio). Scaled by the ATT A attenuverter before feeding all five math operations.
control voltage (CV)
bcvInput B (bipolar CV or audio). Scaled by the ATT B attenuverter before the math.
control voltage (CV)
attA_cvcvCV 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 and the sum is clamped to the knob's own -1..+1 range. ⚠ AT THE SHIPPED DEFAULT THIS INPUT IS HALF-DEAD: ATT A ships at +1, which IS the top of that range, so a positive CV of any size — +1, +5, anything — changes the output by bit-exactly zero, and a bipolar LFO patched here is half-wave rectified (measured). Turn ATT A down to give the cable room: from a knob at 0, a +0.5 CV lands exactly where the knob at +0.5 does.
control voltage (CV); modulates attA (additive offset — ±1 CV sweeps the full range, centered on the knob)
attB_cvcvCV control over the ATT B attenuverter knob — sweep how much of input B reaches the outputs. Adds to the knob and clamps to -1..+1, with the same half-dead-at-the-default behaviour as ATT A CV: at the shipped +1 only the downward half of a bipolar CV does anything.
control voltage (CV); modulates attB (additive offset — ±1 CV sweeps the full range, centered on the knob)

outputs

idcablewhat it does
mincvThe sample-wise minimum of the two attenuverted inputs, min(A', B') — follows whichever signal is lower at each moment. ⚠ WITH INPUT B UNPATCHED THIS IS A HALF-WAVE RECTIFIER: the missing input reads 0, so min(A', 0) passes only the NEGATIVE half of A and holds 0 for the rest (measured — a 0.8 sine on A alone leaves MIN swinging -0.80 to 0.00). Useful, and not what the label suggests.
control voltage (CV)
maxcvThe sample-wise maximum, max(A', B') — follows whichever signal is higher; MAX of two envelopes acts as an OR-style 'either triggers'. ⚠ WITH INPUT B UNPATCHED IT IS THE OPPOSITE HALF-WAVE RECTIFIER to MIN: max(A', 0) passes only the POSITIVE half of A. MIN and MAX together therefore give a free full-wave pair off one input.
control voltage (CV)
diffcvThe signed difference A' - B' — zero when the two match, swinging positive or negative as they diverge. ⚠ THE ONLY JACK ON THIS MODULE THAT CAN LEAVE THE ±1 RAIL, and the only one with NO soft-clip. Its worst case is |ATT A| + |ATT B| — ×2.00 at the shipped defaults on a bus whose convention is ±1, reached whenever the two inputs are anti-phase, and a modest 0.9 / -0.9 pair already reads 1.80 (measured). SUM and PRODUCT are held under 1 by their tanh and MIN/MAX cannot exceed their own inputs, so this is the jack to attenuate downstream; the faceplate prints its live ceiling as `peak`. ⚠ AND AT THE SHIPPED DEFAULTS IT IS A COMMON-MODE NULL: its gain on a signal present at BOTH inputs is ATT A - ATT B = 0.00 with both dials at +1, so patching one CV into both jacks leaves DIFF silent until you unbalance a dial — which is what makes it a difference-taker rather than a second mixer. The faceplate prints that gain live as `diff`.
control voltage (CV)
sumcvThe sum A' + B' run through a tanh soft-clipper, so it stays within ±1 and saturates instead of hard-clipping when both inputs are loud. ⚠ IT IS A SATURATOR, NOT A MIXER, AND THE KNEE IS LOW. Against the un-clipped sum: -0.11 dB at ±0.1 in each input, -0.68 dB at ±0.25, -0.96 dB at ±0.3, -1.62 dB at ±0.4 (the 1 dB crossing is between those two), -2.37 dB at ±0.5, -6.34 dB at full scale and -12.05 dB for two ±2 sources (measured on the shipping worklet). So two dials reading +1 have a nameplate gain of ×2.00 and deliver ×0.96, and the compression is a JOIN over BOTH dials — with ATT B at 0 the same full-scale input compresses by only -2.37 dB. The faceplate prints the live figure as `sum`, beside a `peak` of ×2.00; the gap between them IS the tanh.
control voltage (CV)
productcvThe product A' × B' through a tanh soft-clip: ring modulation for two audio inputs, or a smooth multiplicative blend for two CVs. ⚠ THE SOFT-CLIP HERE PROTECTS NOTHING FOR IN-RANGE MATERIAL — |A' × B'| can never exceed 1 when both inputs are inside ±1, so the tanh is a fixed -2.37 dB of soft distortion at the corner rather than a limiter (it only starts limiting for over-range sources; two ±2 inputs compress by -12.05 dB). It is the module's shipped voice and is left alone. ⚠ IT IS ALSO THE ONE JACK THAT NEEDS BOTH INPUTS: with either input unpatched it is bit-exactly silent, and it is the only place the two dials MULTIPLY rather than add — halve both and this quarters. The faceplate prints its gain as `ring`.
control voltage (CV)

params

idlabelrangedefaultcurve
attAAtt A-1..11linear
attBAtt B-1..11linear

controls

controlwhat it does
Att ABipolar 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 and is clamped with it. ⚠ IT REACHES ALL FIVE JACKS, AND ITS SIGN IS THE ONE ASYMMETRY BETWEEN THE TWO DIALS: DIFF is A' - B', so ATT A enters every jack with the polarity the panel implies while ATT B inverts that one. ⚠ IT IS ALSO NOT A LEVEL CONTROL ON SUM: because SUM saturates, turning this dial from +0.5 to +1 with a full-scale input moves SUM by 0.20, not by 0.48. ⚠ AND A LEVEL METER CANNOT SEE HALF OF WHAT IT DOES — -1 and +1 differ only in SIGN, so ATT A's rms and peak on MIN/MAX are identical at both ends of the dial while DIFF and PRODUCT invert.
Att BBipolar 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 and is clamped with it. ⚠ THE TWO DIALS ARE NOT INTERCHANGEABLE, in exactly one respect: SUM, PRODUCT, MIN and MAX are symmetric in A and B, but DIFF subtracts this channel, so swapping the two dial positions moves DIFF and nothing else. That is also why inverting this dial turns the DIFF null into the module's loudest jack and SUM into silence.

source

analog-logic-maths.ts on GitHub.

Generated from packages/web/src/lib/{audio,video}/module-registry.ts · repo