jdxi_editor.audio.analysers.vu_analyser

Peak and VU ballistics over a block of samples.

The peak meter attacks in about 10 ms and falls in about 150 ms. The VU integrates over about 300 ms. Peak hold falls more slowly, so the highest recent peak stays visible.

Attributes

_EPSILON

PEAK_ATTACK

PEAK_DECAY

VU_INTEGRATION

HOLD_DECAY

Classes

VUAnalyser

Stereo peak meter, peak hold, and VU, kept between blocks.

Functions

amplitude_db(amplitude) → float

20 log10 of an amplitude.

_alpha(dt, tau) → float

_approach(current, target, alpha) → float

Module Contents

jdxi_editor.audio.analysers.vu_analyser._EPSILON = 1e-12[source]
jdxi_editor.audio.analysers.vu_analyser.PEAK_ATTACK = 0.01[source]
jdxi_editor.audio.analysers.vu_analyser.PEAK_DECAY = 0.15[source]
jdxi_editor.audio.analysers.vu_analyser.VU_INTEGRATION = 0.3[source]
jdxi_editor.audio.analysers.vu_analyser.HOLD_DECAY = 1.5[source]
jdxi_editor.audio.analysers.vu_analyser.amplitude_db(amplitude: float) → float[source]

20 log10 of an amplitude.

Parameters:

amplitude – float linear amplitude, 0..1

Returns:

float decibels, not yet clipped to the meter

jdxi_editor.audio.analysers.vu_analyser._alpha(dt: float, tau: float) → float[source]
jdxi_editor.audio.analysers.vu_analyser._approach(current: float, target: float, alpha: float) → float[source]
class jdxi_editor.audio.analysers.vu_analyser.VUAnalyser[source]

Stereo peak meter, peak hold, and VU, kept between blocks.

peak[source]
vu[source]
hold[source]
block_levels(block: numpy.ndarray) → tuple[numpy.ndarray, numpy.ndarray][source]

RMS and peak of one stereo block, in dB, unclipped.

Parameters:

block – np.ndarray shape (n, 2)

Returns:

tuple of RMS and peak, each shape (2,)

update(block: numpy.ndarray, dt: float) → dict[str, float][source]

Fold one block into the meters.

Parameters:
  • block – np.ndarray shape (n, 2)

  • dt – float seconds since the previous update

Returns:

dict of clipped meter values, left then right