catfact / softcut

library for seamless audio looping
12 stars 1 forks source link

queue position changes during crossfade #2

Closed catfact closed 4 years ago

catfact commented 5 years ago

currently, if a position change happens while crossfading, it is ignored. that's not so great. the other trivial option (performing the change) causes clicks which is also not good.

the next-least-trivial might be maintaining a queue of changes. when pos change happens during xfade, push to the q. when a voice finishes fadeout, it checks the q, pops and performs next change if non-empty.

this would still be kind of weird especially with long fade times (causing a delay) but probably better than nothing.

ranch-verdin commented 5 years ago

thought about this problem for lines on aleph - my preferred solution is a queue of length 1. So if you rapidly request several position changes during a crossfade, each successive request 'cancels' the already-pending request.

I guess this would be easier to implement than a queue (though haven't looked at your code other than to notice you are slinging C++ these days and still haven't looked at current norns ecosystem), and I would argue the behaviour is actually preferable to an arbitrarily long queue, especially for long fades.