Matrix~ CPU usage


    Apr 01 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?

    • Apr 01 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
    • Apr 02 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.
    • Apr 02 2006 | 7:31 pm
    • Apr 03 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.
    • Apr 03 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
    • Apr 03 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.
    • Apr 03 2006 | 9:28 pm
      Scripting connections (thispatcher) helps to reduce the load. It's a bit dirty.
      _ johan
    • Apr 03 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?
    • Apr 04 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
    • Apr 04 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:
      --
      [][] [][][] [][] [][][] [][][][][][][][][][][][][][][]
      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
    • Apr 05 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
    • Apr 06 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.