# Filter

> Low-pass, high-pass, band-pass, notch, all-pass or morphing filter with resonance, 12/24 dB slopes, curve editing and output RTA.

Source: https://docs.tune.toys/nodes/std.svf/

A flexible filter that can cut highs, cut lows, isolate a band or remove one, with adjustable resonance.

## What it does

The state-variable filter has a Cutoff and a Resonance (Q). Type chooses low-pass, band-pass, high-pass, notch or all-pass, or Morph, which moves continuously from low-pass through band-pass to high-pass. Slope chooses one stage (12 dB per octave) or two cascaded stages (24 dB per octave). Higher resonance emphasizes frequencies around the cutoff, up to a ringing peak. Cutoff is capped at 0.45 times the sample rate.

## When to use it

Use it for filter sweeps, wah-style effects and subtractive tone shaping. Select Low-pass for a roll-off, High-pass to remove low frequencies, Band-pass to isolate a band, Notch to cut one, or All-pass to change phase. New filters start in Low-pass mode.

The graph shows the response for the selected type and slope. Drag across it to set Cutoff and vertically to set Resonance; the wheel adjusts resonance too. Hover or focus the graph while playing to see the real-time output spectrum (RTA) behind the response. Patch, Properties and Frame faces use the same editor.

## Ports

<!-- ports:start -->

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

<!-- ports:end -->

## Parameters

<!-- parameters:start -->

| Parameter      | Label                  | Range       | Default | Unit | Scale  | Notes                                                                                                                                                         |
| -------------- | ---------------------- | ----------- | ------- | ---- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cutoff`       | Cutoff                 | 20 to 20000 | 1200    | Hz   | log    | Filter cutoff, capped at 0.45 times sample rate.                                                                                                              |
| `resonance`    | Resonance              | 0.5 to 12   | 0.707   | Q    | linear | State-variable filter Q.                                                                                                                                      |
| `mode`         | Morph                  | 0 to 2      | 0       |      | linear | Continuous low-pass, band-pass and high-pass morph. Shown when `type` is 0.                                                                                   |
| `type`         | Type                   | 0 to 5      | 1       |      | linear | Selects the implemented algorithm. Choices are discrete and are not LFO targets. Choices: 0 Morph, 1 Low-pass, 2 Band-pass, 3 High-pass, 4 Notch, 5 All-pass. |
| `slope`        | Slope                  | 0 to 1      | 0       |      | linear | One or two cascaded state-variable stages; notch/all-pass retain their response semantics. Choices: 0 12 dB/oct, 1 24 dB/oct.                                 |
| `compensation` | Resonance compensation | 0 to 1      | 0       |      | linear | Reduces resonant gain as Q increases. Shown when `type` is 0 or 1 or 3.                                                                                       |

<!-- parameters:end -->

### Cutoff (`cutoff`)

The filter frequency, from 20 to 20000 Hz on a logarithmic control.

### Resonance (`resonance`)

The filter Q from 0.5 to 12. The default, 0.707, is a flat response. Higher values peak at the cutoff.

### Morph (`mode`)

Used when Type is Morph: 0 is low-pass, 1 is band-pass, 2 is high-pass, with smooth values between.

### Type (`type`)

Morph, Low-pass, Band-pass, High-pass, Notch or All-pass. A discrete choice.

### Slope (`slope`)

12 dB/oct uses one stage; 24 dB/oct cascades two. The notch and all-pass types keep their response meaning.

### Resonance compensation (`compensation`)

When on, reduces the gain boost that comes with a high Q. It applies to Morph, Low-pass and High-pass.

## Tips

- Start with a bright source such as a saw wave; filters need harmonics to remove.
- Sweep Cutoff with Resonance around 4 to 8 for classic filter sweeps.
- Very high resonance can be loud. Lower the level or turn Compensation on.

## See also

[Low-pass filter](https://docs.tune.toys/nodes/std.lowpass/), [Drive](https://docs.tune.toys/nodes/std.drive/), [Oscillator](https://docs.tune.toys/nodes/std.oscillator/).
