Scale

Map a control range onto another with a curve, clamp and inversion. Depth and offset for any modulation.

  • Control
  • Since 0.2.0
  • scale
  • range
  • curve
  • map

Open in TuneToys

Scale as the Patch draws it, at default values: inlets on the left, outlets on the right.

Scale maps a control range onto another range, with a curve, a clamp and inversion. It is how you set depth and offset for any modulation.

What it does#

The input range (Input min to Input max) is mapped linearly onto the output range (Output min to Output max), then bent by Curve. Curve at 0 is a straight line; negative values ease in (slow start, fast finish) and positive values ease out. Clamp holds the result inside the output range; with Extrapolate, input beyond the input range continues past the output range. All four range values run from -10000 to 10000. To invert a signal, set Output min higher than Output max. The same mapping applies to every lane of the input.

When to use it#

Use it between any source and destination whose ranges differ: shrink an LFO to a small depth around a value, flip a sensor, or reshape a linear ramp. Pair it with Control LFO for modulation.

Ports#

PortDirectionSignalLanes
controlInputControlInferred from the cable
controlOutputControlInferred from the cable

Parameters#

ParameterLabelRangeDefaultUnitScaleNotes
in_minInput min-10000 to 100000linearInput value that maps to Output min.
in_maxInput max-10000 to 100001linearInput value that maps to Output max.
out_minOutput min-10000 to 100000linearOutput at Input min.
out_maxOutput max-10000 to 100001linearOutput at Input max.
curveCurve-1 to 10linearBend of the mapping: negative eases in, positive eases out, 0 is linear.
clampClamp0 to 11linearHold the output inside its range instead of extrapolating. Choices: 0 Extrapolate, 1 Clamp.

Input min (in_min) and Input max (in_max)#

The input values that map to Output min and Output max. Narrowing this range makes the mapping more sensitive.

Output min (out_min) and Output max (out_max)#

The output at Input min and at Input max. Swap them to invert.

Curve (curve)#

From -1 to 1. 0 is linear, negative values ease in and positive values ease out.

Clamp (clamp)#

Clamp holds the output inside Output min and Output max; Extrapolate lets it run past them.

Tips#

  • The defaults map 0 to 1 onto 0 to 1 and change nothing.
  • To use 1 - x, set Output min to 1 and Output max to 0.
  • Scale one control lane or a whole bundle; every lane is treated the same.

See also#

Control LFO, Smooth, Math, Cables.

Help patches

Each help patch is an ordinary Toy that teaches one idea. The diagram shows the Patch; the preview shows its Frame. Open it in TuneToys to play and edit it.

1. Map one range to another

beginner Teaches: in_min, in_max, out_min, out_max

An LFO is remapped by input and output range knobs.

Patch: Oscillator audio output connected to Patch outputs audio input. Control LFO control output connected to Scale control input.
Connections as text
  • Oscillator audio output connected to Patch outputs audio input
  • Control LFO control output connected to Scale control input
  • The LFO sweeps 0 to 1. Scale maps Input min and Input max onto Output min and Output max.
  • Set Output min above Output max to invert the signal.
Frame preview: Map one range to anotherFrame “Map one range to another” with 5 elements: text heading, knob Input max, knob Input min, knob Output max, knob Output min.MAP ONE RANGE TO ANOTHER1Input max0Input min1Output max0Output min
Frame preview (static). Controls show their default values.

Open in TuneToys

2. Bend with a curve and choose clamping

intermediate Teaches: curve, clamp

A curve bends a ramp, and clamp decides what happens outside the range.

Patch: Oscillator audio output connected to Patch outputs audio input. Control LFO control output connected to Scale control input.
Connections as text
  • Oscillator audio output connected to Patch outputs audio input
  • Control LFO control output connected to Scale control input
  • A saw LFO feeds an input range of 0.2 to 0.8, so the ends of the ramp fall outside it.
  • Clamp holds those ends at 0 and 1. Extrapolate lets them continue past.
  • Curve bends the middle of the mapping.
Frame preview: Bend with a curve and choose clampingFrame “Bend with a curve and choose clamping” with 3 elements: segmented Clamp, knob Curve, text heading.Extrapola…ClampClamp0CurveBEND WITH A CURVE AND CHOOSE CLAMPING
Frame preview (static). Controls show their default values.

Open in TuneToys

  • Control LFO A free-running or tempo-synced low-frequency oscillator on a control lane, 0 to 1, with depth, offset, phase, skew, random shapes and a reset input.
  • Smooth Slow a control lane down with separate rise and fall times so jumpy sensors and buttons stop clicking.
  • Math Arithmetic on any signal, lane by lane: add, multiply, divide, power and more on audio or control operands. The output runs at the rate of its fastest input.

Edit this page on GitHub

esc

↑ ↓ move↩ open⌘↩ new tabesc close