Hi
I know questions about feedback and limitations due to block size are periodic, it happened once more to me. In the library there is this famous example from LocalIn:
// Resonator, must subtract blockSize for correct tuning
(
{
var in, imp, sound;
in = LocalIn.ar(1);
imp = Impulse.ar(1);
sound = DelayC.ar(imp + (in * 0.995), 1, 440.reciprocal - ControlRate.ir.reciprocal);
LocalOut.ar(sound); // for feedback
in
}.play;
It needs to take care of block size to get the correct pitch which makes it more complicated and feedback can’t be shorten than block size. With a feedback ugen, similar to delays but more straight forward, that code could be expressed as follows:
{
var imp;
imp = Impulse.ar(1);
Feedback.ar(imp, 1, 1 / freq, k=0.995); // args are sig, max delay, delay, fb coeff
}.play;
This might be a question for Daniel Meyer or other people working extensively with feedbacks. Could it help to have an ugen like this instead of using the buffer workarround (regarding performance and code base)?
I’ve done a test in the following repo, it can be tested easily:
I don’t have any particular interest about this topic, it just bothers me form time to time because I feel something is missing but if someone is interested I can explain it’s logic a bit more (indexes just wrap around a buffer that is twice the delay time in samples to hold the previous data, interpolation is missing and control parameters might need different rates or some processing).