Open tgirod opened 3 years ago
I think it might be a good approach to leave the rLevel at 1.0 and calculate the pLevel for overdubbing. Do you have a source from which I can read a calculation, or on what basis is your calculation based?
I'm not sure how overdub is usually done. My assumption here is if you record a second loop over the first one, you should lower the volume of the first one in order to stay approximately at the same level and avoid clipping. So the formula I wrote is doing just that: if pLevel = 0.7
, you lower the previous loop's volume to 70% while adding the new signal to a volume of 30%.
But maybe I'm mistaken, and one should simply leave some headroom when recording, so you have space for a few overdubs without clipping. In which case, my proposition does not make sense.
Right now (or at least the last time I looked at your code), it seems that even though
pLevel
is a float between0.0
and1.0
, only those two values are relevant.I think it would be interesting to make use of the intermediary values. Say tidal-looper is recording. At any given time, we have one sample coming from the input
i
, and one sample coming from the bufferb
. The new value put in the buffer could beb * pLevel + b * (1 - pLevel)
. That way,pLevel = 0
is replace mode, whilepLevel = 0.5
is like overdub (with an attenuation of the previous loop) andpLevel = 1.0
is regular playback.Does it make sense?