# setMixMatrix function not clear

**URL:** <https://qa.fmod.com/t/setmixmatrix-function-not-clear/11569>\
**Category:** FMOD Studio\
**Created:** [July 22, 2014, 8:36am UTC](https://qa.fmod.com/t/setmixmatrix-function-not-clear/11569 "2014-07-22T08:36:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![flolaq](https://avatars.discourse-cdn.com/v4/letter/f/90ced4/32.png) [@flolaq](https://qa.fmod.com/u/flolaq)\
**Post date:** [July 22, 2014, 8:36am UTC](https://qa.fmod.com/t/setmixmatrix-function-not-clear/11569/1 "2014-07-22T08:36:48Z")

</div>

Hi,

I am trying to route the channels of a 3 channel wav stored in a Studio event to certain channels in a 7.1 setup. This should be possible using setMixMatrix on the ChannelGroup of the event. I use the C# wrapper and use the ASIO driver (which tells it is running in RAW speaker mode although I initialized it in 7.1) with 20 output channels reported by getDriverInfo(…). The signal should be routed to output channels 4, 7 and 8 (with 1 being the front left channel).

The matrix I use to store the mix matrix has 400 float elements (20x20) and is set to 0.0f except the following:

ego\_mix\_matrix[3_3 + 0] = 1.0f;  
ego\_mix\_matrix[6_3 + 1] = 1.0f;  
ego\_mix\_matrix[7\*3 + 2] = 1.0f;

Then I call

FMOD\_ego\_vibration\_channelgroup.setMixMatrix(ego\_mix\_matrix, num\_output\_channels, 3, 3);

This produces an output on the front left, right and center channel (channels 1,2,3). I also tried to route only one input channel to a certain output channel, then in some cases the center channel also gets a signal (which should not happen in my understanding).

What is the exact meaning of the “inchannel\_hop” parameter? In the examples it is not used (is this still up to date??) and the explanation in the documentation makes no sense to me. The setMixMatrix call only works when using an inchannel\_hop of 3, not 400 as it would be following the documentation.

Sorry for the long post! Hope someone out there has an idea…

Florian

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [July 24, 2014, 4:29am UTC](https://qa.fmod.com/t/setmixmatrix-function-not-clear/11569/2 "2014-07-24T04:29:44Z")

</div>

In FMOD studio there is a separation between the mixer format, and the output format. If you call System::setSoftwareFormat(), then that is what the mix will run until the final stage before output. Querying getDriverInfo() only tells you about the output stage.

Because the mix is running in 7.1, you need to passing a 3x8 matrix to remap your channels.

inchannel\_hop can be explained as the stride of the matrix. i.e. If you wanted to build a 3x8 matrix inside your float[20][20] you would set inchannel\_hop to 20.

---

<div class="post-metadata">

**Author:** ![flolaq](https://avatars.discourse-cdn.com/v4/letter/f/90ced4/32.png) [@flolaq](https://qa.fmod.com/u/flolaq)\
**Post date:** [July 24, 2014, 8:34am UTC](https://qa.fmod.com/t/setmixmatrix-function-not-clear/11569/3 "2014-07-24T08:34:00Z")

</div>

> [@](#):
>
> In FMOD studio there is a separation between the mixer format, and the output format. If you call System::setSoftwareFormat(), then that is what the mix will run until the final stage before output. Querying getDriverInfo() only tells you about the output stage.
> 
> Because the mix is running in 7.1, you need to passing a 3x8 matrix to remap your channels.
> 
> inchannel\_hop can be explained as the stride of the matrix. i.e. If you wanted to build a 3x8 matrix inside your float[20][20] you would set inchannel\_hop to 20.

OK, now it works for me!

Some more comments:  
The channel numbering is not the same as in the WAV file, but how it is assigned to the speakers. This means in a 7.1 setup, the 3 channels of the WAV are assigned to the software channels 0, 1 and 4 (front left, front right, surround left).

The constellation between the internal mixing and the output stage was not clear to me from the documentation, nor was it that the channel assignment is based on speaker assignments (as mentioned in the former paragraph).

I guess a clarification in the documentation would be very helpful for other programmers (I hope I did not just miss a point in the docs…)

Thanks again, Florian

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [July 27, 2014, 10:37pm UTC](https://qa.fmod.com/t/setmixmatrix-function-not-clear/11569/4 "2014-07-27T22:37:15Z")

</div>

Our documentation is lacking in that regard. The channel order follows the order of FMOD\_SPEAKER enumeration - FL, FR, C, LFE, Surr L, Surr R, BL, BR.

I’m guessing that your 3 channel WAV is being treated as a Quad speaker setup (FL, FR, SL, SR) somewhere along the processing chain.

Can you describe (or maybe screencap) what the Studio event looks like. Is there a panner? what are the track and master output formats? what compression format is the bank?
