Closed K0rrid0r closed 4 years ago
I think and start to suspect that the S&H LFO output values needs to be looked over. i just created a preset that can literally kill my speakers again and it is definitely linked to S&H sometimes hitting values that are too high or low and always in combination with S&H to other LFO rate or deform or both or just one of them.
S&H to other LFO rates = big problems, usually, and these loud clippings/bangs appear even on low rate mods. dangerous and very unpredictable. That is why this is important to look over.
Suggestion: look over the math in S&H and put boundaries on it, even if it samples noise to generate it's sample and hold, maybe some values are dangerous in combination with other things.
OK wow. It's definitely linked to high or low values. Now also appearing in the Envelope LFO also. but at highest value. Here we can see the link to S&H also reaching this value sometimes.
Here is the preset. Just drag up Amplitude on ENV4 lfo. (USE LIMITER! VERY LOUD AUDIO PEAK!) CPU and Audio peak from S&H LFO or Envelope LFO.zip
Investigation report into this problem in this preset comes here in steps.
This preset begins with CPU peak and audio peak, use limiter to trance the problem in the way described here: CPU and Audio peak - LFO2 to ENV4 Amp.zip
Step 1: ENV4 is linked to LFO2 rate. If we take away the link to LFO2 from ENV4 the problem Peak/CPU disappears.
Step 2: We reload the preset and look at LFO2 settings. It has deform set to -82.50 %, this creates both a very high CPU peak and a loud audio peak.
We set deform in LFO2 to 0.00 % now we only have a CPU peak and no audio peak, but instead audio silence where the audio peak was before.
Step 3: We reload the preset and look at LFO2 settings again. The CPU peak/audio peak appears above 85.71 % LFO Amplitude only.
Step 4: We trance the problem to LFO2 which is a Sawtooth being linked to ENV4 ampltude and the CPU peak/audio peak begins at 0.71 in mod amount. Remember ENV4 is also linked to LFO2 rate.
Conclusion: I don't know the answer to this, but it seems obvious to me that the LFOs need boundaries in some way in the mod amount when linked to each other, and not just S&H.
More hints on this problem is really appreciated, i might only tap it on the surface with certain combinations. This can be achieved in many other ways.
Hint S&H LFO can go out of boundary because S&H uses a prior value interp Envelope LFO seems to also be able to put out of boundary
Hint 2 Envelope LFO need a mod boundary. I Just linked another new LFO to ENV4 and dragged up the mod amount and and the CPU peak/audio peak begins at 0.71 in mod amount.
I tried to take away LFO2 (sawtooth) and LFO3 (S&H) signals from ENV4 Amplitude and overdirve it with a macrocontroller, it did not create the problem. but taking back the mod amounts from LFO2 (sawtooth) and LFO3 (S&H) put the problem back.
I think this is partly caused by std::fmod getting more cpu intensive as the range extends
on my mac replacing it with a - b * floor( a / b ) as an inline helps with fmod perf.
i also note that fmod on windows is about 10x less performant than fmod in the mac stdlib in range. (I'll check in all these performance programs soon).
I just tried new the new build. 'd04c3eb' both 32 bit and 64 bit. Nothing changed. still exactly the same problem, high audio peak + CPU peak.
This is not an fmod problem anymore, It is related to S&H and out of boundary values (my highest bet on that).
Sound of the clipping. spikes.zip
Picture closeup of the clipping
Preset that does it. CPU and Audio peak - LFO2 to ENV4 Amp.zip
I put a 16 step sequence in 130 bpm and drag up ENV4 amplitude and this happens.
So this definitely can click but it is super hard to figure out why Is this the smallest one you found Korridor?
This is in fact one of the bigger DB clips I've encountered. The thing with this particular problem is that it will happen very abruptly and all of a sudden without any warning and come VERY loud.
If you do the following.
LFO1 sends signal to LFO2 rate, deform, amplitude and phase and then you send LFO2 to LFO1 rate, deform, amplitude and phase
It should result in just crazy modulation that kind of lives for itself, instead this happens.
You can see on the limiter there on the left that its almost 10 db higher then the rest. that is definitely potentially very bad for ears and speakers especially if you already had high volume and was just sitting there and jamming out.
so I just set that up and then mapped lfo1 to pitch and it doesn't blow up.
I really want to debug this but I'm having a hard time getting to a small enough patch - can you take your above comment and save it as an FXP and attach it here perhaps?
Just re-latch and you will hear the clipping LFO clips, just re latch.zip
Korridor 3:43 AM so it dosen't blow up BUT it has that weird phase overflow "almost blowing up sound" 3:43 i pinned down the problem now to LFO1 3:43 Noise S&H 3:44 check what it happening when you go away from them and then back again 3:44 you hear this bitcrush sound 3:44 that is a bug 3:45 that sound is not because of the fart LFOing, it's some bugish thing 3:45 we are almost there Paul! hang on! 3:46 you also hear the problem easy when you change the waveforms on LFO1 to anything else except S&H or Noise. Then we end up on correct db and volume even if its chaos modulation going on, it is in the same db range. 3:47 when we enter S&H or Noise on LFO1 in this preset we get a "bitcrushy" sound that is not suppose to be there 3:47 and db is raised as well, ive heard this sound in other presets as well, its kind of hard to find but Ive heard it before.
Describe the bug So there are still some "clipping bugs" hidden in extreme modulation connected to connecting two LFOs that modulate each others rate to rate and then later all other parameters with each other. Things easily clip and just turns off very fast, -even on slow rates- and especially using S&H.
I guess it's related to the same math issue deform had (that still seems to exist here) + fast rates and wide negative and positive values creating out of boundary stuff.
Also in this preset that I'm including it sounds like "phase overflow" is building up over time just like that problem that was present in #1805 It sounds exactly the same! After a while it slowly builds up and will just build up louder and louder, only way to stop it is to click STOP in the DAW and begin the cycle again or re-latch surge.
To Reproduce Link LFO1 to any parameter in LFO2 (in the provided preset) and the sound will clip very fast. And if only latched and nothing is done, "phase overflow sound" begins after a while. LFO clip test route LFO1 params to LFO2.zip
Additional context The included sound sample here is an example with LFO2 only linked to rate in LFO1 and LFO1 controls the sine oscillator
The times where the "phase overflow sound" occurs in the included sample.
12 minute sound sample. https://we.tl/t-rNj6VJtdfn
Please let us know your surge version latest nightly, a general LFO problem.
Expected behavior no clipping, just super wierd and clear modulations.