# Sifta

> Spectral gate: splits the sound into a thousand narrow slices and lets each one through only while it is louder than the threshold, so hiss, room and bleed between the notes fall away while the notes stay. Invert it to keep only the quiet residue.

- Engine id: `org.sournd.filter.sifta`
- Category: Filter
- Licence: paid: £2.99 an effect or £4.99 a synth, once (owned for good, with updates), or included in the Everything plan (£14.99 a month)
- Version: 1.0.0
- Latency: 1024 samples
- Tail: 0.05 s
- Sidechain input: no
- Channels: mono or stereo
- Audio demo: https://sournd.com/static/preview/demos/sifta.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 | `threshold_db` | Threshold | -90 | 0 | -60 | dB | linear |
| 1 | `range_db` | Range | -90 | 0 | -60 | dB | linear |
| 2 | `low_hz` | Low | 20 | 20000 | 20 | Hz | log |
| 3 | `high_hz` | High | 20 | 20000 | 20000 | Hz | log |
| 4 | `smear` | Smear | 0 | 100 | 10 | % | linear |
| 5 | `attack_ms` | Attack | 1 | 200 | 10 | ms | log |
| 6 | `release_ms` | Release | 10 | 2000 | 120 | ms | log |
| 7 | `invert` | Invert | 0 | 1 | 0 | - | linear |
| 8 | `mix` | Mix | 0 | 100 | 100 | % | linear |
| 9 | `output_db` | Output | -24 | 12 | 0 | dB | 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.sifta" };
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.sifta", &e) == SOURND_OK) {
    sournd_engine_prepare(e, 48000.0, 512);
    sournd_engine_set_param(e, 0, -60); /* Threshold */
    sournd_engine_process(e, in, out, 2, frames);
    sournd_engine_destroy(e);
}
```

## How it is made

Original sOURnd design blending general techniques: a Hann-windowed short-time Fourier transform with 75 % overlap-add, per-bin level detection smeared across neighbouring bins, a soft-knee gate with per-bin attack and release, a frequency range and two real channels packed into one complex transform.

## Ask your AI

Paste this into your coding assistant:

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

## Related engines

Other [filter engines](https://sournd.com/engines/category/filter/index.md):

- [Veer](https://sournd.com/engines/veer/index.md): Free. Resonant multimode filter that morphs continuously from low-pass through band-pass and high-pass to notch, with input drive and an envelope that sweeps the cutoff with the playing.
- [Kammerl](https://sournd.com/engines/kammerl/index.md): Free. Tuned comb filter: rings any sound at a note or frequency, from a subtle metallic sheen to a singing, pitched resonance. Flip the polarity for a hollow tone an octave down; damping softens the ring.
- [Pivotta](https://sournd.com/engines/pivotta/index.md): Free. 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.
- [Glottan](https://sournd.com/engines/glottan/index.md): Paid. A vowel filter: three resonant peaks shaped like a voice, slid between two vowels by hand, by an LFO or by how hard the input plays, for talking, wah and growl tones.
- [Prowl](https://sournd.com/engines/prowl/index.md): Paid. Auto filter: a resonant low-pass, band-pass, high-pass or notch swept by an LFO (free or locked to the song, including sample-and-hold steps) and by how hard you play, with drive in front, grit after and a stereo offset.
- [Rung](https://sournd.com/engines/rung/index.md): Paid. Warm resonant low-pass: four cascaded poles in a feedback loop with soft saturation, a slope control from 6 to 24 dB/oct and bass compensation for the level lost to resonance.
- [Stepvale](https://sournd.com/engines/stepvale/index.md): Paid. Filterbank morph: twenty narrow bands across the spectrum, their levels gliding between two stored shapes (vowels, odd or even bands, tilts, scoops, telephone), by hand or on an LFO that can lock to the song.
- [Treadle](https://sournd.com/engines/treadle/index.md): Paid. Pedal wah: one vocal, resonant peak rocked from heel to toe by the position control (map it to an expression pedal), or pushed by your playing for auto-wah. Hard notes squash the peak into a throaty honk.
