π π A Python library for audio.
C audioaudio-processingaudio-productionaudio-researchaudio-unitaugmentationjucemachine-learningpybind11pythonvst3vst3-host
style: apply clang-format to BrickwallLimiter.h and Limiter.h
Christopher Jacoby645c4afdc749
diff --git a/pedalboard/plugins/BrickwallLimiter.h b/pedalboard/plugins/BrickwallLimiter.hindex 0125fae..d38120b 100644--- a/pedalboard/plugins/BrickwallLimiter.h+++ b/pedalboard/plugins/BrickwallLimiter.h@@ -87,7 +87,7 @@ public:preparedSpec_.maximumBlockSize < spec.maximumBlockSize ||spec.numChannels != preparedSpec_.numChannels);bool paramsChanged = (lookaheadMs_ != preparedLookaheadMs_ ||- truePeak_ != preparedTruePeak_);+ truePeak_ != preparedTruePeak_);if (!specChanged && !paramsChanged) {return; // preserve state for reset=False streaming@@ -158,7 +158,7 @@ public:// Copy ONLY active N samples to scratch (avoid stale tail data)for (int ch = 0; ch < numChannels; ++ch) {scratchBuffer_.copyFrom(ch, 0, ioBlock.getChannelPointer(ch),- numSamples);+ numSamples);}juce::dsp::AudioBlock<SampleType> scratchBlock(scratchBuffer_);auto activeBlock = scratchBlock.getSubBlock(0, (size_t)numSamples);@@ -221,15 +221,15 @@ public:SampleType *channelPtr = ioBlock.getChannelPointer(ch);delayLine_.pushSample(ch, channelPtr[i]);SampleType delayed = delayLine_.popSample(ch);- channelPtr[i] = juce::jlimit(- (SampleType)(-ceilingLinear), (SampleType)ceilingLinear,- (SampleType)(delayed * currentGain_));+ channelPtr[i] = juce::jlimit((SampleType)(-ceilingLinear),+ (SampleType)ceilingLinear,+ (SampleType)(delayed * currentGain_));}}samplesProvided_ += numSamples;return std::min(numSamples,- std::max(0, samplesProvided_ - activeLookaheadSamples_));+ std::max(0, samplesProvided_ - activeLookaheadSamples_));}virtual void reset() override {@@ -293,15 +293,16 @@ inline void init_brickwall_limiter(py::module &m) {"below the ceiling β use a safety margin (e.g. ``ceiling_db=-1.5``) for\n""strict ITU-R BS.1770 compliance.\n\n"".. note::\n\n"- " Changing ``lookahead_ms`` or ``true_peak`` requires a stream restart\n"- " to take effect. ``ceiling_db`` and ``release_ms`` can be changed at\n"+ " Changing ``lookahead_ms`` or ``true_peak`` requires a stream "+ "restart\n"+ " to take effect. ``ceiling_db`` and ``release_ms`` can be changed "+ "at\n"" any time.\n\n""Typical use: enforce a peak ceiling after loudness normalization.\n\n"".. code-block:: python\n\n"" limiter = BrickwallLimiter(ceiling_db=-1.0)\n"" output = limiter(audio, sample_rate)\n")- .def(py::init([](float ceiling, float release, float lookahead,- bool tp) {+ .def(py::init([](float ceiling, float release, float lookahead, bool tp) {auto p = std::make_unique<BrickwallLimiter<float>>();p->setCeilingDb(ceiling);p->setReleaseMs(release);diff --git a/pedalboard/plugins/Limiter.h b/pedalboard/plugins/Limiter.hindex 8372d4d..462a02e 100644--- a/pedalboard/plugins/Limiter.h+++ b/pedalboard/plugins/Limiter.h@@ -34,15 +34,18 @@ inline void init_limiter(py::module &m) {m, "Limiter","A loudness-maximizing limiter.\n\n""This plugin wraps JUCE's ``dsp::Limiter``, which applies two stages of "- "compression followed by automatic makeup gain and a hard clip at 0 dBFS. "- "It is designed to increase perceived loudness, not to enforce a specific "+ "compression followed by automatic makeup gain and a hard clip at 0 "+ "dBFS. "+ "It is designed to increase perceived loudness, not to enforce a "+ "specific ""peak ceiling.\n\n"".. note::\n\n"" ``threshold_db`` controls when compression *engages*, not the output "" ceiling. The output is always hard-clipped at 0 dBFS. Makeup gain "" is applied automatically and cannot be disabled β signals below the "" threshold will be boosted.\n\n"- " For a limiter that enforces a configurable ceiling without makeup gain, "+ " For a limiter that enforces a configurable ceiling without makeup "+ "gain, "" see :class:`BrickwallLimiter`.\n").def(py::init([](float thresholdDb, float releaseMs) {auto plugin = std::make_unique<Limiter<float>>();