-
Notifications
You must be signed in to change notification settings - Fork 754
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
Impulse UGEN sets the presample to the wrong value when frequency equals zero #4075
Comments
This is caused by the fact that for However this would change the existing behavior of I know how to fix this, and if there is some consensus that this should be fixed then I'll do so. But I don't want to waste time on this if people want to preserve the existing behavior. |
Thanks for clarifying! As you predicted a change of the existing behavior, could you give an example where this would be observable? Then we could gauge the impact better. |
Sorry I should have been clearer. The only change of the existing behavior would be that it would fix the bug. However this bug has been around presumably for ever, so it could change how existing pieces sound if they rely upon this behavior. This feels like a small risk to me, but I know backwards compatibility is important. So to clarify - my proposed fix wouldn't affect anything except when Impulse is passed a frequency of 0. Currently the envelope only begins on the second control block (e.g. sample 65) - which is clearly wrong. I propose changing this so that the envelope would begin on the first control block (e.g. sample 1) - which is expected behavior. |
Yes, definitely. I was really just trying to imagine how you could rely on the bug. Any idea? Btw. I am the one who implemented the |
Not really. I'm of the opinion that it should be fixed. I was just acknowledging the fact that in certain cases it might affect the sound of existing pieces slightly. But it's hard for to believe that anyone composed a piece knowing about this bug and deliberately exploiting it. |
Okay, this seems to relate to: Issue #2343. That discussion kind of fizzled out without any resolution. I agree with James the current situation with Impulse is ludicrous, and it makes certain things impossible. But there doesn't seem to be any resolution on what the best way to proceed here is. Myself I liked James' solution of just fixing Impulse. |
It is a complicated discussion and I am not sure I can make up my mind easily. Closest to a conclusion seemed:
If I understand correctly, the problem should be that |
I checked Envelope and envelope is fine. Also Envelope seems to do the right thing with every impulse I could think of except Impulse. I actually think the problem is that Impulse is a sample behind. Looking at the code, and the description of writing UGens in the SuperCollider book (which I realize isn't canon - but still), I'm reasonably certain that the last line in Impulse_Ctor should be: Impulse_next_k(unit, 1); rather than ZOUT0(0) = 0.f; This fixes the problem, and so far I haven't found any other problems, while the timing of Impulse now seems to be correct. |
Agreed. Let's fix the impulse implementation first. |
I wanted to raise a cautionary point about using Many Please correct me if I'm mistaken, as this has had my brain in knots after reading through some very looong threads (#2333, #2343, #2864). NOTE this also has implications about how |
Also, I think |
I wanted to mention here that I've been working on a rewrite of It's proven to be a bit tricky, and at this point I'll need to get some input from some other folks on the dev list, but I'll update here if I resolve it. |
Update: first step in resolving this issue has been taken - #4150 |
Environment
Steps to reproduce (for bugs)
Graph:
Expected Behavior
The two audio signals should be identical.
Current Behavior
Currently the envelope triggered by Impulse.kr is a control period later.
The text was updated successfully, but these errors were encountered: