Skip to main content


Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: mapping n channel to m channel (Read 1780 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

mapping n channel to m channel

when you have a channel based format of say, 8 channels and you want to map their content to a new format which has 13 channels, what would be the most straightforward method to calculate the math?

my input channels carry a 2D soundfield (created using VBAP and such, but it doesnt really matter) and the output channels should describe the same soundfield as the input channels (circular 2D, or alternatively, a straight line at the front position).


so the energy of the content has to be distributed in a way that the energy in the soundfield does not get changed.

i figured that the mapping can basically be done by applying a trapezoid vector.

my issue now is that i dont want to implement it using buffers. instead i needed to find the right values for all nodes in a matrix conversion one by one. ("aka how much of input channel 7 has to be sent to output channel 3?" - including those who will end up with a factor of 0.)

we have the variables number of inputs, number of outputs, starting point (you would probably use integer numbers or 0.-1. for the i/o channels) and optionally offset.

maybe anyone had examples or ideas how such a math formula looks like. no matter where i start, i always get stuck at one point.

Re: mapping n channel to m channel

Reply #1
Provide what you've done already, since you said "I always get stuck at one point".
If it's down to programming as such, I suggest, when it's about specific programming questions.

I'd probably map them out in a a graph and then use positional informaion to map them onto the new graph. Note that using pure trapezoidal information is often not desirable, you'd be downmixing onto all channels. I'd probably use the resulting adjacency matrix to figure out what channels are mixed by which source channels.

If say you're adding a new channel in between an existing channel, you can use its positional information to figure out the fractional downmix of the the two source channels, but this might be not what you get as a result. In the end, it'd be a lot down to checking.

The "easiest" approach would be to simply disregard the additional channels and map eight of the new 13 channels to their closest original counterpart, and leave the five new channels just silent.

Another Idea to consider is something like Dolby Atmos, which uses a large number of speakers but also a variable number of speakers between users. The audio source is provided in terms of "sound objects" and the mixing happens on the user's devices. The exact math to get a decent result is kept somewhat secret, it's not just a simple trapezoidal fractions based on a graph, with the distances of the speakers as their weight to the object location as an additional node. Although there are articles and tests, which suggest it isn't that much more