Scale / Offset

UtilityscaleoffsetModerate CPU

Affine map — Gain × In + Offset. Invert, bias, range-map, or convert a knob to musical pitch.

What it does

Multiply-then-add on any control signal — invert, bias, range-map, emit a constant, or turn a knob into musical pitch.

Pure inline arithmetic — no DaisySP class, no state. The affine stage emits gain * in + offset as a single expression, and with In unwired the term collapses to the Offset alone, which is the idiomatic constant source. The Curve setting then decides how that result is read. On Linear it IS the output. On Exponential and Semitones it is instead a distance from Root, and the tile emits root * exp2f(distance) — a frequency in Hz. That is Pd's mtof, and it exists because pitch is exponential while an affine map is not: no Gain/Offset pair can turn a linear knob into even intervals. Note Pad solves the same problem with a baked LUT but only runs on Touch 2, so before this the Pod and the Seed had no route to musical pitch at all.

Parameters

  • Gain

    gain
    Default 1

    What the input is multiplied by, before Offset is added. Negative values invert. On the two pitch curves this is how WIDE the sweep is: with Semitones, a Gain of 12 means the full 0–1 travel of a knob covers one octave, and 24 covers two.

  • Offset

    offset
    Default 0

    What is added after the multiply. With the input unwired the tile emits this value alone, which is the idiomatic constant source. On the two pitch curves it shifts the whole sweep: with Semitones, an Offset of -12 puts everything an octave below Root.

  • Curve

    curve
    Default linear

    How the Gain × In + Offset result is read. Linear means it IS the output — the tile as it has always behaved. Exponential and Semitones instead treat it as a distance from Root and emit a FREQUENCY IN HZ, which is what makes this the knob-to-pitch converter: pitch is exponential and no Gain/Offset pair can be. Exponential counts octaves, Semitones counts semitones — the same curve, twelve times finer. Both ignore nothing else: Gain still sets the width of the sweep and Offset still shifts it. Pick Semitones if you want to think in notes.

  • Root (Hz)

    root
    Default 261.63Range 1 … 20000

    The frequency the sweep is measured from — what the tile emits when Gain × In + Offset comes to zero. The default 261.63 Hz is middle C (C4), the same note Note Pad's default root lands on. ⚠ Ignored entirely on the Linear curve, where there is no frequency to be relative to.

Out = Gain × In + Offset. Invert a 0–1 signal with Gain -1 / Offset 1; bias an LFO with Gain 0.5 / Offset 0.5; scale one pot differently per destination. Leave In unwired and the tile becomes a constant equal to Offset. Root is unused on this curve.

Shown for the default parameters — this changes with them.

Ports

In

  • In input

Out

  • Out output

Audio Control

Inputs

In
Control (or audio) signal to remap. Unwired → the tile is a constant.

Outputs

Out
On Linear, Gain × In + Offset. On the two pitch curves, a FREQUENCY IN HZ relative to Root — wire it into an Oscillator's Freq, not into something expecting 0–1.

Rules and gotchas

  • Gain, Offset, Curve and Root are all baked at build time — modulate them by chaining a second tile, not from the canvas.
  • ⚠ The output UNIT changes with the curve. Linear emits whatever the arithmetic produces; Exponential and Semitones emit Hz. A patch that switches curve without re-checking where Out is wired will send a frequency into a gain, or the reverse.
  • Root is ignored on Linear. There is no frequency to be relative to, so the field is inert rather than wrong.
  • On the pitch curves the exponent is clamped to ±10 octaves — Root × 2^x reaches infinity quickly, and an inf into an oscillator is silence or noise behind a green compile. Root/1024 to Root×1024 is outside audio at both ends, so the clamp never bites a real patch.
  • No clamping anywhere else: on Linear the output range is whatever the arithmetic produces, exactly as before.
  • Gain is the width of a pitch sweep and Offset moves it. With Semitones, Gain 12 makes a knob cover one octave and Offset -12 drops the whole range an octave; the equivalents on Exponential are 1 and -1.

Patches using it

  • Math - Compare and Gatepatch_sm
  • Pod Shift Pagespod

Bundled with the app — open one from the example browser.