Skip to main content

Crate sim_lib_sound_render

Crate sim_lib_sound_render 

Source
Expand description

Sound rendering for the SIM music constellation.

This crate turns synthesized Tones into interleaved PCM audio. PcmRenderer renders single tones and mixes scheduled tones with per-tone timing and panning, and encodes the result as 16-bit WAV; RendererOptions configures the sample rate and channel count. It also composes the existing STFT and numbers-signal owners for policy-complete offline phase vocoding, and reports EBU R128 / ITU-R BS.1770 loudness, true peak, and transparent normalization gain.

Structs§

LoudnessLayout
Ordered interleaved channel layout for loudness measurement.
LoudnessReport
Standards-named integrated, momentary, gating, and true-peak evidence.
LoudnessSpec
Complete bounded policy for EBU/ITU loudness and true-peak measurement.
MomentaryLoudness
One 400 ms EBU momentary block.
NormalizationReport
Normalized PCM plus fully visible gain, ceiling, and clipping evidence.
NormalizationSpec
Target and safety ceiling for transparent loudness normalization.
PcmRenderer
A renderer that synthesizes tones into interleaved PCM f32 samples and encodes them as WAV.
PhaseVocoderReport
Visible PCM and policy evidence returned by phase_vocode.
RendererOptions
Configuration for a PcmRenderer.
SoundRenderLib
Host-registered lib exporting the PCM renderer card.
TruePeakPolicy
Bandlimited true-peak interpolation policy.
TruePeakReport
Sample-peak and interpolated true-peak evidence.
VocoderPolicy
Complete bounded policy for offline monophonic phase vocoding.

Enums§

FrequencyWeighting
Frequency weighting applied before gated loudness integration.
GatingPolicy
Block-gating policy for integrated loudness.
InstantaneousFrequencyPolicy
Policy used to turn analysis-frame phase into synthesis frequency.
LoudnessChannel
Semantic channel position used by ITU-R BS.1770 energy weighting.
LoudnessError
Invalid loudness input, bound, or standards policy.
PhaseLockPolicy
Relationship imposed between neighboring short-time Fourier bins.
PhaseUnwrapPolicy
Policy used to choose an unwrapped phase residual.
SoundRenderError
Error raised by sound rendering and WAV encoding.
TransientPolicy
Attack-handling policy for the phase vocoder.
VocoderError
Invalid phase-vocoder policy or delegated STFT/signal failure.

Statics§

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

Functions§

install_sound_render_lib
Installs the sound-render lib into cx, registering the PCM renderer export record (idempotent).
measure_loudness
Measures complete 400 ms momentary blocks, gated integrated loudness, and bandlimited true peak under one retained policy.
normalize_loudness
Applies one visible scalar gain to reach the requested loudness, then remeasures without clipping, limiting, or concealing a true-peak violation.
phase_vocode
Applies a bounded offline phase vocoder by composing the existing phase-preserving STFT and generic numbers-signal FFT/unwrap owners.