Expand description
Core sound primitives for the SIM music constellation.
This crate defines the foundational acoustic types shared by the
sound/synthesis layer: Frequency, Amplitude, and Phase
quantities; the Partial, Envelope, and Tone models that build a
spectral tone from sinusoidal components; and helpers for default envelopes
and equal-temperament pitch-to-frequency conversion.
Structs§
- Amplitude
- A non-negative linear amplitude.
- Envelope
- An attack/decay/sustain/release amplitude envelope.
- Frequency
- A positive frequency in hertz.
- Partial
- A single sinusoidal component of a tone.
- Phase
- A phase angle in radians.
- Tone
- A complete tone: a set of
Partials shaped by anEnvelopeover a fixed duration.
Enums§
- Envelope
Shape - The interpolation curve applied across an
Envelope. - Sound
Core Error - Error raised when sound primitives are constructed with invalid values.
Functions§
- default_
envelope - Returns a general-purpose default envelope (short attack and decay, high sustain, moderate release, linear shape).
- equal_
temperament_ frequency - Returns the 12-tone equal-temperament frequency of
pitch, with A4 (MIDI 69) anchored at 440 Hz.