# Switcher

> Cut or transition between up to four sources; outputs the program. The face of the switcher widget.

Source: https://docs.tune.toys/nodes/video.switch/

Switcher cuts or transitions between up to four sources and outputs the program.

## What it does

Program chooses the source on the output and Preview the next one. Changing Program starts the Transition, which lasts Duration milliseconds. Inputs are `in1` to `in4`, one stream each.

## When to use it

Use it as a live vision mixer. The switcher widget is planned as its Frame face; the parameters stay the authority.

## Ports

<!-- ports:start -->

| Port    | Direction | Signal | Lanes |
| ------- | --------- | ------ | ----- |
| `in1`   | Input     | Video  | 1     |
| `in2`   | Input     | Video  | 1     |
| `in3`   | Input     | Video  | 1     |
| `in4`   | Input     | Video  | 1     |
| `video` | Output    | Video  | 1     |

<!-- ports:end -->

## Parameters

<!-- parameters:start -->

| Parameter     | Label      | Range     | Default | Unit | Scale  | Notes                                                                                                           |
| ------------- | ---------- | --------- | ------- | ---- | ------ | --------------------------------------------------------------------------------------------------------------- |
| `program`     | Program    | 1 to 4    | 1       |      | linear | The source on air; changing it starts the transition.                                                           |
| `preview`     | Preview    | 1 to 4    | 2       |      | linear | The source cued next; Take swaps it with the program.                                                           |
| `transition`  | Transition | 0 to 4    | 1       |      | linear | How a program change moves between sources. Choices: 0 Cut, 1 Dissolve, 2 Wipe left, 3 Wipe right, 4 Wipe down. |
| `duration_ms` | Duration   | 0 to 5000 | 400     | ms   | linear | Length of a dissolve or wipe.                                                                                   |

<!-- parameters:end -->

### Program (`program`)

The source shown on the output, 1 to 4.

### Preview (`preview`)

The source ready for the next take, 1 to 4.

### Transition (`transition`)

How a change of Program happens; 0 is a cut.

### Duration (`duration_ms`)

Length of a transition in milliseconds.

## Tips

- Make Program a public parameter so a Frame or MIDI control can take it.
- Video needs the browser's WebGPU video engine. The Player and exports do not run video yet and report it unavailable. To see a video output, bind a live Screen in the Frame to it.

## See also

[Video crossfade](https://docs.tune.toys/nodes/video.crossfade/), [Multiview](https://docs.tune.toys/nodes/video.multiview/), [Composite](https://docs.tune.toys/nodes/video.composite/), [Video](https://docs.tune.toys/concepts/video/), [Control lanes](https://docs.tune.toys/concepts/control-lanes/).
