Handling stereo with mc./mcs.matrix~ and matrixctrl

jg's icon

I'm probably being very thick, but I've run into an odd question I can't resolve. I'm trying to use mc.matrix~ plus matrixctrl to create a simple stereo patchbay. The idea is that a stereo signal enters a mc. or mcs.matrix~ and exits at a user-selected output, still in stereo. See the patch I was playing with here:

Max Patch
Copy patch and select New From Clipboard in Max.

I've tried this with both mc.matrix~ and mcs.matrix~ and I've also tried 'packing' the various signals into stereo multichannels using both mc.pack~ and mc.combine~; I've tried unpacking them with mc.unpack~ and mc.separate~.

Note that I need to be able to control stereo multichannels as entities, so that I can make a patchbay that operates exactly like a normal mono patchbay, but in stereo.

Here's the problem in the patch pasted above: despite the fact that the audio enters mc.matrix~ as four separate multichannels, it behaves thereafter as if each channel is, in fact, separate - i.e. 8 independent channels. In order to route a multichannel from input to output, for instance, you have to select TWO buttons on the matrixctrl - one for left and one for right. And also puzzling: when selecting two buttons to route input to output, what appears to happen is that they will route the input as a single entity, but the output as two separate channels. In my patch, each stereo multichannel has two pitches: when you route input to output, you can hear both pitches (i.e. both sides of the 'stereo'), but only in one speaker - i.e. it has routed both sides of the stereo to one side. Click the other button, and both sides of the stereo get routed to there too - you end up with two channels of mono.

I'm aware of the difference between mc.matrix~ and mcs.matrix~, but in fact they behave exactly the same way in this particular test. What's even more puzzling is that the help for these two makes an explicit difference between handling *inputs* and handling *channels*: in an object that's prioritising *inputs*, why doesn't matrixctrl control the routing of the inputs rather than the channels?

I've probably missed the point of something important, but any help would be appreciated!

Thanks,

John

jg's icon

Hi RTRA, many thanks for that. I tried adding the @chans 2 argument, but it's not what I'm after.

I did a pretty bad job of explaining the issue clearly, so I'll try it another way! Imagine a normal matrix~ and matrixctrl combination: single audio channels enter each inlet and can be routed to any or all of the outlets. Each 'button' on the matrixctrl corresponds to a routing.

What i want to do is the same thing but rather than handling individual channels, I want to handle pairs of channels (stereo) in the same way. Let's say

i) I start with four independent channels of audio, and I group them into pairs using mc.pack~ or similar and end up with two stereo multichannels: let's call those multichannels A and B.
ii) I have a 2-in, 2-out mc.matrix~, where each in and each out is a multichannel containing two channels (i.e. stereo): we'll call the inlets I1 and I2, and the outlets O1 and O2.
iii) I connect A to I1 and B to I2; I can route A to either O1 or O2 or both, and I can route B the same way.

So the first question is how to set up mc.matrix~ or mcs.matrix~ to handle signals in this way, and that appears to be not too complicated. BUT...

iv) In order to control the routing, I'd like matrixctrl to route inlet to outlet as it would do if we were using a normal matrix~. I.e., if you turn the top left button 'on', it'll route the first inlet to the first outlet. In the example I gave, that button should route I1 to O1, meaning that the STEREO signal A will be routed to outlet O1 in stereo. (What's happening right now is that the top left button routes only the L output of the stereo multichannel to the outlet, not both channels).

What we'll end up with is a good old-fashioned patchbay that routes stereo instead of mono signals. I hope that's clearer!

Any thoughts welcome!

jg's icon

Incidentally, the help for mc.matrix~ appears to do what I'm trying to do, but my example doesn't. What am I doing wrong?! I have to assume that it's got something to do with the way I'm creating stereo multichannels. In the mc.matrix~ help, the example uses stereo soundfiles.

Here's the helpfile I'm talking about:

Max Patch
Copy patch and select New From Clipboard in Max.

jg's icon

OK - silly me: just sorted it out. I was being too fussy: it doesn't need the mc.pack~ or mc.separate~ objects.

Here's the corrected version:

Max Patch
Copy patch and select New From Clipboard in Max.