audio

@audio/effect-rotary0.2.0

Rotary speaker

Rotary speaker (Leslie) simulation — split horn/drum rotors, Doppler + directivity AM

Status
pending calibration
Updated
Family
effect, 26 packages under it
Plugin
rotary, effect, streaming, 8 parameters
Category
effects
Licence
MIT
Dependencies
4 packages, all permissive: MIT
Downloads
3,156 last month
Tests
138 in audiojs/effect's CI, passed at 5ff5a84,

Listen

// "Local Forecast" by Kevin MacLeod (incompetech.com), CC BY 4.0, incompetech.com/music/royalty-free/faq.html
audio('/samples/music/modern/local-forecast.mp3').rotary()

// "Local Forecast" by Kevin MacLeod (incompetech.com), CC BY 4.0, incompetech.com/music/royalty-free/faq.html

Parameters

  • effect
  • streaming
  • tail
hornSpeed
0.8 Hz
0 to 10 Hz
drumSpeed
0.7 Hz
0 to 10 Hz
crossover
800 Hz
200 to 3000 Hz
depth
1
0 to 1
hornInertia
0.6 s
0.05 to 3 s
drumInertia
2.5 s
0.05 to 6 s
micSpread
1.5708 rad
0 to 3.14159 rad
mix
1
0 to 1
import rotary from '@audio/effect-rotary'

Leslie cabinet simulation — a treble horn and bass drum spin at independent, inertia-limited rates below a crossover split, each producing Doppler pitch modulation and directivity amplitude modulation as they turn past two virtual mics. Mono in, stereo out.

hornSpeed/drumSpeed rotor rates in Hz (default 0.8/0.7 chorale · 6.7/5.9 tremolo · 0/0 off) · crossover horn/drum split in Hz (default 800) · depth modulation intensity 0–1 (default 1) · hornInertia/drumInertia spin-up/down time constants in seconds (default 0.6/2.5 — the heavier drum lags the horn) · micSpread angle between the two virtual mics in radians (default π/2) · mix wet/dry 0–1 (default 1) · fs sample rate

import rotary from '@audio/effect-rotary'

// mono in, stereo out: pre-fill both channels with the same dry signal
let left = Float64Array.from(mono), right = Float64Array.from(mono)
let p = { hornSpeed: 6.7, drumSpeed: 5.9, fs: 44100 }
rotary(left, right, p)   // left, right now hold the two virtual-mic outputs

Switching hornSpeed/drumSpeed mid-stream glides through the inertia model instead of snapping — the classic chorale↔tremolo swell. A change of depth or micSpread glides across the next call, a new crossover, smoothed so that a host ramps it, rewrites the filter sections in place, and a new mix glides sample by sample.

The rotors' delay is the model's, not latency: the path from each rotor to a mic, up to twice its radius over the speed of sound (2 · 0.09 m / 343 m/s, 23 samples at 44.1 kHz, for the horn at rest facing the left mic). At mix 0 the output is the input, undelayed.

Use when: organ/guitar Leslie emulation, spinning-speaker swells
Not for: plain stereo chorus (use chorus) or static stereo widening (use @audio/spatial)


Part of @audio/effect — the effect family umbrella. This README is generated from the umbrella docs.

MIT © audiojs