# MIDI

MIDI is an asynchronous serial data protocol that is commonly used in live events.

## Receiving MIDI

### Setup in the Devices window

<div align="left"><figure><img src="https://3312042618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9sVaJpWJhPbmscipukhh%2Fuploads%2FeWlTc3khGbRZbhxCMIeq%2Fimage.png?alt=media&#x26;token=4778cc02-94f7-40db-b116-e80a66ac6d8d" alt=""><figcaption></figcaption></figure></div>

Insert a **MIDI receirver** node and after you have selected a *Stream* income source, you can enable the **Receive** checkbox.​

### Timecode

If there is any MIDI Timecode coming in, it will be displayed at the bottom of the Data section.

{% hint style="info" %}
**Good to know**: Please note you need to use **MTC Short Message** format for LightAct to be able to parse MTC.
{% endhint %}

{% hint style="info" %}
**Good to know**: in the properties of MIDI Receiver node, you can also apply Timecode offset, which will affect all subsequent operations with this timecode.
{% endhint %}

### Setup in the Layouts window

Place a **Read MIDI** node and select the **MIDI** **receiver** device node whose data you would like to read.

<div align="left"><figure><img src="https://3312042618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9sVaJpWJhPbmscipukhh%2Fuploads%2Fgit-blob-12bad9ed46eedbfd40bdd6d32202c87fb5c3c0bc%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
**Good to know**: In order to watch the output values, you can right-click on the output pins and select **Watch**.
{% endhint %}

### Controlling Layers with MIDI

<figure><img src="https://3312042618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9sVaJpWJhPbmscipukhh%2Fuploads%2FM5Pt3zWGKzmXGoAEjvWN%2Fimage.png?alt=media&#x26;token=cf4b5410-6bab-47f1-b5da-93daeaaa493d" alt=""><figcaption></figcaption></figure>

Similarly to [OSC](https://docs.lightact.com/osc-and-midi/receiving-osc/oscin), it is possible to control layers with MIDI. You can do that through MIDI In window where if you click on **Regenerate** button, every layer variable that has MIDI flag enabled, will get a unique MIDI Control and Value combination. If the corresponding MIDI message comes in, this variable will be set.

## Sending MIDI

### Setup in the Devices window

Place a **MIDI Sender** node in the *Device* window. After choosing your *Stream* parameters, such as the *Timecode rate* and Stream output, you can enable the **Send** checkbox to activate the node.

<div align="left"><figure><img src="https://3312042618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9sVaJpWJhPbmscipukhh%2Fuploads%2Fgit-blob-2eb48b28dcf174e5fc670b095975480c39045d3e%2FMIDISender.png?alt=media" alt=""><figcaption></figcaption></figure></div>

### Setup in the Layouts window

Place a **Send Mtc** node and as an input, select the newly created **MIDI sender** device node.

<div align="left"><figure><img src="https://3312042618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9sVaJpWJhPbmscipukhh%2Fuploads%2Fgit-blob-88557514a6b2e0d8dddf27c19ad304b6cb8a3b68%2FSendMTC.png?alt=media" alt=""><figcaption></figcaption></figure></div>
