esluyter / super-bufrd

UGens for accessing long buffers with subsample accuracy
GNU General Public License v3.0
26 stars 3 forks source link

Superpair: SuperPlayBufCF + .arDetails multichannel fix #8

Closed elgiano closed 4 years ago

elgiano commented 4 years ago

1) I noticed that SuperPlayBuf.arDetails produced scrambled output when multichannel-expanded. I think I fixed it by using multiNew and new1. 2) I implemented wslib's PlayBufCF dual crossfading strategy into a new class (SuperPlayBufCF). I then added fades on loop points, but here fades happen inside the loop, for every single player. I thought this was needed to avoid clicks while respecting loop durations (not cutting anything) even when loop points are the start or end of the buffer.

Let me know what you think! To be honest, I haven't spent enough time to understand SuperPhasorX's logic... this could be just a hopefully useful alternative

esluyter commented 4 years ago

I wonder about the multichannel arDetails, right now it goes like this:

SuperPlayBuf.arDetails(2, [b, c]);
-> [[b_sig, b_pos, b_isPlaying], [c_sig, c_pos, c_isPlaying]]

I wonder if it would be better to flop it so it returns

-> [[b_sig, c_sig], [b_pos, c_pos], [b_isPlaying, c_isPlaying]]

This way you have all the resulting signals in one place for easy summing or whatever.

esluyter commented 4 years ago

Regarding SuperPlayBufCF, it currently doesn't accept SuperPair start / end times which I think it should:

(
{
  SuperPlayBufCF.ar(2, c, start: c.atSec(120), end: c.atSec(121))
}.play
)

Also, how about using XFade2 for crossfading?

elgiano commented 4 years ago

Yeah, I've been thinking about this too. However, I think we should stick to how other UGens do it: for example, Pitch doesn't flop, so you get [ [pitch_a, has_pitch_a], [pitch_b, has_pitch_b] ]. Then it is up to the user to flop if needed, and I think we should do the same :)

elgiano commented 4 years ago

About CF: 1) I've now fixed support for SuperPairs. We need to do one more .asFloat for now, it will be better when we implement some SuperBinaryOpUGens. 2) On my way, I found a bug: SuperPhasor hangs on infloop when start == end. Opening another PR 3) About fades, it would be great to open another discussion where we collect a few edge cases to test implementations. One thing is that on my machine SuperPlayBufX clicks at loop bounds (and fades when triggered). Another that I would like to find out if we can get the same functionality with less than four players :)

I'm also working on a version with a user-definable fader, so that you can choose between equal or linear panning, for example