From 398b863a4b7b24957bcffad74b711090ec2be079 Mon Sep 17 00:00:00 2001 From: Brad Barnett <127794626+bdbarnett@users.noreply.github.com> Date: Tue, 27 Oct 2026 19:01:17 -0500 Subject: [PATCH] Compressor: state the input level it stays clean at Clean on the defaults and every patch at -6 dBFS; at -3 dBFS patch 3 rails on a 100 Hz square. The ceiling test checks both. --- lib/audioeffects/compressor.py | 8 ++++++++ tests/test_cpython_effects_compressor.py | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/lib/audioeffects/compressor.py b/lib/audioeffects/compressor.py index 1658d5e5..15e73765 100644 --- a/lib/audioeffects/compressor.py +++ b/lib/audioeffects/compressor.py @@ -42,6 +42,9 @@ tail: the gain multiplies the audio, so silence in is silence out on the same sample. +**Levels.** Keep the input under -6 dBFS and the defaults and patches stay +off the rails. + **Two traits this palette cannot carry, recorded rather than hidden** (dossier App. J.3, J.4): @@ -204,6 +207,11 @@ class Compressor(_component.Component): #: "Detector and coupling state" in docs/reference/component-api.md. TAIL_SAMPLES = 0 + #: The defaults and every patch play the ceiling kit's materials + #: clean at this level; at -3 dBFS, patch 3 rails on + #: a 100 Hz square. + INPUT_CEILING_DBFS = -6 + MACRO_LABELS = ("Character", "Threshold", "Ratio", "Attack", "Release", "Release Slow", "Memory", "Knee", "Detector", "RMS Window", "Emphasis", "Emphasis Freq", "Makeup", diff --git a/tests/test_cpython_effects_compressor.py b/tests/test_cpython_effects_compressor.py index 645300cf..269c6229 100644 --- a/tests/test_cpython_effects_compressor.py +++ b/tests/test_cpython_effects_compressor.py @@ -385,3 +385,15 @@ def test_patch_14_and_back_mid_stream_settles(self): if __name__ == "__main__": unittest.main() + + +import kit_ceiling # noqa: E402 + + +class TheCeiling(unittest.TestCase): + def test_clean_at_the_stated_input_level(self): + # square is where it rails first: p3 at -3 dBFS. + self.assertEqual( + kit_ceiling.stated_level_reds(compressor.Compressor, "square"), []) + self.assertTrue(kit_ceiling.stated_level_reds( + compressor.Compressor, "square", db=-3, keys=("p3",)))