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

Denormal Noise is visible out the back of Surge #4900

Closed
baconpaul opened this issue Aug 24, 2021 · 16 comments · Fixed by #5601 or #5796
Closed

Denormal Noise is visible out the back of Surge #4900

baconpaul opened this issue Aug 24, 2021 · 16 comments · Fixed by #5601 or #5796
Labels
Airwindows Issues related to Airwindows effects implemented in Surge Bug Report Item submitted using the Bug Report template DSP Issues and feature requests related to sound generation in the synth Effects
Milestone

Comments

@baconpaul
Copy link
Collaborator

baconpaul commented Aug 24, 2021

This was a DeRez problem with loads of investigation

I was able to fix DeRez in 04e38b3 but the small value 1e-15 noise which is there to fight denodm problems still causes a problem

I think the @mynameismuhl fix along with our FTZ flags mean we are fine to set it to 1e-25 and I will do that once we ship XT1.0 but too late in cycle for that now.


  1. Fresh session
  2. Load up "TNMG/Sequences/One Node IDM" <- do you hear a glitch at 'load'
  3. Toggle th enext patch button forward and back (so unload and reload One Note IDM). <- Do you hear a glitch at 'load'
  4. Bypass all FX (so put FX bylass all the way to 'all') and then repeat step 3. Does the sound go away?

it seems to be the airwindows derez

@baconpaul baconpaul added the Bug Report Item submitted using the Bug Report template label Aug 24, 2021
@baconpaul baconpaul added this to the Surge XT 1.0 milestone Aug 24, 2021
@mkruselj mkruselj added the DSP Issues and feature requests related to sound generation in the synth label Aug 24, 2021
@baconpaul baconpaul changed the title Load glitch with fx and patch AirWindows DeRez glitch on load Aug 24, 2021
@baconpaul
Copy link
Collaborator Author

This happens even in init sine with derez in slot 1

@ghost
Copy link

ghost commented Aug 29, 2021

This may be a red herring but it looks related:

With either DeRez loaded in Surge
or the DeRez2 VST on the same track after Surge
(init saw, no sound playing)
lowering Resolution/Rez slider
at 44.1kHz I see this peak at quater samplerate/half nyquist:
peak
which disappears if and as long as a note is played
This happens only in combination with Surge (XT and 1.9).
(not with dexed or ob-xd)

With only Surge on a track,
(init saw, no sound playing and no FX)
I see this on a bit meter:
bit
could this be responsible for the excitation?
(and what is it?)

@mkruselj
Copy link
Collaborator

mkruselj commented Aug 29, 2021

That's probably what is causing the excitation indeed. As to what it is, who knows...

I noticed another weird thing: the bit pattern changes if you mute ALL oscillators and press a key!

@ghost
Copy link

ghost commented Aug 29, 2021

...or deactivate the highpass filter.
and loading either Combulator, Ringmod, Ensemble, Resonator or bit glitter as global FX
"silences" the bit meter.

@baconpaul
Copy link
Collaborator Author

Let me just tag in @airwindows here

Chris - derez2 makes noise when we load it. We don't know why. Any thoughts?

@mkruselj
Copy link
Collaborator

mkruselj commented Aug 29, 2021

It seems Surge is creating something in the very high bits of double precision float for no reason. This is before loading any effect at all. I tried a dozen other synths over here and none of them do this. Weird.

@baconpaul
Copy link
Collaborator Author

wierd
surge is all floats all the way out to the interface coding wise. where does it get converted to double I wonder?

@mkruselj
Copy link
Collaborator

I don't know, but 1.9 is behaving exactly the same!

@ghost
Copy link

ghost commented Aug 30, 2021

This is Surge doing nothing with the same peak at inaudible level.
When I'm truncating Surges output to 48bit it is gone.
low
I think the bitcrusher in DeRez (and other bitcrushers)
just brings that to an audible level but is not the problem itself.

@baconpaul
Copy link
Collaborator Author

so surge is float (32 bit) through the entire pipeline
i wonder what's reconstructing the noise in these higher order bits
i don't even have an option to set them! I just get an AudioBuffer and push the floats onto it.

@mkruselj
Copy link
Collaborator

You can use this free bit meter plugin in any host:

https://www.stillwellaudio.com/plugins/bitter/

rather than rely on Reaper-specific JS effect.

@mkruselj
Copy link
Collaborator

So it turned out this is caused by clear_block_antidenormal_noise(). But that is there for a reason (otherwise patches with long reverbs and delays will grind CPU for far too long while calculating denormals all the time).

BUT other plugins also fight denormals, and don't exhibit this behavior. Hmmm....

@mkruselj mkruselj added Airwindows Issues related to Airwindows effects implemented in Surge Effects labels Sep 14, 2021
@mkruselj
Copy link
Collaborator

It seems there's not much we can do about this issue. At least not in the current milestone, so pushing it out to Currently Unscheduled.

@ghost
Copy link

ghost commented Dec 8, 2021

lowering smallvalue in antidenormalnoise (basic_dsp.cpp) to 1e-25 helped to keep the problem
surge internal, meaning plugins (bitcrushers) running on a track post surge don't pick up
the noise shown above anymore.

If I change the clear_block_antidenormalnoise() occurences in SurgeSynthesizer.cpp
to clear_block() the problem is gone.

I clearly don't understand the process enough but seeing that denormals are flushed
in various places in surge I still wonder if the noise isn't redundant?

I tested a lot back and forth and I don't see the "cpu hogging" @mkruselj mentioned with these changes.
Since we're both intel might there be a difference in compiler optimization? (clang 12 here).

@baconpaul
Copy link
Collaborator Author

So this is really interesting and gives me an idea
I wonder if we should clear_block until the first noise is made by the synth post engine halt, and clear block with noise after that

@baconpaul
Copy link
Collaborator Author

Yeah so this is entirely in the derez warmup

If I put this in SurgeSynth

static int i = 0;
    auto clearfunc = clear_block_antidenormalnoise;
    if (i < 100)
    {
        clearfunc = clear_block;
        i++;
    }

and call clearfunc rather than clearfunc antinoise the startup load of one note idm makes no noise (and a subsequent shift does, because of that static).

So I think 'don't warm up the fx with noise' may be the answer here.

let me see if i can bodge that in.

baconpaul added a commit to baconpaul/surge that referenced this issue Dec 8, 2021
Slight denormalization noise in the warmup phase of some
aurwindows (esp DeRez) would cause a pop. Avoid that by having
either the first 500 blocks (~1/3 second) or time until first note
whichever is smaller clear the output with zeros, then add the
noise after

Closes surge-synthesizer#4900
baconpaul added a commit to baconpaul/surge that referenced this issue Dec 8, 2021
Slight denormalization noise in the warmup phase of some
aurwindows (esp DeRez) would cause a pop. Avoid that by having
either the first 500 blocks (~1/3 second) or time until first note
whichever is smaller clear the output with zeros, then add the
noise after

Closes surge-synthesizer#4900
baconpaul added a commit to baconpaul/surge that referenced this issue Dec 8, 2021
See surge-synthesizer#4900, where DeRez gave us loads of problems with
rining denorms

CLoses surge-synthesizer#4900
baconpaul added a commit that referenced this issue Dec 8, 2021
See #4900, where DeRez gave us loads of problems with
rining denorms

CLoses #4900
@baconpaul baconpaul reopened this Dec 8, 2021
@baconpaul baconpaul changed the title AirWindows DeRez glitch on load Denormal Noise is visible out the back of Surge Dec 8, 2021
mkruselj added a commit to mkruselj/surge that referenced this issue Jan 19, 2022
Minor other cleanups (removing unused comments in a few places)

Closes surge-synthesizer#5722 and surge-synthesizer#4900
@mkruselj mkruselj linked a pull request Jan 19, 2022 that will close this issue
baconpaul added a commit that referenced this issue Feb 6, 2022
Minor other cleanups (removing unused comments in a few places)

Closes #5722 and #4900

Co-authored-by: Paul <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Airwindows Issues related to Airwindows effects implemented in Surge Bug Report Item submitted using the Bug Report template DSP Issues and feature requests related to sound generation in the synth Effects
Projects
None yet
2 participants