tips on matrix usage / structure
Hi guys,
I am building a system with 6 vst out, plus other several audio sources (let's say other 5), and i want this audio to go to a 6 output dac.
Possibly I might want some effect before the sounds go into the DAC, so i think matrix is the system to go.
Do you have any particular recommendation for this setup, or any example i can study on to avoid mistakes, and optimize the efficiency of it?
I am thinking about, for instance, muting the audio streams that are not used to save CPU.
Anything that could be helpful, really, anything (!) would be much appreciated, since I’m not used to matrix, and I need to implement this structure for a modular system that might be expanded in the future (es more input, more output)
Thanks!
Matrix~ is very helpfull when one needs to route, switch or control the volume
of several in/outs.
In terms of CPU load, it is better to control 4 channel volume with {matrix~},
then using 4 x {*~} with {line~} or similar for smoothing.
Muting Audio streams ... for Vst, bypass is the best way to reduce CPU load,
on native Max processing (mute~) with (pass~) will help.(now one is supposed to use poly~ for that...)
One has to take care that no clicks and pops happen when bypass and muting
takes place.
So sometimes one has to ramp Volume down, before switching something off.
Well, post whatever patch You wan't to be looked at, if You think it might need
optimising.
----------
Using matrix~ is not really difficult, You set number of ins and outs AND nonbinary mode.
then add @ramp xxx argument for ramp time, or loadbang ramp xxx message.
Fast switching is easier to perform with clear message followed by switching values.
So if You have 4 inputs which need to be sent either to outs 0-3, or 4-7
You send message {clear, 0 0 1, 1 1 1, 2 2 1, 3 3 1} to matrix~, instead of
first switching outs 3-7 off, then the others on.
It is also easy to combine switch with volume control, mutiplying "On" value with set volume 0. - 1.
Or post fade effect send will be dependent on Audio On/Off switch, Volume and Effect Send value.
Collect the 3 Values into {pak 0. 0. 0} to {expr $f1*$f2*$f3} and You have On/Off, Volume and Eff send combined in 1 Value.
Switching parallel or serial Audio routing for effects is also done easy with matrix~...
I could go on forever with this, I simply like matrix~
Yes. Good point about "One has to take care that no clicks and pops happen when bypass and muting
takes place." Indeed, the bypass message as currently implemented for vst~/audiounit~ does not take care of clicks (I would have liked a ramp attribute to vst~ for such a bypass cross-fade time).
So, you have to build your own click-free bypass.
Because of this click management, 'bypass 1/0' for vst~ is not more useful than 'disable 1/0'.
Thank you all guys for your tips, very helpful.
@SOURCE AUDIO
what do you mean by "It is also easy to combine switch with volume control, mutiplying "On" value with set volume 0. – 1.
Or post fade effect send will be dependent on Audio On/Off switch, Volume and Effect Send value.
Collect the 3 Values into {pak 0. 0. 0} to {expr $f1*$f2*$f3} and You have On/Off, Volume and Eff send combined in 1 Value.
Switching parallel or serial Audio routing for effects is also done easy with matrix~…".
It sounds interesting but cannot grasb it...
I built a simple patch for reference, as for now it is my starting point. Let's see how i can tweak it to make it better...
And oh... there are a few questions in it ;-)
Here it is the code:
Hi, I am a bit in rush, so will post You all details as soon as possible,
but before You loose too much time :
Avoid using send~ and receive~ objects.
They are using CPU sycles, and introduce Latency, which might not be desired
in live situation.
You have to hardwire all.
Delete all live.gain objects sitting in patchers doing nothing.
using line instead of line~ does not help to avoid clicks.
and that is the sense of using matrix~it doies it all including smoothing.
Now to combining values,
if You switch one audio channel in matrix~on and off, You send it 1 or 0.
If You control it's volume You send a ramp between 0. and 1.
Now if you pack these 2 values and multiply them You receive
either 0 wenn Switch is off, or set volume value, for example 0.5
becasue 0.5 x 0 = 0, and 1 * 0.5 = 0.5 simple as that.
If You have more controls to be combined, eg post EFF send
then You need to pak SW, VOL and EFFsend into multiplication,
so expr $f1*$f2*$f3 and You get value which is respecting Switch state,
Volume and EFF send value, all in 1 float for matrix.
I think You will understand that.
I'll post example if needed.
-------------------
Now to the logic of switching and controls,
It is much easier to draw everything on the paper, and then
try to accomplish it in max.
It is much faster to get overview off all needed connections.
So maybe You may find out that it is easier that every audio source
first gets own matrix~which is able to send that audio to all needed destinations,
and control level of the signal.
Much better idea than to have 1 matrix~for all, overloaded with messages,
and all this sends~, receives~, extra volume controls etc
Here is a patch having one audio source with 4 selectable outputs, volume and 4 post effect sends.
And fixed a mistake - Effects Out was scaled twice...
Hey! sorry for the delay in my answer.
I really, really appreciated your feedback, that's a very different setup from mine (because I'm a noob in sound routing ;-), but actually have a few questions.
First of all: my question are possibly very stupid. But hey: we are here to learn, right? ;-)
Second: I did a little of repositioning of your objects, just to make it more comprehensible to me.
You will find a few (almost existentialistic) questions in there!
Hope you can shade some light on those questions!
Thanks a lot, again!
No Question is stupid, and we all learn all the time.
My point here is not to talk You into this or that concept,
but rather showing some constructions I found helpfull for own needs.
Here is the patch with the answers :
Thanks @souce audio, now is clearer!
Will dig more on the audio routing now ;-)