- 
                Notifications
    You must be signed in to change notification settings 
- Fork 29
Reverb wrapping bugfix #33
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
base: master
Are you sure you want to change the base?
Reverb wrapping bugfix #33
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would like some thoughts from anyone else. While this will address the immediate integer overflow distortion issue as tested, it does not address other deficiencies such as the fact stereo signals are downmixed to mono reverb.
|  | ||
| #ifdef _WIN32 | ||
| #define snprintf _snprintf | ||
| //#define snprintf _snprintf | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to comment this out as it was failing to build under MSYS2 MinGW-w64. This seems like a dirty hack anyway that likely no longer applies with more recent versions of MinGW-w64 GCC compiler suite.
| in1 = smp; | ||
| smp = ou0>>2; | ||
|  | ||
| b[i] = (smp > INT_MAX) ? INT_MAX : | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking more work might be needed to prevent double-clipping.
| b[i] = ou0l; | ||
| ou0l = ((smp * a0)/32768) + ((in1l * a1)/32768) + ((ou0l * b1)/32768); | ||
| in1l = smp; | ||
| b[i] = (ou0l > INT_MAX) ? INT_MAX : | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, this may contribute to double-clipping.
Address Issue #16