# Glottan

> 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.

- Engine id: `org.sournd.filter.glottan`
- 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: 0 samples
- Tail: 0.2 s
- Sidechain input: no
- Channels: mono or stereo
- Audio demo: https://sournd.com/static/preview/demos/glottan.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 | `vowel_a` | Vowel A | 0 | 10 | 0 | - | linear |
| 1 | `vowel_b` | Vowel B | 0 | 10 | 3 | - | linear |
| 2 | `morph` | Morph | 0 | 100 | 0 | % | linear |
| 3 | `resonance` | Resonance | 0 | 100 | 60 | % | linear |
| 4 | `shift` | Shift | -24 | 24 | 0 | st | linear |
| 5 | `lfo_rate_hz` | LFO rate | 0.05 | 10 | 0.5 | Hz | log |
| 6 | `lfo_depth` | LFO depth | 0 | 100 | 0 | % | linear |
| 7 | `env_amount` | Envelope amount | -100 | 100 | 0 | % | linear |
| 8 | `env_attack_ms` | Envelope attack | 1 | 200 | 10 | ms | log |
| 9 | `env_release_ms` | Envelope release | 10 | 1000 | 150 | ms | log |
| 10 | `stereo` | Stereo | 0 | 180 | 0 | deg | linear |
| 11 | `mix` | Mix | 0 | 100 | 100 | % | linear |
| 12 | `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.glottan" };
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.glottan", &e) == SOURND_OK) {
    sournd_engine_prepare(e, 48000.0, 512);
    sournd_engine_set_param(e, 0, 0); /* Vowel A */
    sournd_engine_process(e, in, out, 2, frames);
    sournd_engine_destroy(e);
}
```

## How it is made

Original sOURnd design blending general techniques: three parallel trapezoidal band-pass filters at typical published formant frequencies of eleven vowels, fixed peak gains, geometric interpolation between two vowels, an LFO and input envelope follower on the morph, with makeup gain and a soft shoulder.

## Ask your AI

Paste this into your coding assistant:

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