Forums > MaxMSP

Matrix~ CPU usage


Al
April 1, 2006 | 11:34 am

Hi, I’m building a software studio within Max/MSP, basically it has a number of effects units that can be routed in any manner that the user wishes and then output into a 12 channel virtual desk. The problem I’m having is now that all the pieces are coming together processor usage is going through the roof. I’ve managed to make many of the patches run more effeciently and each different effect has a mute~ and pass~ attatched to minimise the cpu usage.

The main problem is that for routing I’m using a Matrix~ which at the moment has 72 ins and 72 outs. I find that this alone adds 60% CPU load when the audio is turned on. I realise that there are alot of connections to the Matrix~ but I was wondering if there is another way to route the audio through these devices or if there is a way to save on cpu cycles somehow? Is what I’m doing simply too much for the hardware?


April 1, 2006 | 4:53 pm

From my experience, generally matrix~ is very efficient, but if you
scale it up that big, you’re talking about 5184 combinations to keep
track of, and that tends to get expensive. The other thing that I’ve
found to eat a bit of CPU in these types of situations is also the
accompanying send~ and receive~ for the inlets/outlets.

How many effects units are routing, and what is the routing mechanism?
(i.e. is it always serial, or is it parallel, or is it serial +
parallel?) If it is mostly serial, you could get away with using poly~
and receive~’s send~’s that you dynamically rename at their inlets. So
when you "play" the note, it sets connection between receive~ foo and
send bar~. If you don’t have to make 200 connections like this at a
time, this may be a reasonably fast solution. On the other hand, if
you want every unit to feedback into every other, then not so much. I
also posted a solution a couple of weeks ago on the list about how to
do randomized non-feedback routings through matrix~, so you might find
that useful.

If you want to save some CPU, (and don’t need to control line~ with
function) you can replace line~ and *~ combos with matrix~ 1 1 0. It
gives you an interpolating gain stage, and can bring substantial
savings… (well, with Altivec)

Peter McCulloch



Al
April 2, 2006 | 3:48 pm

Well basically there are 12 sfplay~ that can be routed in any manner that the user chooses so I don’t think I could do it with dynamically altering the receives. The reason there are so many effects configurations is because I want to be able to play 8 seperate tracks for drums and then route each one individually through gates etc.


April 2, 2006 | 7:31 pm



Al
April 3, 2006 | 7:47 pm

Hi, I think I’m just going to have to downsize the program, I can’t see another way around this and I don’t have the time to research and implement a new solution now. Thanks for your help.


April 3, 2006 | 8:17 pm

Alistair wrote:
> Well basically there are 12 sfplay~ that can be routed in any manner
> that the user chooses so I don’t think I could do it with dynamically
> altering the receives. The reason there are so many effects
> configurations is because I want to be able to play 8 seperate tracks
> for drums and then route each one individually through gates etc.

Think patchbay instead of Matrix. In a realworld patchbay there is only
a limited number of cables to do all possible connections. But the
limitation with the number of cables is never a problem. Especially if
you have some standard connections which are in place if you don’t patch.

The other approach with playing 8 tracks and treating each almost the
same, would be: think mixer instead of matrix~. Inspiration are
multitrack DAWs which have a limited number of inserts per track.

You have to get down to less than a 72*72 = 5184 channel mixer. You
can’t possibly expect that from a computer of 2006. (According to Moores
law you’d have to wait some years to reach that point.)

Stefan

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09



Al
April 3, 2006 | 8:59 pm

Yes the Matrix~ is basically being used as a studio patchbay. The problem is that each FX unit can be routed into any piece of equipment within the patch, just as you could in real life with a patch bay so it seems to me that the only way to limit the amount of possibilities is to limit the amount of effects and mixer channels that the user has access to.


April 3, 2006 | 9:28 pm

Scripting connections (thispatcher) helps to reduce the load. It’s a bit dirty.

_
johan



Al
April 3, 2006 | 10:05 pm

Hi, I’ve just taken a brief look at the scripting, would this not require 72 in’s and outs for each patch?


April 4, 2006 | 7:37 am

Quote: Al wrote on Mon, 03 April 2006 16:05
—————————————————-
> Hi, I’ve just taken a brief look at the scripting, would this not require 72 in’s and outs for each patch?
—————————————————-

Typically I’d try to avoid such mega-structures. Anyhow, I could imagine an object which you are going to make that would replace the [matrix~] and wherein all connections are handled through scripting. Zero load.

_
johan


April 4, 2006 | 7:20 pm

Alistair wrote:
> Yes the Matrix~ is basically being used as a studio patchbay. The
> problem is that each FX unit can be routed into any piece of
> equipment within the patch, just as you could in real life with a
> patch bay so it seems to me that the only way to limit the amount of
> possibilities is to limit the amount of effects and mixer channels
> that the user has access to.

A real world patchbay is rarely a matrix, but a number of ins and outs
and a limited number of cables. Still any possible connection can be
done, just not all at the same time. That is for real world applications
no limitation.

Get rid of the matrix~, which is just a monster mixer. The biggest
mixers (costing millions) might have 72 inputs but probably have only
16-20 free accessable outputs (busses & sends) plus a patchbay! They
need a huge space and energy…

Try somthing along these lines:

#P window setfont "Sans Serif" 9.;
#P window linecount 2;
#P newex 428 86 48 196617 prepend set;
#P user umenu 428 65 51 196647 1 64 81 1;
#X add FromIn1;
#X add FromIn2;
#X add FromFX1;
#X add FromFX2;
#X add FromFX3;
#X add FromFX4;
#P newex 378 86 48 196617 prepend set;
#P user umenu 378 65 51 196647 1 64 81 1;
#X add FromIn1;
#X add FromIn2;
#X add FromFX1;
#X add FromFX2;
#X add FromFX3;
#X add FromFX4;
#P user gain~ 412 155 23 34 158 0 1.071519 7.94321 10.;
#P user gain~ 378 155 23 34 158 0 1.071519 7.94321 10.;
#P newex 328 86 48 196617 prepend set;
#P user umenu 328 65 51 196647 1 64 81 1;
#X add FromIn1;
#X add FromIn2;
#X add FromFX1;
#X add FromFX2;
#X add FromFX3;
#X add FromFX4;
#P newex 278 86 48 196617 prepend set;
#P user umenu 278 65 51 196647 1 64 81 1;
#X add FromIn1;
#X add FromIn2;
#X add FromFX1;
#X add FromFX2;
#X add FromFX3;
#X add FromFX4;
#P newex 228 86 48 196617 prepend set;
#P user umenu 228 65 51 196647 1 64 81 1;
#X add FromIn1;
#X add FromIn2;
#X add FromFX1;
#X add FromFX2;
#X add FromFX3;
#X add FromFX4;
#P newex 178 86 48 196617 prepend set;
#P user umenu 178 65 51 196647 1 64 81 1;
#X add FromIn1;
#X add FromIn2;
#X add FromFX1;
#X add FromFX2;
#X add FromFX3;
#X add FromFX4;
#P newex 428 120 48 196617 receive~ FromIn2;
#P newex 378 120 48 196617 receive~ FromIn1;
#P newex 328 120 48 196617 receive~ D;
#P newex 278 120 48 196617 receive~ C;
#P newex 228 120 48 196617 receive~ B;
#P newex 178 120 48 196617 receive~ A;
#P user ezdac~ 378 217 422 250 0;
#P newex 128 177 48 196617 send~ FromIn2;
#P newex 78 177 48 196617 send~ FromIn1;
#P user ezadc~ 78 137 122 170 0;
#P newex 328 177 48 196617 send~ FromFX4;
#P window linecount 1;
#N vpatcher 20 74 620 474;
#P inlet 77 50 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 37 116 50 196617 *~ 0.;
#P inlet 37 50 15 0;
#P outlet 37 201 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P connect 3 0 2 1;
#P pop;
#P newobj 328 154 48 196617 p FX4;
#P window linecount 2;
#P newex 278 177 48 196617 send~ FromFX3;
#P window linecount 1;
#N vpatcher 20 74 620 474;
#P inlet 77 50 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 37 116 50 196617 *~ 0.;
#P inlet 37 50 15 0;
#P outlet 37 201 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P connect 3 0 2 1;
#P pop;
#P newobj 278 154 48 196617 p FX3;
#P window linecount 2;
#P newex 228 177 48 196617 send~ FromFX2;
#P window linecount 1;
#N vpatcher 20 74 620 474;
#P inlet 77 50 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 37 116 50 196617 *~ 0.;
#P inlet 37 50 15 0;
#P outlet 37 201 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P connect 3 0 2 1;
#P pop;
#P newobj 228 154 48 196617 p FX2;
#P window linecount 2;
#P newex 178 177 48 196617 send~ FromFX1;
#P window linecount 1;
#N vpatcher 20 74 620 474;
#P inlet 77 50 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 37 116 50 196617 *~ 0.;
#P inlet 37 50 15 0;
#P outlet 37 201 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P connect 3 0 2 1;
#P pop;
#P newobj 178 154 48 196617 p FX1;
#P connect 31 0 17 0;
#P connect 29 0 16 0;
#P connect 28 1 29 0;
#P connect 30 1 31 0;
#P hidden connect 26 1 27 0;
#P connect 16 0 26 0;
#P connect 17 0 27 0;
#P connect 27 0 11 1;
#P connect 26 0 11 0;
#P connect 25 0 15 0;
#P connect 23 0 14 0;
#P connect 21 0 13 0;
#P connect 24 1 25 0;
#P connect 22 1 23 0;
#P connect 20 1 21 0;
#P connect 18 1 19 0;
#P connect 19 0 12 0;
#P connect 13 0 2 0;
#P connect 14 0 4 0;
#P connect 15 0 6 0;
#P connect 12 0 0 0;
#P connect 8 1 10 0;
#P connect 8 0 9 0;
#P connect 6 0 7 0;
#P connect 4 0 5 0;
#P connect 2 0 3 0;
#P connect 0 0 1 0;
#P window clipboard copycount 32;

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09


April 5, 2006 | 8:53 am

jvkr wrote:
> Scripting connections (thispatcher) helps to reduce the load. It’s a bit dirty.

Scripting audio connections will interupt audio; not only dirty, its evil…

Stefan

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09



Al
April 6, 2006 | 3:29 pm

I didn’t realise it was possible to set send~ and receive~ but I should have known! Sometimes it’s possible to get so bogged down in the bigger picture that you miss the smallest things. There was me having set up a whole scripting routine and the answer was so simple.

Cheers, we are now using the menu to change the send~ to the correct fx or music channel. It’s reduced our CPU usage by a huge amount.


Viewing 13 posts - 1 through 13 (of 13 total)