Modes

June 5, 2023 ยท View on GitHub

from tdw.physics_audio.modes import Modes

This class is used only in PyImpact, which has been deprecated. See: Clatter.

Resonant mode properties: Frequencies, powers, and times.


Fields

  • frequencies A numpy array of mode frequencies in Hz.

  • powers A numpy array of mode onset powers in dB re 1.

  • decay_times A numpy array of mode decay times i.e. the time in ms it takes for each mode to decay 60dB from its onset power.


Functions

__init__

Modes(frequencies, powers, decay_times)

ParameterTypeDefaultDescription
frequenciesnp.ndarrayA numpy array of mode frequencies in Hz.
powersnp.ndarrayA numpy array of mode onset powers in dB re 1.
decay_timesnp.ndarrayA numpy array of mode decay times i.e. the time in ms it takes for each mode to decay 60dB from its onset power.

sum_modes

self.sum_modes()

self.sum_modes(fs=44100, resonance=1.0)

Create mode time-series from mode properties and sum them together.

ParameterTypeDefaultDescription
fsint44100The framerate.
resonancefloat1.0The object resonance.

Returns: A synthesized sound.

mode_add

Modes.mode_add(a, b)

(Static)

Add together numpy arrays of different lengths by zero-padding the shorter.

ParameterTypeDefaultDescription
anp.ndarrayThe first array.
bnp.ndarrayThe second array.

Returns: The summed modes.