sc3-plugins icon indicating copy to clipboard operation
sc3-plugins copied to clipboard

Tartini: server crash when n < blockSize * 4

Open elgiano opened this issue 4 years ago • 0 comments

Tartini crashes when destroyed, if n < blockSize * 4 Reproducer:

s.options.blockSize = 256;
s.waitForBoot {
   x = {Tartini.kr(SinOsc.ar, 0.93, 512)}.play;
   s.sync;
   x.free; // Server crashes when x is freed.
}

A possible clue? Tartini.cpp line 153

if (overlap>(n-(4*unit->blocklenghth))) overlap=(n-(4*unit->blocklength));

This creates a negative overlap if n < 4 * blockSize.

I leave this issue here as a reminder, I haven't looked deeper into that, I found this out while working on a Bela, but it's reproducible on Linux as well. I don't know if I'm doing something silly, I will have to look more into this when I have time. For now I moved on by using n = 1024 with blockSize 256, and it works without problems.

elgiano avatar Jan 17 '21 14:01 elgiano