monome / softcut-lib

sample cutting library
GNU General Public License v3.0
34 stars 6 forks source link

wrap write frame index to loop, not buffer #3

Closed catfact closed 4 years ago

catfact commented 4 years ago

record head position is computed by adding record offset to write head position, then wrapping.

this wraps to buffer size, not to loop size, e.g. here: https://github.com/monome/norns/blob/master/crone/src/softcut/SubHead.cpp#L130

it doesn't matter until you start changing the offset amount. then you can have material in the loop that was written with the old offset, but which will never be hit with the new offset.

made a branch that had SubHead tracking loop positions in frames and using that for wrapping. but it's not quite enough, because wrap points should be [start, end+fade] when rate > 0, and [start-fade, end] when rate < 0. and rate can change each sample... so this bookkeeping should happen in the parent SoftCutHead, and maybe it's not quite worth it at all.

catfact commented 4 years ago

closing for now. i don't think variable R/W offset is that useful anyway.