Question about MinBlep usage

Hi Everyone,

Maybe you can help me out with some (maybe stupid) question regarding MinBlep usage. I have been trying to understand the logic behind choosing the right moment of applying the discontinuity, as well as the signal and size of the magnitude. In order to try to understand it, I went by checking the source code of the Befaco EvenVCO.cpp around line 70. However, all the code I find seems to be based at a specific phase “moment” where the wave would become “discontinuous”. Or “fold”, or “jump”, or whatever it is called. However I am working on a VCO that can create “discontinuities” on different parts of the wave cycle, like so: https://www.desmos.com/calculator/zmgi8fuozs

So my question(s) would be: Can I find the correct point to insert the discontinuity based on the current sample value being N far away from the previous sample value? On the example I made on Desmos we see it happen at 0.6 and 0.8 of the phase for the red wave, and at 0.6, 0.8 and 1.0+ of the phase for the blue wave. And let’s say I do determine 0.6 and 0.8 for example, how would I base the InsertDiscontinuity parameters to those values? (and maybe the direction/signal/amount of the difference?) Sorry if this is too noobie of a question, I think I somewhat understand the concept behind the MinBLEP, it is just not clear to me what are the conditions to apply it here. And the math definitely eludes me.

Thank you so much for any insight.

Cheers, Marcelo.

1 Like

To insert a discontinuity, determine exactly when and what magnitude the jump is. If a jump from -1 to 1 happened 0.2 frames ago, call minBlepGenerator.insertDiscontinuity(-0.2f, 2.f).

Ok … so the magnitude is the actual difference between the two values of the jump. Therefore can be positive or negative.

And each “frame” is each call to process()? Meaning each phase “step”?

Thanks!

Could you explain you introduction of the term “frame”? What are you asking? In general, yes, minblep only works if there are a small number of step discontinuities in your waveform.

A frame is a point in time corresponding to each sample of audio. (“Sample” is not exactly a synonym because Rack handles hundreds of samples per frame, at each module output.)

I see … Then I got the concepts I needed to finally apply it. I was able to successfully apply the minBlep last night on a test oscillator. Should be straightforward to do it from now on.

Thanks a lot man!