Skip to content

Broken Filters: #9

@micsthepick

Description

@micsthepick

butbp and butbr, and possibly others, are broken due to a read to this.ny before assigning this.ny.

function butbp(freq q)
(
    freq < 1.0 ? freq = 1.0 : freq > this.ny ? freq = this.ny;
    this.freq = freq; 
    q < 0.5 ? q = 0.5 : q > 1000 ? q = 1000;
    this.q = q; 
    this.x1 = this.x2 = this.y1 = this.y2 = 0.0;
    this.pioversr = $pi / srate;
    this.ny = srate * 0.49;
    this._butbp_compute_coeffs();
);

function butbp_set_freq(freq)
(
    freq < 1.0 ? freq = 1.0 : freq > this.ny ? freq = this.ny;
    this.freq = freq; 
    this._butbp_compute_coeffs();
);

This may go unnoticed due to set_freq getting called during slider code after init code, but if your code doesn't ever change the center freq with that method (..._set_freq), then it breaks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions