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

phaser glitches out when reaching over 189-512 Hz in modulation rate #1850

Closed
K0rrid0r opened this issue May 9, 2020 · 4 comments · Fixed by #2033
Closed

phaser glitches out when reaching over 189-512 Hz in modulation rate #1850

K0rrid0r opened this issue May 9, 2020 · 4 comments · Fixed by #2033
Labels
DSP Issues and feature requests related to sound generation in the synth
Milestone

Comments

@K0rrid0r
Copy link
Collaborator

K0rrid0r commented May 9, 2020

Describe the bug
This is a very old problem existing already in surge 1.5.2 but actually still exist in the latest nighly. When the phaser reaches over 189-512 Hz in modulation rate it completly glitches out and creates all sorts of infact "dangerous for the speakers" problems, i dont actually know the terminology for it even, but it sounds dangerous and i remember doing it on a big sound system once and scared the shit out of everyone (this was when i found this bug in a club environment during a gig)

The only way to solve it is to take the phaser modulation rate all the way down to 0 or down to the safe area between 0-150 Hz and re-trig surge via restart of the DAW with stop and play. If this is not done the phaser stays in this glitch mode so to say.

It would be nice to be able to go all the way up even if its extreme in nature, but that is the essence of surge i think, that it should be able to do such things, I mean the LFOs goes up in audio range without problems.

Please let us know your surge version
This bug exist as a very old problem all the way form 1.5.2 to latest nightly and also 1.6.6 both in VST2 and VST3
Surge-NIGHTLY-2020-05-09-9569d16

  • Bits (32/64)

To Reproduce
Hold a note and just drag up the phaser and check what happends (use a limiter) with the modulation rate and the sound when it comes between somewhere at 189-512 Hz

Expected behavior
To not glitch out between 152-512 Hz

Desktop:

  • OS: [e.g. windows XP, Win 7, Win 8.1, Win 10]

Additional context
It should be a milestone to fix this before release of 1.7 because users who are not aware of this might end up actually getting really scared or crash a project or be close to destroy the speakers because the glitch introduces low end frequencies that shouldnt be there and also loud peaks etc.

If it cant be fixed those high frequencies should not be there imo.

@baconpaul baconpaul added this to the 1.7 beta 1 milestone May 9, 2020
@baconpaul baconpaul added the DSP Issues and feature requests related to sound generation in the synth label May 9, 2020
@baconpaul
Copy link
Collaborator

Link with #1706

@K0rrid0r K0rrid0r changed the title phaser glitches out when reaching over 152-512 Hz in modulation rate phaser glitches out when reaching over 189-512 Hz in modulation rate May 11, 2020
@baconpaul
Copy link
Collaborator

So I just spent some time on this

basically yeah the APFs aren't stable under a modulation that extreme. Depending on the depth and the input signal the just explode and don't go back until after the ringdown and phase reset

and with modulation on modulation you can easily push well outside the operating range

I think the solution is to just clamp the rate to 150hz max or so

I will do that but if there's a better plan around I'm all ears.

@baconpaul
Copy link
Collaborator

Oh ha no that's not it
Well that is it
but it's for a different reason
it's the same bug as FM2/3 and many other spots
I have a fix

baconpaul added a commit to baconpaul/surge that referenced this issue Jun 5, 2020
When modulation rate was high, the lfo phase could go not just
over 1, but also over 2 etc...

Fix that by changing -=1 to fmod in those cases

Closes surge-synthesizer#1850
@baconpaul
Copy link
Collaborator

baconpaul commented Jun 5, 2020

So here was the problem basically

rate = (command to get the rate)
lfophase += rate
if( lfophase > 1 )
   lfophase -= 1
lfovalue = triangle(lfophase)
omega = base + depth * lfovalue

where triangle is the typical 1 - |2 - 4 * phase| thing

this all happens at samplerate / BLOCKSIZE, BLOCKSIZE is 32, so the control nyquist frequency is 48k / 32 / 2 = 750hz

so you see the problem right?

if rate gets really big then that lfophase can go above 1, sure, but also above 2 once we are at and around that nyquist range

and if goes above 2 the lfovalue is no longer a [-1,1] triangle because that definition assumes in bound [0,1]

and that drives the apf unstable

but the fix was to make lfophase -=1 become lfophase = fmod( lfophase, 1 )

and then the phaser is stable all the way up to 512hz

pushing now.

baconpaul added a commit that referenced this issue Jun 5, 2020
When modulation rate was high, the lfo phase could go not just
over 1, but also over 2 etc...

Fix that by changing -=1 to fmod in those cases

Closes #1850
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DSP Issues and feature requests related to sound generation in the synth
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants