# Data to control

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

Source: https://docs.tune.toys/nodes/data.to-control/

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](https://docs.tune.toys/nodes/data.convert/) before it when the number is inside JSON.

## Ports

<!-- ports:start -->

| Port      | Direction | Signal        | Lanes |
| --------- | --------- | ------------- | ----- |
| `value`   | Input     | Data (number) | 1     |
| `control` | Output    | Control       | 1     |

<!-- ports:end -->

## Parameters

<!-- parameters:start -->

| Parameter | Label         | Range               | Default | Unit | Scale  | Notes                                                                           |
| --------- | ------------- | ------------------- | ------- | ---- | ------ | ------------------------------------------------------------------------------- |
| `min`     | Input minimum | -1000000 to 1000000 | 0       |      | linear | Value mapped to 0 on the control lane.                                          |
| `max`     | Input maximum | -1000000 to 1000000 | 1       |      | linear | Value mapped to 1 on the control lane.                                          |
| `clamp`   | Clamp         | 0 to 1              | 1       |      | linear | Keep the lane inside 0–1 when the value leaves the range. Choices: 0 Off, 1 On. |

<!-- parameters:end -->

### 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](https://docs.tune.toys/nodes/data.convert/), [Random](https://docs.tune.toys/nodes/data.random/), [Filter](https://docs.tune.toys/nodes/std.svf/), [Data cables](https://docs.tune.toys/concepts/data-cables/), [Control lanes](https://docs.tune.toys/concepts/control-lanes/).
