# Pivotta

> One-knob performance filter: turn left and a low-pass sweeps down from the top to the deep bass, turn right and a high-pass sweeps up to thin the sound out; the centre is a clean bypass. Resonance adds a peak at the cutoff; Steep switches 12 to 24 dB/oct.

- Engine id: `org.sournd.filter.pivotta`
- Category: Filter
- Licence: free: a closed library, free to use in your plugins, downloaded with no account or email
- Download (no account or email): https://sournd.com/download/free/macos (macOS universal), https://sournd.com/download/free/linux (Linux x86_64 and aarch64) or https://sournd.com/download/free/windows (Windows x64). One archive with every free engine: static library, C headers, README.
- Version: 1.0.0
- Latency: 0 samples
- Tail: 0.05 s
- Sidechain input: no
- Channels: mono or stereo
- Audio demo: https://sournd.com/static/preview/demos/pivotta.mp3 (a bass line, default settings)

## Parameters

The id is the C ABI parameter id and the JUCE parameter id (as a decimal string).

| Id | Key | Name | Min | Max | Default | Unit | Taper |
|---|---|---|---|---|---|---|---|
| 0 | `filter` | Filter | -100 | 100 | 0 | % | linear |
| 1 | `resonance` | Resonance | 0 | 100 | 20 | % | linear |
| 2 | `steep` | Steep | 0 | 1 | 1 | - | linear |
| 3 | `mix` | Mix | 0 | 100 | 100 | % | linear |

## Use it in JUCE

CMake ([quick start](/docs/juce/index.md)):

```cmake
juce_add_module(path/to/sournd_engine)
target_include_directories(MyPlugin PRIVATE path/to/include)
target_link_libraries(MyPlugin PRIVATE sournd_engine path/to/libsournd_cabi.a)
```

C++:

```cpp
#include <sournd_engine/sournd_engine.h>

sournd::SourndEngine engine { "org.sournd.filter.pivotta" };
juce::AudioProcessorValueTreeState parameters { *this, nullptr, "Parameters",
    sournd::SourndEngineParameters::createLayout (engine) };
sournd::SourndEngineParameters bridge { engine, parameters };

// prepareToPlay
engine.prepare ({ sampleRate, (juce::uint32) maximumBlock, 2 });
bridge.prepare (sampleRate);
setLatencySamples ((int) engine.latency());

// processBlock
bridge.apply ((uint32_t) buffer.getNumSamples());
juce::dsp::AudioBlock<float> block { buffer };
engine.process (juce::dsp::ProcessContextReplacing<float> { block });

// get/setStateInformation: hold getCallbackLock() around saveState / loadState,
// so state work never overlaps processBlock (full example: /docs/juce/)
```

Plain C:

```c
sournd_engine *e = NULL;
if (sournd_engine_create("org.sournd.filter.pivotta", &e) == SOURND_OK) {
    sournd_engine_prepare(e, 48000.0, 512);
    sournd_engine_set_param(e, 0, 0); /* Filter */
    sournd_engine_process(e, in, out, 2, frames);
    sournd_engine_destroy(e);
}
```

## How it is made

Original sOURnd design: two cascaded zero-delay-feedback state-variable filters whose mode follows the knob's side, a logarithmic cutoff map per side, a dead zone and a smooth blend around the centre for an exact bypass, and resonance split between the stages.

## Ask your AI

Paste this into your coding assistant:

```text
Add the sournd engine org.sournd.filter.pivotta to my JUCE plugin. Follow https://sournd.com/docs/juce/index.md
and the engine reference at https://sournd.com/engines/pivotta/index.md. Expose every parameter through APVTS.
```
