Expand description
§ghurni — Mechanical Sound Synthesis
ghurni (Sanskrit: rotation / spinning) provides procedural synthesis of mechanical sounds: engines, gears, motors, turbines, and other RPM-driven machinery. All sounds are generated from physical models — rotational harmonics, combustion impulses, resonant bodies.
§Architecture
Machine (type, RPM, load)
|
v
Rotational Core ──────────────── Output
Engine: combustion cycle, exhaust/intake resonance, firing order
Gear: tooth mesh frequency, metallic ring
Motor: electromagnetic hum, commutator noise
Turbine: blade pass frequency, whoosh
Clock: escapement tick, spring resonance
Transmission: gear mesh, shift transients, synchro whine
Differential: hypoid gear whine, housing resonance
ForcedInduction: turbo spool, supercharger whine, blow-off valve
ChainDrive: link engagement rattle
BeltDrive: squeal, flap§Key Concepts
- RPM: Rotational speed — the fundamental parameter driving all mechanical sounds
- Machine: A mechanical device with specific acoustic character
- Load: Operating load (0.0-1.0) affects strain, noise, and harmonic content
- Material: Body material affects resonance (steel, aluminum, cast iron)
- Synthesizer trait: Common interface enabling mixers, effects chains, and generic composition
§Quick Start
use ghurni::prelude::*;
// Synthesize a diesel engine at 2000 RPM
let mut engine = Engine::new(EngineType::Diesel, 6, 44100.0).unwrap();
let samples = engine.synthesize(2000.0, 0.7, 1.0).unwrap();
// Generate gear mesh sound
let mut gear = Gear::new(32, GearMaterial::Steel, 44100.0).unwrap();
let samples = gear.synthesize(1500.0, 0.5).unwrap();§Feature Flags
| Feature | Default | Description |
|---|---|---|
std | Yes | Standard library support. Disable for no_std + alloc |
naad-backend | Yes | Use naad for DSP primitives (oscillators, filters, noise) |
logging | No | Structured logging via tracing-subscriber |
Modules§
- belt_
drive - Belt drive sound synthesis.
- chain_
drive - Chain drive sound synthesis.
- clock
- Clock and precision mechanism sound synthesis.
- differential
- Differential (final drive) sound synthesis.
- engine
- Internal combustion engine sound synthesis.
- error
- Error types for the ghurni crate.
- event
- Mechanical event triggers for discrete sound events.
- forced_
induction - Turbocharger and supercharger sound synthesis.
- gear
- Gear mesh sound synthesis.
- mixer
- Multi-component mechanical sound mixer.
- motor
- Electric motor sound synthesis.
- prelude
- Convenience re-exports for common usage.
- presets
- Shipped presets for common mechanical configurations.
- smooth
- Parameter smoothing for click-free transitions.
- traits
- Common traits for mechanical sound synthesizers.
- transmission
- Transmission / gearbox sound synthesis.
- turbine
- Turbine and fan sound synthesis.