tidal-looper icon indicating copy to clipboard operation
tidal-looper copied to clipboard

generalize replace/overdub switch

Open tgirod opened this issue 4 years ago • 2 comments

Right now (or at least the last time I looked at your code), it seems that even though pLevel is a float between 0.0 and 1.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 buffer b. The new value put in the buffer could be b * pLevel + b * (1 - pLevel). That way, pLevel = 0 is replace mode, while pLevel = 0.5 is like overdub (with an attenuation of the previous loop) and pLevel = 1.0 is regular playback.

Does it make sense?

tgirod avatar Feb 12 '21 12:02 tgirod

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?

thgrund avatar Feb 13 '21 17:02 thgrund

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.

tgirod avatar Feb 14 '21 20:02 tgirod