Curve

A drawn breakpoint curve on a control lane: shape the input or Position through it, or loop it at a rate, mapped onto Min to Max.

  • Control
  • Since 0.2.0
  • curve
  • breakpoint
  • shaper
  • modulation
  • control

Open in TuneToys

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

Curve is a shape you draw: points joined by straight or bent segments, read as a control lane. It can bend another control signal through the shape, or play the shape on its own as a repeating sweep.

What it does#

The curve lives in the node's points data: 2 to 32 points, each an x and a y between 0 and 1, plus a curvature between −1 and 1 for the segment to its right. Before the first point and after the last the curve holds flat; two points at the same x make a step. A curvature of 0 is a straight line, positive values start slow and finish fast, and negative values start fast and finish slow, using the same bend as Envelope. A node without points plays a straight line from (0, 0) to (1, 1).

In Shaper mode the curve is read at the control input, clamped to 0 to 1, or at Position when nothing is cabled. In Cycle mode it sweeps from 0 to 1 at Rate and starts again. Either way the curve's 0 to 1 is mapped onto Min to Max. Control runs once per audio block, so the curve is read once per block.

Drawing the curve#

On the node card, drag a point to move it; it stays between its neighbours. Double-click empty space to add a point on the curve without changing its shape. With a point focused, the arrow keys move it (Shift for fine steps), Tab moves to the next point, Backspace or Delete removes it (the first and last points stay), and the mouse wheel or Page Up and Page Down bend the segment to its right. Escape during a drag restores the curve. The change plays while you draw, and each drag or key press is one edit, so one Undo reverts it.

Events#

The cycle outlet is 1 for one block whenever a Cycle sweep starts again, and 0 otherwise, including in Shaper mode. The first block does not count. A sweep shorter than a block still reports one pulse per block, never more. Cable it into a trigger input, such as Counter, to count repeats.

When to use it#

Use it when a straight range is not enough: a filter that opens slowly and then quickly, a volume that holds and drops, a stepped pattern. Put it after a Control LFO or a sensor to reshape its motion, or use Cycle mode as a drawn LFO. For a plain range change with one bend, Scale is simpler.

Ports#

PortDirectionSignalLanes
controlInputControl1
controlOutputControl1
cycleOutputControl1

Parameters#

ParameterLabelRangeDefaultUnitScaleNotes
modeMode0 to 10linearShaper reads the curve at the input, or at Position when nothing is cabled; Cycle sweeps it from 0 to 1 at Rate, repeating. Choices: 0 Shaper, 1 Cycle.
positionPosition0 to 10linearWhere Shaper mode reads the curve while the control input is not cabled. Shown when mode is 0.
rate_hzRate0.01 to 201HzlogSweeps across the curve per second in Cycle mode. Shown when mode is 1.
minMin-8 to 80linearOutput where the curve is at the bottom of its box.
maxMax-8 to 81linearOutput where the curve is at the top of its box. Below Min inverts the curve.
  • points: floats.

Mode (mode)#

Shaper or Cycle. A discrete choice. Shaper reads the curve at its input; Cycle plays it as a repeating sweep and ignores the input.

Position (position)#

Where Shaper mode reads the curve, 0 to 1, while the control input is not cabled. Turn it by hand to scan the shape. Hidden in Cycle mode.

Rate (rate_hz)#

Sweeps per second in Cycle mode, 0.01 to 20 Hz on a logarithmic control. The sweep pauses where it is while the mode is Shaper. Hidden in Shaper mode.

Min (min)#

The output where the curve is at the bottom of its box, −8 to 8.

Max (max)#

The output where the curve is at the top of its box, −8 to 8. Set it below Min to turn the curve upside down.

Tips#

  • Leave Min at 0 and Max at 1 when the curve drives a parameter cable: the cable maps 0 to 1 across the parameter's whole range.
  • A falling curve in Cycle mode, from 1 down to 0, makes a drawn decay that repeats at Rate.
  • Add a point in the middle of a bent segment before reshaping it: the curve does not move until you drag.

See also#

Control LFO, Scale, Envelope, 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. Bend an LFO sweep

beginner Teaches: min, max

A triangle LFO read through a drawn curve opens a low-pass filter slowly, then fast.

Patch: Oscillator audio output connected to Filter audio input. Filter audio output connected to Patch outputs audio input. Control LFO control output connected to Curve control input. Curve control output connected to Filter @cutoff input.
Connections as text
  • Oscillator audio output connected to Filter audio input
  • Filter audio output connected to Patch outputs audio input
  • Control LFO control output connected to Curve control input
  • Curve control output connected to Filter @cutoff input
  • The LFO rises and falls evenly from 0 to 1. Curve reads its drawn shape at that position.
  • This curve stays low for most of the rise, then climbs fast: drag its points on the node to change that.
  • Min and Max set where the curve's bottom and top land. Swap them to turn the sweep upside down.
Frame preview: Bend an LFO sweepFrame “Bend an LFO sweep” with 3 elements: text heading, knob Max, knob Min.BEND AN LFO SWEEP1Max0Min
Frame preview (static). Controls show their default values.

Open in TuneToys

2. Loop a drawn shape

intermediate Teaches: mode, rate_hz, position

A curve in Cycle mode repeats a drawn volume shape at Rate; in Shaper mode Position scans it by hand.

Patch: Oscillator audio output connected to Gain audio input. Gain audio output connected to Patch outputs audio input. Curve control output connected to Gain @level input.
Connections as text
  • Oscillator audio output connected to Gain audio input
  • Gain audio output connected to Patch outputs audio input
  • Curve control output connected to Gain @level input
  • In Cycle mode the curve sweeps from left to right at Rate and starts again: a drawn LFO.
  • Two decays and a step between them make a long-short pulse. Each sweep starts over at the top.
  • Switch to Shaper and turn Position to read the same shape by hand.
Frame preview: Loop a drawn shapeFrame “Loop a drawn shape” with 4 elements: text heading, segmented Mode, knob Position, knob Rate.LOOP A DRAWN SHAPEShaperCycleMode0Position2 HzRate
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.
  • Scale Map a control range onto another with a curve, clamp and inversion. Depth and offset for any modulation.
  • Envelope Curved AD, AR and ADSR gain envelopes with looping and explicit retrigger behavior.

Edit this page on GitHub

esc

↑ ↓ move↩ open⌘↩ new tabesc close