Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phasor doesn't play nice with negative frequencies #201

Open
v7b1 opened this issue Feb 1, 2024 · 0 comments
Open

Phasor doesn't play nice with negative frequencies #201

v7b1 opened this issue Feb 1, 2024 · 0 comments

Comments

@v7b1
Copy link

v7b1 commented Feb 1, 2024

The setFreq method of the Phasor class accepts negative values, which is nice cause it would allow the phasor to run in reverse (ramp down).
But the Process() routine clips negative phase values to zero instead of wrapping to the maximum value.

Should probably be something like:

if(phs_ < 0.0f) { phs_ += TWOPI_F; // phs_ = 0.0f; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant