Skip to content
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

Noise when certain AMP envelope shape used and sustain=0 and note held #1509

Closed
williamfields opened this issue Jan 25, 2020 · 5 comments · Fixed by #1511
Closed

Noise when certain AMP envelope shape used and sustain=0 and note held #1509

williamfields opened this issue Jan 25, 2020 · 5 comments · Fixed by #1511

Comments

@williamfields
Copy link

Describe the bug
If sustain is set to 0, and the decay part of the AMP envelope shape is set in the middle (the default setting), and you trigger a note and hold it down, a low-level noise is generated. See attached for a demonstration.

noise

Please let us know your surge version
This information is all in the menu/about screen

  • Surge Version: 1.6.2.1
  • Plugin type (VST2, 3 or AU): VST2
  • Bits (32/64): 32

To Reproduce

  1. Set sustain to 0.
  2. Make sure decay part of AMP envelope shape to the middle. (default setting)
  3. Trigger a note and hold it down.

Expected behavior
Volume should go to 0. No noise.

Screenshots
See above.

Desktop (please complete the following information):

  • OS: Windows 10
  • Host: REAPER
  • Version: 6.03

Additional context
Add any other context about the problem here.

@baconpaul
Copy link
Collaborator

Thanks. For the upcoming 1.6.5 release I fixed quite a few things in the analog mode, including the sustain target being wrong. I'll give this a try, but it might also be fixed in the nightly already.

@baconpaul baconpaul added this to the 1.6.5 milestone Jan 25, 2020
@baconpaul
Copy link
Collaborator

Oh sorry this is the digital envelope not the analog.

Well much easier to debug for sure. Will peek.

@baconpaul
Copy link
Collaborator

OK I now know why this happens but am not quite sure what to do

l_lo = phase - 2 * sx * rate + rate * rate;

that code which is the quadratic version of the decay in digital mode has the problem that when phase -> 0 lo = hi as opposed to lo and hi bracketing the sustain. I think the answer is to make the low have a - rate * rate but I am still debugging.

But yeah this is a real bug in the implementation when sustain is zero.

baconpaul added a commit to baconpaul/surge that referenced this issue Jan 25, 2020
In a special case of the digital envelope decay type 1
and sustain exactly 0, you would oscillate away from zero rather than getting
there. There's a math reason for this but it is undesirable so
fix this special case with a limit if.

Closes surge-synthesizer#1509
baconpaul added a commit to baconpaul/surge that referenced this issue Jan 25, 2020
In a special case of the digital envelope decay type 1
and sustain exactly 0, you would oscillate away from zero rather than getting
there. There's a math reason for this but it is undesirable so
fix this special case with a limit if.

Closes surge-synthesizer#1509
@baconpaul
Copy link
Collaborator

OK this is fixed. Will be corrected in 1.6.5 coming in the next few weeks; and should be fixed in the nightly on our website in an hour or so. Thanks for the super accurate report. Really helped me find the problem quickly.

baconpaul added a commit that referenced this issue Jan 25, 2020
In a special case of the digital envelope decay type 1
and sustain exactly 0, you would oscillate away from zero rather than getting
there. There's a math reason for this but it is undesirable so
fix this special case with a limit if.

Closes #1509
@williamfields
Copy link
Author

Amazing! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants