Can you help me with rerouting audio lib patch cords at runtime?

thu96

New member
Hi.

Is there a way of reconnecting a patchcord in the Audio library?

At startup a patchcord can be initiated but can it be rerouted in runtime?

The pointers for the source and destination as well as the connect() functions are declared protected..

I tried this but it gave a compiler error.

patchCord1 = AudioConnection(l_myEffect, 0, i2s2, 0);

Thanks in advance
 
As far as I know the audio library is built around the assumption that connections, and therefore the paths through memory of the audio will stay fixed at compile time. There was at least one attempt to modify the library to support 'mixing' connections but unsure how far that got - also if you are still within the 2 hour post editing window might be good to edit the title of your post to indicate you want help on a very specific part of a specific library (hot swap of audio library connections). There are probably only a couple of people around who can actually help with your question and something specific to their interests improves odds of them reading the post.
 
Some time ago I accepted a patch to allow patch cords to be destroyed. As have not tested it, other than testing to confirm it doesn't interfere with the normal case of all statically allocated patch cords.

So you still can't re-route a patch cord.

But if you created it with C++ new, then you can delete it. Then you can create a new one with the desired input & output. At least that's how it's supposed to work. That code is pretty new and not highly tested, though at least 1 other person has confirmed it worked for them. If you give it a try, I hope you'll report here whether it works for you, or any problems you encounter.
 
@thu96 have you had any luck deleting or rerouting PatchCords? I would be very interested in doing the same!
 
Back
Top