22 May '13 - 10:44
Pages: [1]
 Author Topic: Need help with Matrix mixing  (Read 419 times)
Wishmaster
Posts: 124

 « on: 17 Oct '11 - 06:18 » Quote

Hi
I'm trying to understand  Matrix  mixing (in delphi).
Can you tell me whether it's accurate?

const
(* In = stereo, Out = stereo.  *)
Matrix1 : array[1..2] of array [1..2] of Single =
((1, 0),  // left out = left in
(0, 1));  // right out = right in

(* In = stereo, Out = swapped stereo. *)
Matrix2 : array[1..2] of array [1..2] of Single =
((0, 1),  // left out = right in
(1, 0));  // right out = left in

(* In = stereo, Out = mono. *)
Matrix3 : array[1..1] of array [1..2] of Single =
((0.5, 0.5)); //mono out = half left + right in

(* In = stereo, Out = quadraphonic (4 channels). *)
Matrix4: array[1..4] of array[1..2] of Single =
((1, 0),  // left front out = left in
(0, 1),  // right front out = right in
(1, 0),  // left rear out = left in
(0, 1)); // right rear out = right in

(* in = Stereo out 5.1 *)
Matrix5: array[1..6] of array[1..2] of Single =
((1, 0),  // left front out = left in
(0, 1),  // right front out = right in
(1, 0),  // left rear out = left in
(0, 1),  // right rear out = right in
(1, 0),  // Center
(0, 1)); // Sub

(* in = Stereo out 7.1 *)
?

(*
Mixer:= BASS_Mixer_StreamCreate(44100, 6, Mixer_Flag);

// add the channel with matrix mixing enabled
BASS_Mixer_ChannelSetMatrix(channel, @matrix5); // apply the matrix
*)

 Logged
Ian @ un4seen
Posts: 15259

 « Reply #1 on: 17 Oct '11 - 15:12 » Quote

(* in = Stereo out 5.1 *)
Matrix5: array[1..6] of array[1..2] of Single =
((1, 0),  // left front out = left in
(0, 1),  // right front out = right in
(1, 0),  // left rear out = left in
(0, 1),  // right rear out = right in
(1, 0),  // Center
(0, 1)); // Sub

The speaker order in 5.1 output is as follows: left-front, right-front, center, LFE, left-rear/side, right-rear/side. So the "Center" and "Sub" entries need to be shifted 2 lines up. Unless you are using the center/sub speakers as a stereo output, you may also want to change those entries to output nothing ("0,0") or mono ("0.5,0.5").

With 7.1 output, the order is as follows: left-front, right-front, center, LFE, left-rear/side, right-rear/side, left-rear center, right-rear center.
 Logged
Pages: [1]