-
Notifications
You must be signed in to change notification settings - Fork 757
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
LinXFade2 pans backward in at least some cases #1294
Comments
In my local copy, I have reverted 1e00486 and the above test case functions correctly. I'll assign this issue to scztt to review this commit. |
Before my change, the SIMD cases of LinXFade were reversed, so reverting won't do anything but trade one bug for another. I believe the (1.0f - ...) matches the amp that's required in LinXFade2_next_k_nova - but the reversal isn't appropriate for other places that use unit->m_amp. I think:
I think it might be just LinXFade2_next_k_nova that needs to be changed, but it would be good to check at least? Can you send me unit tests for the cases that you're seeing failures, so I can make sure I get those cases to pass? |
I think you're right about the problem being specifically the nova functions. LinXFade2_Ctor shows three cases, based on the rate of the pan input:
Audio rate is the only one that doesn't use nova, and in the following test, it's the only one that works correctly.
I'm too short of time today to rebuild SC without nova optimization, but the formulas in the nova-less _k and _i functions match _a, so I believe they are also okay. I agree with your proposed solution: unit->m_amp should follow the user's input value (for clarity if for no other reason). Since the flaw is really in the _nova functions, then these should be fixed. |
OK, this is really patently obviously a bug.
Pan position -1 should output a's value (0), decidedly not b.
There is some weird chicanery in the source code, about flipping the pan position backward -- LinXFade2_Ctor:
Why are we doing 1.f - ()? Possibly some of the _next functions then re-invert the pan, but not all of them. I haven't got time to sort that out.
UGen:blend depends on LinXFade2, so that means UGen:blend is also broken.
The text was updated successfully, but these errors were encountered: