Math and Logic
Math nodes turn raw signals into useful patch behavior. Use them when you want to scale, offset, constrain, or remap numbers.
These nodes work on control-style signals rather than audio. They are best for modulation, thresholds, and decision-making.
Math Nodes Work On Raw Numbers
Math nodes treat their inputs as numbers. They do not preserve musical meaning automatically.
- Adding a pitch signal applies a numeric offset in that pitch domain.
- Multiplying pitch, MIDI-note, gate, or trigger signals changes raw magnitude, not musical intent.
- Map Range and Clamp are usually safer than ad hoc scaling when a destination expects a specific range.
If the meaning of a signal changes, convert it first. Then use math nodes to scale or offset it. See Data Types and Conversion.
For anything musical — transposing by semitones, snapping to a key — use the pitch nodes instead of arithmetic. See Pitch and Scales.
Core Math Jobs
Add and subtract
Use Add and Subtract to create offsets and bias values.
Good uses:
- Push an LFO above or below a centre point
- Add envelope amount on top of a base value
- Offset an already-pitch-domain control signal by a fixed amount
Multiply and divide
Use Multiply and Divide to scale a signal up or down.
Good uses:
- Control modulation depth
- Reduce the strength of an envelope
- Build simple ratio-style scaling
Be careful with pitch, MIDI-note, gate, and trigger signals. These nodes do raw math, not musically aware transforms.
Clamp and map range
Use:
This is the most common utility pattern in Throughline. If a source gives you 0 to 1 but the destination is useful between 200 Hz and 2000 Hz, Map Range is the clean way to bridge them: set the paired In range to describe the source and the paired Out range to describe the destination.
Map Range has its own Clamp Output toggle, on by default, so it already holds the result inside the output range. Add a separate Clamp node only when you need bounds that differ from the mapping, or when Min and Max should themselves be driven by other signals — Clamp exposes both as inputs.
Reach for Map Range before reaching for Multiply and Add. It states the intended output range directly instead of leaving a reader to work it out from two constants.
Thresholds With Compare
Compare tests two control signals against each other. It is the node to use when you want a patch to react at a threshold rather than follow a value continuously.
Patch the changing signal into A and the threshold into B, then pick the test with Mode: >, >=, <, <=, =, or ≠.
It gives you two outputs:
- Gate stays high while the comparison holds
- Changed fires a one-sample trigger the moment the result flips
Use Gate when something should stay active for as long as the condition holds — "open while this is above that". Use Changed when something should fire once at the crossing, such as retriggering an envelope.
A fixed threshold is easiest to read as a Value node patched into B, because the number then appears in the patch instead of hiding in a parameter.
Common Patch Examples
Scale an LFO before it hits a parameter
- Start with LFO.
- Send it through Multiply with a depth control.
- If needed, add a bias with Add.
- Send the result to the destination parameter.
This makes modulation amount explicit instead of hiding it inside the destination node.
Turn a threshold into a gate
- Start with a changing control source, such as an Envelope Follower tracking a drum bus.
- Compare it against a reference using Compare.
- Use the
gateoutput to drive a modulation step. - Use the
changedoutput when you need a one-shot event on crossing.
Diagram as text
Envelope Follower connects to Compare via Value. Value connects to Compare via B. Compare connects to ADSR Gate via Gate.
graph LR
SRC[Envelope Follower] -->|Value| CMP[Compare]
REF[Value] -->|B| CMP
CMP -->|Gate| DEST[ADSR Gate]Remap a controller into a useful range
- Start with a normalized control source such as CC Extractor.
- Use Map Range to translate it into the destination range.
- Leave Clamp Output on so a controller at full travel cannot push past the range.
Diagram as text
CC Extractor connects to Map Range via CC A–CC D. Map Range connects to Filter via Result.
graph LR
CC[CC Extractor] -->|CC A–CC D| MAP[Map Range]
MAP -->|Result| FILT[Filter]Rules of Thumb
- Use math nodes for numbers, not for guessing musical meaning.
- Treat nonzero as true when working with
Compare. - Use Map Range and Clamp when a destination expects a particular range.
- Use the
gateoutput of Compare for a held condition andchangedfor a one-shot event. - If a signal's meaning changes, convert first and do math second.