Data to control

Turn numbers into one control lane for a parameter or control input, mapped from a declared range.

  • Bridge
  • Since 0.2.0
  • bridge
  • control
  • modulation
  • map
  • range
  • parameter
  • data

Open in TuneToys

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

Data to control is the bridge from the data domain into sound. Numbers arrive as messages; it writes them onto a control lane that a parameter socket or control input reads at the next audio block.

What it does#

Each number on value is mapped from the Input minimum–Input maximum range onto 0–1: (value − min) / (max − min). Booleans count as 0 and 1. The compiler turns the node's control output into a bridge lane, and the audio engine samples it at the start of each block, exactly like a sensing node. A parameter socket such as a filter's @cutoff then moves across its own range, logarithmically when the parameter is logarithmic, and the parameter's smoothing applies.

Until the first number arrives the parameter keeps its base value. On hosts without the data domain (the Player, exports) the lane is never written, so the parameter stays at its base value there too.

When to use it#

Use it at the end of any data chain that should change the sound: weather to delay time, dataset rows to a filter, random numbers to a pitch. Put a Convert before it when the number is inside JSON.

Ports#

PortDirectionSignalLanes
valueInputData (number)1
controlOutputControl1

Parameters#

ParameterLabelRangeDefaultUnitScaleNotes
minInput minimum-1000000 to 10000000linearValue mapped to 0 on the control lane.
maxInput maximum-1000000 to 10000001linearValue mapped to 1 on the control lane.
clampClamp0 to 11linearKeep the lane inside 0–1 when the value leaves the range. Choices: 0 Off, 1 On.

Input minimum (min) and Input maximum (max)#

The range of incoming numbers that maps to the bottom and the top of the lane. For temperatures you might use -10 and 35; for a 0–1 value, 0 and 1. They must differ.

Clamp (clamp)#

On keeps the lane inside 0–1 when a value leaves the range. Off lets it run past the ends; the receiving parameter still clamps to its own domain.

Tips#

  • Cable control into a parameter socket (shown with @ on the node) rather than a public parameter; data nodes never move public parameters directly.
  • Lane jumps are smoothed by the target parameter, so choose a parameter with smoothing for audible sweeps.

See also#

Convert, Random, Filter, Data cables, Control lanes.

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. Numbers move a filter

beginner Teaches: min, max, clamp

A slow random walk of numbers becomes a control lane on a filter cutoff.

Patch: Oscillator audio output connected to Filter audio input. Filter audio output connected to Patch outputs audio input. Data to control control output connected to Filter @cutoff input. Cron tick output connected to Random trigger input. Random value output connected to Data to control value input.
Connections as text
  • Oscillator audio output connected to Filter audio input
  • Filter audio output connected to Patch outputs audio input
  • Data to control control output connected to Filter @cutoff input
  • Cron tick output connected to Random trigger input
  • Random value output connected to Data to control value input
  • Input minimum 0 maps to the bottom of the cutoff lane, Input maximum 4000 to the top.
  • Clamp keeps the lane inside 0–1 if a value leaves the range.
  • The lane runs through the cutoff range logarithmically, like the knob.
Frame preview: Numbers move a filterFrame “Numbers move a filter” with 2 elements: text heading, text hint.NUMBERS MOVE A FILTERPress Play. Four times a second the cutoff moves to a new value between the dar…
Frame preview (static). Controls show their default values.

Open in TuneToys

  • Convert Convert a value to another datatype, optionally picking a field or formatting a string; failures go to error.
  • Random Make a random number, integer, boolean, string, colour or choice on each trigger; seeded when a seed is wired.
  • Filter Low-pass, high-pass, band-pass, notch, all-pass or morphing filter with resonance, 12/24 dB slopes, curve editing and output RTA.

Edit this page on GitHub

esc

↑ ↓ move↩ open⌘↩ new tabesc close