setMixMatrix function not clear


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[33 + 0] = 1.0f;
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…


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.

1 Like

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

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?