Skip to content

Commit

Permalink
Formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
psobot committed Jan 25, 2022
1 parent bc98109 commit 762d6b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 6 additions & 4 deletions pedalboard/plugins/Delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

namespace Pedalboard {
template <typename SampleType>
class Delay : public JucePlugin<juce::dsp::DelayLine<SampleType, juce::dsp::DelayLineInterpolationTypes::None>> {
class Delay : public JucePlugin<juce::dsp::DelayLine<
SampleType, juce::dsp::DelayLineInterpolationTypes::None>> {
public:
SampleType getDelaySeconds() const { return delaySeconds; }
void setDelaySeconds(const SampleType value) {
Expand Down Expand Up @@ -67,7 +68,8 @@ class Delay : public JucePlugin<juce::dsp::DelayLine<SampleType, juce::dsp::Dela

if (delaySeconds == 0.0f) {
// Special case where DelayLine doesn't do anything for us.
// Regardless of the mix or feedback parameters, the input will sound identical.
// Regardless of the mix or feedback parameters, the input will sound
// identical.
return context.getInputBlock().getNumSamples();
}

Expand All @@ -81,8 +83,8 @@ class Delay : public JucePlugin<juce::dsp::DelayLine<SampleType, juce::dsp::Dela

for (size_t i = 0; i < context.getInputBlock().getNumSamples(); i++) {
SampleType delayOutput = this->getDSP().popSample(c);
this->getDSP().pushSample(c,
channelBuffer[i] + (getFeedback() * delayOutput));
this->getDSP().pushSample(c, channelBuffer[i] +
(getFeedback() * delayOutput));
channelBuffer[i] =
(channelBuffer[i] * dryVolume) + (wetVolume * delayOutput);
}
Expand Down
7 changes: 3 additions & 4 deletions tests/test_native_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,9 @@ def test_delay():
dry_volume = 1.0 - mix
wet_volume = mix

delayed_line = np.concatenate([
np.zeros(int(delay_seconds * sr)),
full_scale_noise
])[:len(result)]
delayed_line = np.concatenate([np.zeros(int(delay_seconds * sr)), full_scale_noise])[
: len(result)
]
expected = (dry_volume * full_scale_noise) + (wet_volume * delayed_line)

np.testing.assert_equal(result.shape, expected.shape)
Expand Down

0 comments on commit 762d6b5

Please sign in to comment.