-
Notifications
You must be signed in to change notification settings - Fork 404
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
Envelope sustain level does not follow correctly in analog mode #1439
Comments
Thanks. This may be the same as #825 so let me link them. I’m on a couple of week surge break but will look in early 2020 if no one else does. Appreciate the super clear report |
OK so I've confirmed this is indeed the case. Same thing happens if (say) you modulate the sustain with a unipolar LFO. In digital mode it goes up and down in the sustain phase and in analog mode it does not. The thing I'm uncertain of is: Is that the desired behavior. The code for the analog envelope is a bit hairy - and to be honest I haven't dug through it myself in detail (all that SSE2 direct stuff! All that state!). But I certainly will. Just to set expectations though: This one may get fixed with an update to the manual saying "in analog mode Sustain is not modulate able once you are in the delay section" or some such. At least for now. |
My expectation would be if digital mode works like that, it should also have the same behavior in analog mode... |
Typical analog envelopes behave like that because the circuitry is essentially an RC network which is fed by the sustain level as long as in the sustain phase. So when you call the mode "analog" I would expect something like that. |
Yeah I agree. It should do what you say it should do. I will investigate |
The ADSR envelope in analog mode didn't allow sustain to increase. To begin debugging this, add a collection of unit tests. Addresses surge-synthesizer#1439
OK so using the new test framework I've been chipping away at this. An interesting thing is that the analog envelope behaves much differently than the digital one. The digital one meets the constraints you would expect (turn around at attack time and so on). But the analog one seems to attack more quickly than the attack time, and seems to sustain at half the sustain level. Here's a picture from VCV Rack, for instance, of the same thing configured as analog and digital. No big deal of course, it just means the test cases for analog are looser. And then I'll get around to fixing the core problem here too I hope through putting in some clear tests of current behavior. |
Edit It's actually sustaining at s-squared not s/2. But at 0.5 that's the same! :) |
Well except it isn't doing that consistently either! |
Tiny note to self for when I dive back on to this: https://fgiesen.wordpress.com/2016/04/03/sse-mind-the-gap/ |
OK I now know why this is happening. I had to re-write a parallel implementation of that SSE goop in plain C++ code to see it, Basically here is the inner loop
makes perfect sense, right. Push around based on gate or discharge state. Even pretty easy to read in that non-sse form. The problem is this line
or in SSE-land
What that said is that the decay differential is capped out at 0. Decay can never push up your envelope. So what this means is when we increase S and are holding a note the diff mins out at 0 and so the integrator doesn't increase the voltage. That line should probably be something like
and also in SSE; but making that change will require me to make sure that the min isn't saturated when discharge && gate are set in normal constant sustain operation. I think I'll push the unit tests to master now and then keep working on this this week with the fix. |
The ADSR envelope in analog mode didn't allow sustain to increase. To begin debugging this, add a collection of unit tests. Most importantly, add a 'normal code' re-implementation of the Analog ADSR envelope away from SSE intrinsics. Addresses surge-synthesizer#1439
The ADSR envelope in analog mode didn't allow sustain to increase. To begin debugging this, add a collection of unit tests. Most importantly, add a 'normal code' re-implementation of the Analog ADSR envelope away from SSE intrinsics. Addresses #1439
ADSR analog mode had two bugs 1. It misused _mm_and_ps so was incorrectly rounding decay time 2. It didn't allow for swells in sustain once the sustain stage was underway This fixes both those problems. In some cases the fix to surge-synthesizer#1 will change the sound of patches by making the decay time slower (but more correct). Closes surge-synthesizer#1439 Closes surge-synthesizer#825
ADSR analog mode had two bugs 1. It misused _mm_and_ps so was incorrectly rounding decay time 2. It didn't allow for swells in sustain once the sustain stage was underway This fixes both those problems. In some cases the fix to surge-synthesizer#1 will change the sound of patches by making the decay time slower (but more correct). Closes surge-synthesizer#1439 Closes surge-synthesizer#825
ADSR analog mode had two bugs 1. It misused _mm_and_ps so was incorrectly rounding decay time 2. It didn't allow for swells in sustain once the sustain stage was underway This fixes both those problems. In some cases the fix to surge-synthesizer#1 will change the sound of patches by making the decay time slower (but more correct). Closes surge-synthesizer#1439 Closes surge-synthesizer#825
ADSR analog mode had two bugs 1. It misused _mm_and_ps so was incorrectly rounding decay time 2. It didn't allow for swells in sustain once the sustain stage was underway This fixes both those problems. In some cases the fix to #1 will change the sound of patches by making the decay time slower (but more correct). Closes #1439 Closes #825
@sourcebox in the next nightly which should be out in about 20 minutes, and also in 1.6.5 which should be out in early Feb, this is fixed. |
Looks good so far. Thanks for your effort. |
Steps to reproduce the behavior:
The Filter EG shows the same behaviour.
Expected behavior
The sustain level should follow with the decay time when moving the slider in analog mode in the same way as in digital mode.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: