Skip to main content

Crate sim_lib_sound_core

Crate sim_lib_sound_core 

Source
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 an Envelope over a fixed duration.

Enums§

EnvelopeShape
The interpolation curve applied across an Envelope.
SoundCoreError
Error raised when sound primitives are constructed with invalid values.

Statics§

RECIPES
Cookbook recipes for this lib, embedded at build time.

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.