Moving to dev...
I've taken this as far as I can for the moment, having confirmed using some very costly print statements (which are still in the patch, just commented out) that the math is correct. That is, the main processing loop in Convolution3_next_a is calculating the samples using the right formula, but something is happening between there and the output that I don't understand.
Probably just the mechanics of moving the result samples to the UGen's output. Since I've done almost no plug-in coding, it's very likely that I've done something wrong there.
Evidence for that is the fact that simply using the patched Convolution3 in a synth, even if its output is not connected to anything, corrupts the synth's result, e.g.
b = Buffer.read(s, "sounds/a11wlk01.wav");
k = Buffer.alloc(s, 64, 1, { |buf| buf.set(0, 1) }); // unit impulse
a = { |buf, kernel|
var sig = PlayBuf.ar(1, b, loop: 1),
filt = Convolution3.ar(sig, k, 0, k.numFrames);
sig
}.play;
(Notice the high-frequency buzzing.)
That's as much as I can do for today. Once the in/out bugs are worked out, I think this will be an improvement, since it avoids some unnecessary memory copying. (Note that _next_k isn't fixed in this patch.)
Any ideas what I'm doing wrong?
hjh
: H. James Harkins
: jamshark70@...
: http://www.dewdrop-world.net
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:
"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman