Skip to content

pedalboard.Delay feedback parameter has no effect under specific conditions (v0.9.16) #413

@loganrooks

Description

@loganrooks

Summary

In pedalboard==0.9.16, the feedback parameter of the pedalboard.Delay effect does not appear to produce a numerically different output under specific test conditions, even when set to significantly different values (e.g., 0.1 vs 0.9).

Environment

  • pedalboard version: 0.9.16
  • Python version: (Project uses Poetry, specific version likely >=3.9)
  • OS: Ubuntu 24.04.2 LTS (Noble Numbat) via WSL2
  • Kernel: Linux 5.15.167.4-microsoft-standard-WSL2
  • CPU: 12th Gen Intel(R) Core(TM) i7-1260P

Minimal Reproducible Example

The following test case, using pedalboard.Delay directly, demonstrates the issue. It applies the delay to an impulse signal with a 1-second delay time and 100% wet mix, comparing the output for feedback=0.1 and feedback=0.9.

import numpy as np
import pytest
from pedalboard import Delay, Pedalboard

SAMPLE_RATE = 44100

def test_direct_pedalboard_delay_feedback():
    """Directly test pedalboard.Delay feedback parameter."""
    impulse = np.zeros(SAMPLE_RATE, dtype=np.float32)
    impulse[0] = 1.0
    delay_time_s = 1.0
    mix = 1.0

    # Low feedback
    delay_low_fb = Delay(delay_seconds=delay_time_s, feedback=0.1, mix=mix)
    board_low = Pedalboard([delay_low_fb])
    output_low = board_low(impulse, SAMPLE_RATE)

    # High feedback
    delay_high_fb = Delay(delay_seconds=delay_time_s, feedback=0.9, mix=mix)
    board_high = Pedalboard([delay_high_fb])
    output_high = board_high(impulse, SAMPLE_RATE)

    # Check if outputs are different
    assert not np.allclose(output_low, output_high, atol=1e-9), \
        "Direct pedalboard.Delay test failed: feedback change had no effect"

# Running this test results in an AssertionError

Expected Behavior

The output_low and output_high arrays should be numerically different, causing the assert not np.allclose(...) statement to pass.

Actual Behavior

The output_low and output_high arrays are numerically identical (within atol=1e-9), causing the assertion to fail.

Notes

This behavior was observed while writing unit tests for a wrapper function around pedalboard.Delay.
The test conditions (impulse signal, 1s delay, 100% wet mix) might be considered edge cases, but they highlight that the feedback parameter does not have the expected numerical effect under these circumstances.
This was initially discovered and documented in an internal project debug log.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions