# Glazen

> Linear-phase parametric EQ: 24 dB/oct low and high cuts, low and high shelves and three bells with no phase shift between frequencies, so boosts and cuts keep transients and parallel paths aligned. Adds a fixed latency the host compensates.

- Engine id: `org.sournd.eq.glazen`
- Category: EQ
- 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: 2303 samples
- Tail: 0.2 s
- Sidechain input: no
- Channels: mono or stereo
- Audio demo: https://sournd.com/static/preview/demos/glazen.mp3 (a drum loop, 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 | `low_cut_hz` | Low cut | 10 | 2000 | 10 | Hz | log |
| 1 | `low_shelf_hz` | Low shelf freq | 20 | 1000 | 100 | Hz | log |
| 2 | `low_shelf_db` | Low shelf gain | -18 | 18 | 0 | dB | linear |
| 3 | `bell1_hz` | Bell 1 freq | 20 | 20000 | 250 | Hz | log |
| 4 | `bell1_gain_db` | Bell 1 gain | -24 | 18 | 0 | dB | linear |
| 5 | `bell1_q` | Bell 1 Q | 0.1 | 12 | 1 | x | log |
| 6 | `bell2_hz` | Bell 2 freq | 20 | 20000 | 1000 | Hz | log |
| 7 | `bell2_gain_db` | Bell 2 gain | -24 | 18 | 0 | dB | linear |
| 8 | `bell2_q` | Bell 2 Q | 0.1 | 12 | 1 | x | log |
| 9 | `bell3_hz` | Bell 3 freq | 20 | 20000 | 4000 | Hz | log |
| 10 | `bell3_gain_db` | Bell 3 gain | -24 | 18 | 0 | dB | linear |
| 11 | `bell3_q` | Bell 3 Q | 0.1 | 12 | 1 | x | log |
| 12 | `high_shelf_hz` | High shelf freq | 1000 | 20000 | 8000 | Hz | log |
| 13 | `high_shelf_db` | High shelf gain | -18 | 18 | 0 | dB | linear |
| 14 | `high_cut_hz` | High cut | 1000 | 22000 | 22000 | Hz | log |
| 15 | `output_db` | Output | -18 | 18 | 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.eq.glazen" };
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.eq.glazen", &e) == SOURND_OK) {
    sournd_engine_prepare(e, 48000.0, 512);
    sournd_engine_set_param(e, 0, 10); /* Low cut */
    sournd_engine_process(e, in, out, 2, frames);
    sournd_engine_destroy(e);
}
```

## How it is made

Original sOURnd design blending general techniques: analog-prototype shelf, bell and Butterworth magnitudes sampled into a zero-phase spectrum, inverse FFT, Blackman windowing, uniformly partitioned overlap-save FFT convolution, and a stepwise background redesign crossfaded in at block boundaries.

## Ask your AI

Paste this into your coding assistant:

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