Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix another regression introduced by #1314 #1470

Merged
merged 3 commits into from
Jan 25, 2025
Merged

Fix another regression introduced by #1314 #1470

merged 3 commits into from
Jan 25, 2025

Conversation

derselbst
Copy link
Member

When a voice is playing in delay phase, its amplitude and amplitude increment aren't updated or cleared, causing it to inherit them from a previous voice. Previously, if the increment was non-zero, nothing prevented the amplitude of the voice from rising infinitely while it was playing in delay phase.

To fix this one could either explicitly prune the amplitude to zero in this case. However, it would still attempt to read the sample buffer and multiply them with a zero amplitude, resulting in a zero sample, which is unnecessarily wasteful.

Because of that, this PR adds a new DSP routine, whose only purpose is to write silence to the dsp buffer and update the dsp phase of the voice accordingly.

Fixes #1451

@derselbst derselbst added the bug label Jan 12, 2025
@derselbst derselbst added this to the 2.4 milestone Jan 12, 2025
Copy link

@derselbst derselbst force-pushed the dsp-cpp branch 2 times, most recently from ed6283d to 9e08718 Compare January 25, 2025 10:20
@derselbst derselbst merged commit 6e0fce4 into dsp-cpp Jan 25, 2025
74 of 77 checks passed
@derselbst derselbst deleted the dsp-cpp-1451 branch January 25, 2025 10:21
derselbst added a commit that referenced this pull request Jan 25, 2025
derselbst added a commit that referenced this pull request Jan 25, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant