Using matrix~ with feedback~

Tom Holland's icon

I'm trying to create a matrix where outputs are routed back into inputs using send~ & receive~ between subpatches, not to create audio feedback but to achieve dynamic routing. Each matrix output goes into a subpatch and back into the corresponding input.

The problem is the compiler picks this up as a feedback loop (though of course I don't want to route a matrix output back into the corresponding input anyway), but wherever I put the feedback~ object in each loop the audio just becomes clicks and pops. This method of controlling dynamic routing seems possible using feedback loops in Max so how do you do it in RNBO?

Christoffer Karlsson's icon

I'm currently trying to use matrix~ as a modulation matrix where the modulation sources can modulate themselves. I have also tried using feedback~ but it doesn't seem to work as one would expect.

If I add a feedback~it doesn't output anything (and no signal probe appears if I hover over an output connection).

Now, there's a cryptic line in the documentation:

Provides a single sample buffer delay. This object is particularly useful for creating a line of feedback with the delay~ object. Note that feedback~ only works when connected to other objects on the same patcher level, so be careful when using feedback~ in or around subpatchers.

which had me wondering if there's something special going on during code generation and that it is really only intended to be used in conjunction with delay~. And indeed, after adding a [delay~ 0 0] right before the feedback~ I do get output! (I haven't looked into if it adds any extra delay or not.)

Christoffer Karlsson's icon

Did some further experimentation and it looks as if there something strange going on when using matrix~ with feedback~.

I put together a quick patch where feedback~ seems to be working fine when directly connected to a cycle~ but if passed through a matrix~ it breaks and requires a delay~ (or maybe something else would work too?).

Max Patch
Copy patch and select New From Clipboard in Max.

I don't know if I'm missing something, but I'll report it as a bug just in case.

EDIT: Might not require a delay~: tried it out with a simple pass-through gen-patch (in 1 -> out 1) and that worked as well (maybe better even; I think there is some extra delay when using delay~ 0 0 but not when using gen.)