On Thu, Jan 14, 2010 at 07:08:26PM +0100, fons(a)kokkinizita.net wrote:
On Thu, Jan 14, 2010 at 09:48:08AM -0800, Ken Restivo
wrote:
Fons' code is like a finely-crafted jewel,
and it is written
in a terse style that looks to me like hand-optimised ASM code
(i.e., variable names that are more like register names:
"_s1", "gy", "dx"), but I'm starting to understand it a
little bit.
It's not ASM style, it's mathematical notation.
It looks like he's windowing through the
frames, and if the
frame is > 80 bytes, he windows through it in 64-byte
increments.
That's something you'll find in many of my plugins.
Its purpose is to normally have a block size of 64 frames,
but avoid a very short (e.g. one frame) final block when
'nframes' can take arbitrary values, as could happen when
parameters are automated and a host wants to update them
in the middle of a period.
while (nframes)
{
k = (nframes < 80) ? nframes : 64;
// Process k frames, 16 <= k <= 64
nframes -= k;
}
With your Jack settings the result will normally be two
blocks of 64 frrames. Filter paramters are updated at
block rate, with linear interpolation in between.
OK I tried a hack to check at the beginning of each process callback whether all the bytes
in the buffer add up to 0, and then just return instead of going through the rest of your
filter algorithm. And...
Your code is so efficient that after I added my little two-line hack, it made the problem
WORSE! 10% CPU instead of 6%.
I'm just shaking my head over here. I have no idea what is going on.
Oh, and on a different topic, I did get my FastTrack Pro to run at 24bits. I just had to
add the following to /etc/modprobe.d/sound: options snd-usb-audio device_setup=0x9
enable=1 The parameters did NOT get 24-bit mode going when given on the modprobe command
line, but they DID work when added to modprobe.d. I suspect some kind of weird udev or hal
magic going on.
Recording a band tomorrow. Alas, the tracking will be on ProTools, but the editing,
overdubbing, and mixing will now be in Ardour. Yay!
-ken