# Fournel

> Passive-style program EQ: boost and attenuate the lows at the same frequency for a deep, tight bottom with a dip above it, a broad-to-sharp high boost, a separate high attenuation shelf, and a gentle output stage that thickens as it is driven.

- Engine id: `org.sournd.eq.fournel`
- 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: 15 samples
- Tail: 0.3 s
- Sidechain input: no
- Channels: mono or stereo
- Audio demo: https://sournd.com/static/preview/demos/fournel.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_freq_hz` | Low frequency | 20 | 120 | 60 | Hz | log |
| 1 | `low_boost_db` | Low boost | 0 | 12 | 0 | dB | linear |
| 2 | `low_atten_db` | Low attenuate | 0 | 12 | 0 | dB | linear |
| 3 | `high_freq_hz` | High boost frequency | 3000 | 16000 | 8000 | Hz | log |
| 4 | `high_boost_db` | High boost | 0 | 16 | 0 | dB | linear |
| 5 | `bandwidth_pct` | Bandwidth (sharp to broad) | 0 | 100 | 50 | % | linear |
| 6 | `high_atten_hz` | High attenuate frequency | 5000 | 20000 | 10000 | Hz | log |
| 7 | `high_atten_db` | High attenuate | 0 | 16 | 0 | dB | linear |
| 8 | `drive_pct` | Output drive | 0 | 100 | 0 | % | linear |
| 9 | `output_db` | Output | -12 | 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.eq.fournel" };
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.fournel", &e) == SOURND_OK) {
    sournd_engine_prepare(e, 48000.0, 512);
    sournd_engine_set_param(e, 0, 60); /* Low frequency */
    sournd_engine_process(e, in, out, 2, frames);
    sournd_engine_destroy(e);
}
```

## How it is made

Original sOURnd design modelling the general behaviour of passive program equalisers mathematically: a steep second-order boost shelf against a shallow first-order attenuation shelf centred higher, an RBJ bell with bandwidth control, a high shelf cut, and a 2x oversampled asymmetric soft saturator blended in by drive.

## Ask your AI

Paste this into your coding assistant:

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