How to code a matrix~ that applies gains & delays at the same time
Hello,
I'm facing a problem that I've never managed to solve, so I hope someone can guide me into the right direction: I need to code a matrix~ that applies gains & delays at the same time.
I'm doing some spatialization work with some quite heavy constraints : 128 audio objects and up to 64 outputs using a Distance Based Amplitude Panning algorithm coded in Java for the brain and using mcs.matrix~ for the muscles. Everything's working great, that's cool.
Now, I would like to add delays to every single [object - speaker] pairs and that's where I'm stuck! I simply can't figure out a way to create de delay matrix in max, nest it with the classic mcs.matrix~ object and keep the cpu usage arount 40% (on a M1). I've tried the "mcs.poly~ + tapin~ / tapout~ approach but my CPU told me that wasn't the right idea ^^'
Can anyone help me on this? Thanks.
try mc.gen~
delaying 64 channels produces quite low CPU on my old mac

It's not just 64 delays, it's a matrix of 128 x 64 = 8192 delays + 8192 gains at the same time ;) If it's too much for my M1 chip, I'll simply have to lower the input number, but the main problem is how to code a matrix of gains + delays ?
you mentioned 64 output channels
Which might make sense,
but to insert delay at so many inputs
does not.
At least for me
Yeah I clearly uderstand your point!
In fact I've been asked by friends why I am not using delays in my algorithm (the way they use it for WFS). My answer was that I simply don't like adding dynamic delays in a panning process because of the artefacts they produce. Still I was curious about it and tried to make something up with mcs.poly~ + tapin/mcs.tapout + mc.*~ with a small amount of inputs and outputs. I could barely hear the difference, so my conclusion was that it is not useful in my situation OR I'm doing something wrong. That why I'm asking for help.
I'm not trying to enter the WFS paradigm, I'm simply trying to find a way to improve the localization of a sound source. ATM I am only using dynamic gains et precise calibration of the system and that good enough for me but I'm sure that there might be some magic trick that would improve my algorithm. That's why I keep on looking for ideas ^^
there is probably nothing more economical than a simple sampledelay implemented in mc.gen~.
the only thing you can do in addition is managing some on/off of subcircuits. in a simple 8x8 matrix mixer, which also includes a predelay/delay parameter, i´ve put each of the 8 rows into a poy~ patcher, and now if all delays and gains in a row are 0, the row turns itself off from beeing processed.
btw 8000 MSP delay~ objects should not at all make an M1 worry. it´ll be something different with upsampled tapout~s of course.