diff --git a/lib/audioeffects/compressor.py b/lib/audioeffects/compressor.py index 1658d5e..15e7376 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 645300c..269c622 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",)))