# Envelope follower

> Track the level of an audio bundle as one control lane per channel, with attack and release.

Source: https://docs.tune.toys/nodes/ctl.follow/

Envelope follower tracks the level of an audio bundle and outputs it as one control lane per channel.

## What it does

Audio comes in and a slowly moving level comes out. Detector chooses RMS (a smoothed average of the signal's energy) or Peak (the largest swing). Attack sets how fast the level rises and Release how fast it falls, in milliseconds. Gain boosts the audio before it is measured so quiet sources can reach 1; the audio itself passes on unchanged elsewhere because the follower only produces a control output. Stereo audio gives a two-lane output.

## When to use it

Use it to make something react to loudness: scale the follower's output and cable it to a control. For per-frequency reaction use [Band energies](https://docs.tune.toys/nodes/ctl.bands/).

## Ports

<!-- ports:start -->

| Port      | Direction | Signal  | Lanes                   |
| --------- | --------- | ------- | ----------------------- |
| `audio`   | Input     | Audio   | Inferred from the cable |
| `control` | Output    | Control | Inferred from the cable |

<!-- ports:end -->

## Parameters

<!-- parameters:start -->

| Parameter    | Label    | Range     | Default | Unit | Scale  | Notes                                                       |
| ------------ | -------- | --------- | ------- | ---- | ------ | ----------------------------------------------------------- |
| `attack_ms`  | Attack   | 0 to 2000 | 10      | ms   | linear | How fast the follower rises.                                |
| `release_ms` | Release  | 0 to 5000 | 200     | ms   | linear | How fast the follower falls.                                |
| `mode`       | Detector | 0 to 1    | 0       |      | linear | Measure RMS or peak level. Choices: 0 RMS, 1 Peak.          |
| `gain_db`    | Gain     | -24 to 48 | 0       | dB   | linear | Boost applied before the follower so quiet sources reach 1. |

<!-- parameters:end -->

### Attack (`attack_ms`)

How fast the follower rises, 0 to 2000 ms.

### Release (`release_ms`)

How fast the follower falls, 0 to 5000 ms.

### Detector (`mode`)

RMS or Peak. RMS follows perceived level; Peak reacts to short transients. A discrete choice.

### Gain (`gain_db`)

Boost, from -24 to 48 dB, applied before the follower so quiet sources reach 1.

## Tips

- Use a fast Attack and a slower Release for a natural-looking level.
- If the output barely moves, raise Gain.

## See also

[Band energies](https://docs.tune.toys/nodes/ctl.bands/), [Smooth](https://docs.tune.toys/nodes/ctl.smooth/), [Scale](https://docs.tune.toys/nodes/ctl.scale/), [Cables](https://docs.tune.toys/concepts/cables/).
