# Gyrecast

> Rotating speaker: a spinning treble horn and bass drum, slow or fast, that speed up and slow down with real weight, heard by two microphones for a wide swirling stereo image.

- Engine id: `org.sournd.modulation.gyrecast`
- Category: Modulation
- 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.05 s
- Sidechain input: no
- Channels: mono or stereo
- Audio demo: https://sournd.com/static/preview/demos/gyrecast.mp3 (plucked chords, 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 | `speed` | Speed | 0 | 1 | 0 | - | linear |
| 1 | `horn_slow_hz` | Horn slow | 0.2 | 3 | 0.8 | Hz | log |
| 2 | `horn_fast_hz` | Horn fast | 3 | 10 | 6.8 | Hz | log |
| 3 | `drum_slow_hz` | Drum slow | 0.1 | 3 | 0.7 | Hz | log |
| 4 | `drum_fast_hz` | Drum fast | 2 | 10 | 5.9 | Hz | log |
| 5 | `horn_ramp_s` | Horn ramp | 0.05 | 5 | 0.8 | s | log |
| 6 | `drum_ramp_s` | Drum ramp | 0.1 | 10 | 3.5 | s | log |
| 7 | `crossover_hz` | Crossover | 300 | 2000 | 800 | Hz | log |
| 8 | `depth` | Depth | 0 | 100 | 80 | % | linear |
| 9 | `mic_spread` | Mic spread | 0 | 180 | 120 | deg | linear |
| 10 | `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.modulation.gyrecast" };
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.modulation.gyrecast", &e) == SOURND_OK) {
    sournd_engine_prepare(e, 48000.0, 512);
    sournd_engine_set_param(e, 0, 0); /* Speed */
    sournd_engine_process(e, in, out, 2, frames);
    sournd_engine_destroy(e);
}
```

## How it is made

Original sOURnd design blending general techniques: a fourth-order complementary crossover into two rotor paths, one-pole speed inertia per rotor, Doppler from cosine-swept Hermite delay reads, directional amplitude modulation, and two virtual microphones at a spread angle.

## Ask your AI

Paste this into your coding assistant:

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