-
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
EnvGen releases incorrectly for very very short envelope segments #1023
Comments
A clean rebuild did not resolve the issue. |
Converting the last example to all |
James, I'm unable to reproduce this. The list I get when running your first
1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 2940, which corresponds to the three attack segments, all as should be. (BTW please note that your message has a typo in it which confused me at I'm on SC 3.6.6 (401b992) on Ubuntu 13.04. Please, please when reporting Dan 2014/1/22 jamshark70 notifications@github.com
|
Currently I'm at or around: commit 1c422a3
For this problem, I would guess one of these is the issue, but EnvGen got pretty heavily reorganized and it's hard to see quickly which one of the many changes is responsible. I can try checking out these individual commits one by one (only five) and, if they build successfully, find out which is the first one where it broke. $ git log server/plugins/LFUGens.cpp
commit 42967f6
commit c51d383
commit af7c725
commit dc0646d
|
I get:
I can see that a bunch of stuff has been moved into:
... but I don't see that the logic for shape_Curve has changed very much... except for the gateCheck() which is new in the block-calculation loop. As a test, I started with af7c725 and commented out the two lines 2964 and 2965:
And the problem went away -- the last test case that I posted no longer has the spikes, but... without the gate check, (IIUC) the gate may close in the middle of a calculation block, but this won't take effect until the next block boundary. So, just removing it is not the solution. So, for EnvGen.ar, it's possible to exit from the block calculation early, and I'm guessing that this doesn't update the unit's state variables, (likely) causing the next block to be wrong. It's beyond my expertise to fix it, though. |
Beyond my expertise too I'm afraid. But from reading af7c725, here's a thought: the way that EnvGen_perform() has been unified is such that for audio-rate it does the same gate-check as before, while for control-rate the gate-check has been replaced by a simple "return false" (line 3010). This seems odd since it would always break out of the curve-generating code blocks for k-rate stuff. It would seem to me that if it were instead a "return true" then that might reinstate the old behaviour. I emphasise "might" - this is just from reading the patch. I could easily be misreading. @timblechmann may be able to clarify. |
can have a look, but it might take a few days. the audio-rate ugen has to distinguish between audio-rate and control-rate gate signals ... but having a reproducer, it should be easy to find |
fixes supercollider#1023 Signed-off-by: Tim Blechmann <tim@klingt.org>
Here is a related issue: #1063 (To avoid confusion, I opened a new one instead of reopening this one) |
I seem to have found a disturbing bug in EnvGen. It's worse when the envelope segments are very short, but it also occurs (mildly) for typical env-segment durations. The release segment of an Env.adsr actually goes UP before going down!!! This seems to happen always, which is really awful.
In a simple Env.adsr, we would expect the signal to rise during the attack phase, but thereafter, the slope should be <= 0 (always descending or flat). Instead, I get a very obvious spike when the gate closes and the envelope goes into the release phase.
--> List[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1023, 1470, 1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 2495, 2940, 2941, 2942, 2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 3967 ]
If, in fact, slope were > 0 only during the attack segments, then we would only see 0..13, 1470..1483 etc. Instead, there's also 1470***, 2495 and 3967.
Look at the floats surrounding one of those indices --
d[1015 .. 1030]
:FloatArray[ 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.88936585187912, 0.87712335586548, 0.86504632234573, 0.85313242673874, 0.84137958288193, 0.8297855257988, 0.81834816932678 ]
Just before that point, it's holding flat at the sustain level. Then, instead of decreasing, it jumps up to almost twice its current level.
An alternate version, without using
timeScale
, also reproduces the issue.A longer envelope still reproduces the issue.
The text was updated successfully, but these errors were encountered: