Skip to content

Math & Logic

These are the basic building blocks for doing simple maths and making decisions inside your patch (your connected setup of nodes). The Math nodes work with numbers: they can add, multiply, compare, rescale, turn a musical note into a pitch, and more. The Logic nodes handle the "what happens next" side: they route signals, count, switch things on and off, add small delays, and react to incoming messages and events. Most of the number nodes are flexible about what you feed them: give them a plain number, a one-off event (a trigger or message), or a fast-changing control signal (an audio-rate CV signal, the kind used to move things automatically), and they adjust on their own. So the same node can do a single quick calculation or smoothly shape a moving signal moment by moment. Every node below shows its current value or result right on the node, and most let you wire other parts of your patch into their settings so those settings can be controlled automatically.

CV Edge Split

Takes an on/off signal (a gate) and splits it into two separate triggers: one fires the moment the signal turns on (note-on), and the other fires the moment it turns off (note-off). This is handy when you want the start and the end of a note to do different things.

CV Edge Split

Inputs: In (gate or boolean signal, accepts a stream or events). Outputs: On True (pulse on the rising edge), On False (pulse on the falling edge).


CV Counter

Counts each trigger it receives and sends out the running total as a steady control value. Choose to count Up, Down, or Up/Down (bouncing back and forth like a ping-pong ball). Useful for stepping through patterns, picking which item is active, or building up a value over time.

CV Counter

ParameterRangeDefaultDescription
ModeUp / Down / UpDownUpCounting direction. Up wraps from Max back to Min, Down wraps from Min back to Max, UpDown bounces between the two.
Min-1024 to 10240Lower bound of the counter range.
Max-1024 to 102415Upper bound of the counter range.

Inputs: Trigger (each rising edge advances the count), Reset (returns the count to Min, or Max in Down mode). Outputs: Count (the current value, held as a continuous CV stream).


If

This node compares two values and then sends out one of two results depending on the answer. When the comparison A op B is true, the Then output sends the Then value and the Else output sends 0. When it is false, the Else output sends the Else value and the Then output sends 0. For the "is equal" check there is an adjustable wiggle room, so signals that move in small fixed steps (like MIDI knob movements) still count as matching reliably.

If

ParameterRangeDefaultDescription
AAny value0Left operand of the comparison.
BAny value0Right operand of the comparison.
Op== / != / < / <= / > / >===The comparison operator.
ThenAny value1Value routed to Then Out when the comparison is true.
ElseAny value0Value routed to Else Out when the comparison is false.
Tol0 and up1/127Equality tolerance used by == and !=. Set 0 for exact float equality. Ordering operators ignore this.

Inputs: A, B, Then, Else, Op, Tol (every value input accepts a value, an event, or a CV stream). Outputs: Then Out (the Then value when true, else 0), Else Out (the Else value when false, else 0).


Logic

Combines two on/off conditions into one answer. Pick a gate: AND, OR, XOR, NOT, NAND, NOR or XNOR. An input counts as true when it is above 0 (a 1 is true, a 0 is false), which is exactly what an If node's Then Out gives, so you can wire two If outputs into A and B and pick AND or OR. Out is 1 when the gate is true and 0 when false. An unconnected input is ignored (AND or OR of a single wired input is just that input), and you can chain Logic nodes together for more than two conditions.

Logic

ParameterRangeDefaultDescription
ModeAND / OR / XOR / NOT / NAND / NOR / XNORANDThe boolean operation applied to A and B.
AAny value0First condition. Counts as true when above 0.
BAny value0Second condition. Counts as true when above 0.

Inputs: A, B, Mode (every input accepts a value, an event, or a CV stream; Mode also takes the gate by CV/Data). Outputs: Out (1 when the gate is true, 0 when false).


Addition

Adds two values together. Output = A + B. Use it to combine two control sources, shift a value up by a fixed amount, or blend signals together.

Addition

Inputs: A, B (stream-capable). Outputs: Result (A + B).


Subtract

Takes one value away from another. Output = A - B. Handy for finding the gap between two control sources, lowering a value by a fixed amount, or cancelling a signal out.

Subtract

Inputs: A, B (stream-capable). Outputs: Result (A - B).


Multiply

Multiplies two values. Output = A * B. When one input is audio, it works like a volume control (turning the sound up or down). You can also use it to scale a control signal up or down.

Multiply

Inputs: A, B (stream-capable). Outputs: Result (A * B).


Divide

Divides one value by another. Output = A / B. Useful for scaling things down, working out ratios, or reducing the volume by a set amount. If you try to divide by zero, the output is 0.

Divide

Inputs: A, B (stream-capable). Outputs: Result (A / B, or 0 when B is 0).


Min

Sends out whichever of the two values is smaller: Min(A, B). Useful for setting a ceiling on a signal, keeping things from going too high, or always picking the lowest of several control sources.

Min

Inputs: A, B (stream-capable). Outputs: Result (the smaller of A and B).


Max

Sends out whichever of the two values is larger: Max(A, B). Useful for setting a floor on a signal, picking the loudest of several signals, or having one sound automatically lower another (ducking).

Max

Inputs: A, B (stream-capable). Outputs: Result (the larger of A and B).


Power

Raises A to the power of B. Output = A^B. Good for bending a control signal into a curve, creating exponential responses, and building your own custom shapes.

Power

Inputs: A (base), B (exponent), both stream-capable. Outputs: Result (A raised to B).


Modulo

Gives you the remainder after dividing A by B. Use it to wrap values around so they stay inside a range, build repeating ramps, or loop a control pattern. If B is zero, the output is 0.

Modulo

Inputs: A, B (stream-capable). Outputs: Result (remainder of A / B, or 0 when B is 0).


Abs

Gives the absolute value: it drops the minus sign so negative numbers become positive. Handy for turning a signal that swings both above and below zero into one that only goes positive, or for getting how far a value is from zero regardless of direction.

Abs

Inputs: X (stream-capable). Outputs: Result (the absolute value of X).


Negate

Flips the sign (positive becomes negative and the other way round). Output = -X. Use it to reverse the direction of a control signal, mirror a signal, or flip its phase (turn it upside down).

Negate

Inputs: X (stream-capable). Outputs: Result (-X).


Sqrt

Gives the square root of X, and never goes below 0 so it stays safe. Useful for turning even, straight-line values into ones that feel more natural to the ear, or for gently softening the shape of a control signal.

Sqrt

Inputs: X (stream-capable; negative inputs are treated as 0). Outputs: Result (square root of X).


Exp

Calculates e^X (an exponential curve). Turns an even, straight-line control into a curved one, which makes sweeps and timing feel more natural to the ear.

Exp

Inputs: X (stream-capable). Outputs: Result (e raised to X).


Log

Calculates the natural logarithm, which does the opposite of Exp. It squeezes a very wide range of values down into a smaller, easier-to-handle range.

Log

Inputs: X (stream-capable). Outputs: Result (natural logarithm of X).


Linear To dB

Converts a plain volume amount into decibels (dB, the usual way of measuring loudness): 20 * log10(amplitude). Useful for showing a level in dB or for feeding controls that expect dB. Values very close to zero are pinned to -144 dB.

Linear To dB

Inputs: Linear (linear amplitude; 1.0 = 0 dB, 0.5 = -6 dB). Outputs: dB (the level in decibels).


dB To Linear

Converts decibels back into a plain volume amount: 10^(dB / 20). This is the reverse of Linear To dB, handy when you have a dB setting and need to turn it into an actual volume factor.

dB To Linear

Inputs: dB (a level in decibels; 0 dB = 1.0, -6 dB = 0.5). Outputs: Linear (the linear amplitude).


Sin

Gives the sine of X, where X is measured in radians (a way of measuring angles). Use it to shape values into smooth, repeating waves, to drive oscillators by their phase, or to create gentle cyclic shapes.

Sin

Inputs: X in radians (stream-capable). Outputs: Result (sine of X).


Phase Sine

Like Sin, but it reads X as a phase position instead of an angle: 0 to 1 means one full cycle, and the output swings from -1 to 1. Feed it a repeating ramp (a phasor) and a smooth sine wave comes out, with no need to scale anything into radians first. Handy for phase-driven oscillators and cyclic shapes built from ramps.

Phase Sine

Inputs: X (the phase, where 0 to 1 is one full cycle; stream-capable). Outputs: Result (the sine of the phase, -1 to 1).


Cos

Gives the cosine of X, where X is measured in radians (a way of measuring angles). Pair it with Sin to make two LFOs that move a quarter-step apart, or for smooth equal-volume crossfades.

Cos

Inputs: X in radians (stream-capable). Outputs: Result (cosine of X).


Tan

Gives the tangent of X, where X is measured in radians (a way of measuring angles). It makes steep, dramatic curves that shoot off toward infinity, good for bold, experimental sound-shaping.

Tan

Inputs: X in radians (stream-capable). Outputs: Result (tangent of X).


Floor

Rounds a number down to the nearest whole number. Use it to snap a smoothly changing value down onto whole-number steps.

Floor

Inputs: X (stream-capable). Outputs: Result (X rounded down).


Ceil

Rounds a number up to the nearest whole number. Use it to snap values upward, or to make sure a value always lands on or above a whole-number step.

Ceil

Inputs: X (stream-capable). Outputs: Result (X rounded up).


Round

Rounds a number to the nearest whole number the normal way (down if it is below halfway, up if it is at or above). Use it to snap a control signal onto whole-number steps.

Round

Inputs: X (stream-capable). Outputs: Result (X rounded to the nearest integer).


Greater Than

Compares two values and asks "is A bigger than B?". It sends out 1 when A > B, and 0 otherwise. Use it to react when a signal goes above a certain level, or to switch something on past a threshold.

Greater Than

Inputs: A, B (stream-capable). Outputs: Result (1 when A > B, otherwise 0).


Less Than

Compares two values and asks "is A smaller than B?". It sends out 1 when A < B, and 0 otherwise. This is the mirror image of Greater Than, for reacting when a signal drops below a level.

Less Than

Inputs: A, B (stream-capable). Outputs: Result (1 when A < B, otherwise 0).


Equal

Checks whether two values match, with a little built-in wiggle room so near-matches still count. It sends out 1 when A and B are equal, and 0 otherwise. Use it to spot a particular value or to recognise a pattern.

Equal

Inputs: A, B (stream-capable). Outputs: Result (1 when A and B are equal, otherwise 0).


Clamp

Keeps X between a Min and a Max, leaving values that are already inside that range untouched. Useful for making sure a value never strays outside a safe range.

Clamp

ParameterRangeDefaultDescription
XAny value0The input value to clamp.
MinAny value0Lower bound of the clamp range.
MaxAny value1Upper bound of the clamp range.

Inputs: X, Min, Max (all stream-capable). Outputs: Result (X limited to the Min..Max range).


For Range

This node repeats a step over and over (a loop). Each time you trigger it, it counts from a Start number to an End number, sending out each number along the way plus a Done signal when it reaches the end. Use it to run loops, fill in lists, or play back scripted sequences. Step is always a positive amount; the direction (up or down) is worked out automatically from your Start and End numbers.

For Range

ParameterRangeDefaultDescription
StartWhole numbers0The index the loop starts from.
EndWhole numbers7The index the loop runs to (inclusive).
Step1 and up1Step size between iterations (always positive; direction follows Start and End).

Inputs: Trigger (any message starts the loop), Start, End, Step. Outputs: Index (the current loop index for each step), Event (one event per iteration), Done (fires once after the full range completes).


Once

A one-time pass. It lets the very first message through, then blocks everything after that until you reset it. Use it for things that should happen once and then stop.

Once

ParameterRangeDefaultDescription
ArmedOn / OffOnShows whether the node is ready to pass the next message.

Inputs: In (passes only once while armed), Reset (any message re-arms the node). Outputs: Out (the first message, then nothing until reset).


Every

This thins out a stream of triggers. It counts the messages coming in and sends out one Event for every N of them. Use it to slow a busy stream of triggers down to a steadier pace. It keeps going forever; if you only want the very first trigger, add a Once node after the Event output.

Every

ParameterRangeDefaultDescription
Steps1 and up1How many messages are needed before Event fires. Stream-capable, so the period can be modulated.

Inputs: In (any message counts, including events), Steps, Reset (any message resets the count to 0). Outputs: Count (the current count), Event (fires every time the count reaches Steps).


Data Delay

Holds onto an incoming message for a set amount of time, then sends it on. Use it to space out triggers, line events up in time, or add a delayed reaction. The wait time is set in milliseconds and can be controlled by a CV signal. Several messages can be waiting their turn at the same time.

Data Delay

ParameterRangeDefaultDescription
Delay (ms)0 to 10000100Time in milliseconds before the message is forwarded. Values below 1 ms pass through immediately. Stream-capable.

Inputs: In (any message to delay), Delay, Cancel (any message flushes all waiting messages without sending them). Outputs: Out (the delayed message), Pending (how many messages are currently waiting).

This is a timer for messages, not an echo effect for sound. It is accurate to about 1 ms; if you want a delay on actual audio, use a dedicated audio delay node instead.


Probability

A chance-based gate. Each message that comes in has a set chance of getting through. Use it to add random variation to patterns, randomly drop some notes, or sprinkle in a bit of controlled randomness. If you connect a CV signal instead, it decides whether each individual moment of the signal passes.

Probability

ParameterRangeDefaultDescription
Chance0 to 100 %100The probability that each incoming message or stream sample passes through.

Inputs: In (messages or a CV stream), Chance (stream-capable). Outputs: Out (the message or stream, only when the roll passes).


Gate

An on/off switch that works for both messages and CV signals. When it is open it lets things through, and when it is closed it blocks them. Use it to mute a path or to switch routing on and off. The Enable input accepts a CV signal, so you can open and close the gate rhythmically, even on audio.

Gate

ParameterRangeDefaultDescription
EnabledOn / OffOnWhen on, In passes to Out; when off, Out is blocked (or silent for CV). Events on Enable are ignored.

Inputs: In (message or CV, stream-capable), Enable (non-zero opens, zero closes; stream-capable). Outputs: Out (the forwarded message or CV when enabled).


Select

Watches an input value and fires an Event the moment it matches a value you choose. Use it to spot a specific state or to trigger something when a pattern reaches a certain point. Both inputs can be controlled at audio rate for precise timing.

Select

ParameterRangeDefaultDescription
TargetAny value0The value X is compared against.

Inputs: X (the value to check), Target (both stream-capable). Outputs: Match (an Event when X equals Target exactly).


Branch

A simple "yes or no" router. It looks at the incoming message and treats it as true or false: if it is true it fires the True output, otherwise it fires the False output. A quick way to send things down one of two paths. The node shows the last message it received.

Branch

Inputs: In (any message; numbers are true when non-zero, a bool passes through, text and events evaluate to false). Outputs: True (an Event when the input is true), False (an Event when the input is false).


Toggle

A simple on/off switch. Each trigger that comes in flips it to the opposite state and sends out the new value. Use it to build switches that stay set until flipped again.

Toggle

ParameterRangeDefaultDescription
StateOn / OffOffThe current on/off value. Flip it with a trigger, or force it with the Set input.

Inputs: Trigger (any message flips the state), Set (0/1 or false/true forces the state). Outputs: State (the current on/off value, sent on every change).


Latch

Remembers a value and only sends it out when you trigger it. Use it to grab a value and hold it, then pass it along whenever you want. Triggering it never changes the value it is holding; to change that, use the Set input. The held value is saved with your project.

Latch

Inputs: Set (stores the incoming value, does not output), Trigger (any message outputs the stored value). Outputs: Value (the stored value, emitted when triggered).


Counter

Counts the messages coming in, staying within a Min and a Max. Choose Up, Down, or Up/Down (bouncing back and forth) counting to drive step sequencers, count actions, or build pattern positions. The In trigger never sets the count directly; to set it, use the Set input. Its state is saved with your project.

Counter

ParameterRangeDefaultDescription
Mode0 = Up, 1 = Down, 2 = UpDownUpCounting direction. Stream-capable.
MinWhole numbers0Lower bound of the counter range. Stream-capable.
MaxWhole numbers127Upper bound of the counter range. Stream-capable.
SetWhole numbers0Forces the current count (no output). Stream-capable.

Inputs: In (any message outputs the count then advances), Mode, Min, Max, Set, Reset Min (any message sets the count to Min), Reset Max (any message sets the count to Max).

Outputs:

OutputDescription
CountThe current count, output on each trigger.
Min HitTrue when the current count equals Min.
Max HitTrue when the current count equals Max.

Stepper

A manual up and down counter, like the little + and - spinner buttons on a form. Any message on Up adds 1, any message on Down subtracts 1, and the new count is sent out each time. The count stays between Min and Max: with Wrap on, stepping past Max jumps back to Min (and past Min back to Max); with Wrap off, the count simply stops at the edge. Use it to build your own spinners, value pickers, or anything that counts button presses. It is the hands-on sibling of Counter: Counter is the sequencer-style one, stepping through a pattern from a single trigger, while Stepper gives you separate Up and Down controls. The count is saved with your project.

Stepper

ParameterRangeDefaultDescription
WrapOn / OffOffWhat happens at the edges: on wraps around, off stops at Min or Max.
MinWhole numbers0Lower bound of the count.
MaxWhole numbers127Upper bound of the count.
SetWhole numbers0Forces the current count (no output).

Inputs: Up (any message adds 1 and outputs the new count), Down (any message subtracts 1 and outputs the new count), Wrap, Min, Max, Set, Reset Min (any message jumps the count to Min and outputs it), Reset Max (any message jumps the count to Max and outputs it).

Outputs:

OutputDescription
CountThe current count, sent on each step or reset.
Min HitTrue when the current count equals Min.
Max HitTrue when the current count equals Max.

OnChange

Only passes a value along when it is different from the one before it. This filters out repeated messages, saves the rest of your patch from needless work, and lets things react only when something genuinely changes. The first value after you create or reset the node always passes, and an event always passes.

OnChange

Inputs: In (any message; duplicates of the previous value are suppressed), Reset (any message clears the history so the next value always passes). Outputs: Out (the value, only when it changed).


Is Number

Checks whether what came in is a real number, and passes the number along when it is. Made for checking things people type: it accepts a minus or plus sign and decimals (-5.67, +3, .5), and a single decimal comma also counts ("1,5" reads as 1.5), while text with extra characters is rejected. Valid answers on every input, but Value only fires when the input really is a number, so a control fed from Value keeps its last good value when something wrong is typed. Pair it with a Text Input widget to accept typed numbers safely. A value that is already a number passes straight through.

Is Number

Inputs: In (text or a number to test). Outputs: Valid (true when the input is a valid number, false when not), Value (the parsed number, only when valid).


Is Hex

Checks whether the incoming text is a valid hex colour code. Codes with or without a leading # are accepted, in 3, 6 or 8 digit form (0af, ff8800, aaff8800). When the code is valid, Hex sends out a cleaned-up version (lowercase, no #, short 3-digit codes expanded to 6 digits) that the Colour node accepts directly, so someone can type a colour into a Text Input widget and recolour your patch with it. Valid answers on every input; Hex only fires when the code is valid.

Is Hex

Inputs: In (text to test as a hex colour). Outputs: Valid (true when the text is a valid hex colour), Hex (the cleaned hex code, only when valid).


Is Note

Checks whether the incoming text is a valid note name like C3, A#4 or Gb2, and turns it into the matching MIDI note number (C3 is note 60). Sharps and flats both work, and a plain number from 0 to 127 counts as a valid note too. Valid answers on every input; Note only fires when the input is a real note, so bad input never disturbs whatever comes after. Wire Note into Note To Freq to get a pitch in Hz, or pair the node with a Text Input widget so notes can be typed by name.

Is Note

Inputs: In (text with a note name, or a note number to test). Outputs: Valid (true when the input is a valid note), Note (the MIDI note number, only when valid).


Map

Takes a value from one range and rescales it into another. For example, turn 0..1 into MIDI notes, MIDI notes into Hz, a 0..127 knob into dB, or anything into anything else. With Clamp on, values outside the input range are pulled back in first; with Clamp off, the rescaling keeps going past the output range. All number pins can take a control signal. An event on X sends out the last mapped value again.

Map

ParameterRangeDefaultDescription
In MinAny value-1Start of the source range.
In MaxAny value1End of the source range.
Out MinAny value0Start of the destination range.
Out MaxAny value1End of the destination range.
ClampOn / OffOnWhen on, X is limited to the input range before mapping.

Inputs: X (the value to remap), In Min, In Max, Out Min, Out Max, Clamp (all stream-capable). Outputs: Out (the remapped value).


Note To Freq

Turns a MIDI note number into a pitch in Hz (cycles per second), using 440 * 2^((note - 69) / 12). It can take a control signal, so a moving CV note coming in stays a moving CV pitch on the way out.

Note To Freq

ParameterRangeDefaultDescription
Note0 to 12760The MIDI note number. 60 is middle C, which is about 261.63 Hz. Stream-capable.

Inputs: Note (MIDI note number). Outputs: Hz (the frequency in Hz; emitted as CV when the input is CV).


Pattern File

Stores a sequencer pattern (saved as JSON text), works out what kind it is, and lets you save it to disk or load it back. Connect a sequencer's Pattern Out to this node's Pattern In, and the node shows when it is ready, the kind of pattern it found, and an optional name read from the pattern. From there you can save it to a file or send it out again whenever you like.

Pattern File

ParameterRangeDefaultDescription
Pattern NameTextemptyAn editable name stored with the pattern and written on export. Read from the pattern when available.
FileFile pathemptyPick a pattern file to load it immediately.

The node also shows three read-only readouts: Pattern Type (the kind of pattern it found, which decides the file ending used when saving), Name (the pattern name plus the suggested file ending), and Status (Empty until a pattern is stored, then Ready). Export Dialog opens a save window, and Emit Pattern sends the stored pattern out again. The file endings used when saving are .mnriff for a MIDI Riff, .mnsliderseq for a Slider Sequencer, and .mntoggleseq for a Toggle Sequencer.

Inputs: Pattern In (Pattern JSON from a sequencer), Pattern Name (optional name), File (optional file path to load), Emit Pattern (re-sends the cached pattern). Outputs: Pattern Out (the loaded Pattern JSON, ready to reconnect into a sequencer's Pattern In).


MNodes Documentation