# Channel matrix

> Route and mix input channels into a declared output bundle with explicit gains.

Source: https://docs.tune.toys/nodes/std.matrix/

The Channel matrix routes input channels to output channels using a list of explicit routes, each with its own gain.

## What it does

The output width is declared on the node. Each route names a one-based input channel, a one-based output channel and a gain from -8 to 8. A route copies that input lane into that output lane at the gain. Several routes to one output add together, without normalization. Output channels with no route are silent, and an empty list of routes outputs silence. A route that points outside the declared bundles is rejected. Up to 256 routes are allowed. The node has no parameters; its width and routes are edited in the Channels section of its Properties.

## When to use it

Use it to downmix, swap or duplicate channels, or to mix a bundle down to a smaller one. For simple extraction use [Select channels](https://docs.tune.toys/nodes/std.select/); for simple joining use [Combine channels](https://docs.tune.toys/nodes/std.combine/).

## Ports

<!-- ports:start -->

| Port    | Direction | Signal | Lanes                   |
| ------- | --------- | ------ | ----------------------- |
| `audio` | Input     | Audio  | Inferred from the cable |
| `audio` | Output    | Audio  | Inferred from the cable |

<!-- ports:end -->

## Parameters

<!-- parameters:start -->

This node has no numeric parameters.

<!-- parameters:end -->

This node has no parameters. Its routes are configuration on the node.

## Tips

- Negative gains invert polarity.
- A mono to stereo spread is a matrix with two routes from channel 1, one to each output.
- Routes are not normalized, so downmixing several loud channels can raise the level; use a gain below 1 on each route.

## See also

[Select channels](https://docs.tune.toys/nodes/std.select/), [Combine channels](https://docs.tune.toys/nodes/std.combine/), [Mixer](https://docs.tune.toys/nodes/std.mixer/), [Multichannel audio](https://docs.tune.toys/concepts/multichannel/).
