thgrund / tidal-looper

Different looper variants for SuperDirt to provide live sampling in TidalCycles.
GNU General Public License v3.0
93 stars 2 forks source link

generalize replace/overdub switch #5

Open tgirod opened 3 years ago

tgirod commented 3 years ago

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?

thgrund commented 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?

tgirod commented 3 years ago

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.