monome / norns

norns is many sound instruments.
http://monome.org
GNU General Public License v3.0
630 stars 145 forks source link

softcut buffer load incomplete #964

Closed tehn closed 4 years ago

tehn commented 4 years ago

seems something is not quite right with the frame counting.

softcut.buffer_read_mono (file, start_src, start_dst, dur, ch_src, ch_dst)

if start_dst is say 1.0 and dur is -1 (full file) then the file load stops 1.0 early.

think it's something around here:

https://github.com/monome/norns/blob/master/crone/src/SoftCutClient.cpp#L263

@catfact i know you're refactoring a bunch of this so i don't want to start trying to fix it if this code is different--- i'll check your new PR

(working on softcut studies while finding this)

catfact commented 4 years ago

yes, do check against new PR as that is the very code that is changed.

but, i don't think i changed that particular arithmetic.

so, the file load stops 1 second before the end of the file, is what you're saying?

catfact commented 4 years ago

ah, you're right. that line is wrong. should probably be:

auto maxDurDst = BufFrames - frDst;

"the maximum number of frames that the destination can accept, is equal to the number of frames in the buffer minus the starting destination frame."