# Controlling OBS with a MIDI device

## 1. Configure OBS <a href="#id-1-add-an-onyx-element" id="id-1-add-an-onyx-element"></a>

To control OBS remotely, we will use a free open-source plugin called [OBS-Websocket](https://github.com/Palakis/obs-websocket). The first step is to download it and install, following the instructions on the link.

Then, open OBS and you should see a new option under the **Tools** menu called WebSockets Server Settings.

![](https://3766568293-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LuTyAYhvh-0rGV983Jy%2F-MNhmzma88j4T92bMahU%2F-MNhr_P71yjVFnM8ms21%2Fimage.png?alt=media\&token=ef6a6e35-3a45-4b6e-9f72-c5de9c0b7fa0)

Click this option and you will be presented the following window\..

![](https://3766568293-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LuTyAYhvh-0rGV983Jy%2F-MNhmzma88j4T92bMahU%2F-MNhrmeTfft99M25ctRr%2Fimage.png?alt=media\&token=86d532ae-af7e-4ed6-bbfe-80a88bbad85c)

You will need to check the option "**Enable WebSockets server**". If you want to enhance security, you can enable the authentication and provide a password. You should be able to leave the port at the default value 4444.

## 2. Add an OBS element in ShowCockpit <a href="#id-1-add-an-onyx-element" id="id-1-add-an-onyx-element"></a>

On the **Elements** section, click the **Add** button to add an OBS element to the project:

* **Video > OBS > OBS - Websocket**

### Change the element Options <a href="#enable-the-element" id="enable-the-element"></a>

* **IP Address**: the IP address of the computer running OBS (leave 127.0.0.1 if you are running in the same computer as ShowCockpit)
* **Port**: must match the port number defined in Step 1
* **Password**: must match the password defined in Step 1, or leave empty if not using authentication

### Enable the Element <a href="#enable-the-element" id="enable-the-element"></a>

Click the toggle buttons on the element to enable it.

## 3. Add MIDI device element  <a href="#id-2-add-midi-device-element" id="id-2-add-midi-device-element"></a>

Use the **Add** button again to add your MIDI device element through **External Control > MIDI**. Currently, RD/ShowCockpit has out-of-the-box support for multiple MIDI devices - [check out the complete compatibility list here](https://showcockpit.com/site/docs/).

If your device is not listed, you will need to use the **Generic MIDI** driver and map your device controls manually.

When using a specific MIDI device driver, you can skip to Step 5.

### Set Element Options <a href="#set-element-options" id="set-element-options"></a>

&#x20;After adding the element, make sure that the correct device is selected under both Input Device and Output Device options.

### Enable the Element <a href="#enable-the-element-1" id="enable-the-element-1"></a>

Finally, click the toggle button on the MIDI device element to enable it.

## 4. Learn MIDI Controls (Generic MIDI only) <a href="#id-3-learn-midi-controls-generic-midi-only" id="id-3-learn-midi-controls-generic-midi-only"></a>

In case you selected the **Generic MIDI** driver, now you need to "teach" this driver what controls (faders, buttons and encoders) your device has. For the officially supported MIDI devices, controls are automatically mapped, so you can skip to the next step.

Double-click the **Generic MIDI** element to open its window - you will start by mapping the **Faders**. Click on **Enable Learn** on the top-right to start listening to MIDI input.

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LuTyAYhvh-0rGV983Jy%2F-LuZuW5A7DF0ZeKAyR4e%2F-Lub1GCEgZ2P2gLob46Z%2Fgeneric-midi-fadbutenc.jpg?alt=media\&token=6a511fb2-4932-4a72-9b0e-9bca524df27f)

* Move, one-by-one, all **Faders** on your MIDI device. They will be added to the **Faders** list.
* To map the **Buttons**, click on **Buttons** (above the table) and repeat the procedure now for all your device buttons.
* Finally, map your **Encoders** by clicking on **Encoders** and repeat the procedure for all the encoders.

You can now close the **Generic MIDI** window by clicking **Back to Elements** or clicking on any menu button.

## 5. Mapping <a href="#id-4-mapping" id="id-4-mapping"></a>

Open the **Mapping** section on the Main Menu.

This section is divided into 3 columns, from left to right:

* Functions
* Parameters
* Controls

![](https://3766568293-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LuTyAYhvh-0rGV983Jy%2F-MNhmzma88j4T92bMahU%2F-MNi3pLAZImB8jzeLjao%2Fimage.png?alt=media\&token=9306a96e-46e3-4ca4-916f-5fde35d2bed6)

Select the **OBS - Websocket** element on the Functions column and select a function (for example, "Scene"). When you select the function, the button will be highlighted and the second column will have the parameters for the function. In this case, you can type the scene name you want to switch to.

Select the **Generic MIDI** element on the Controls column, open the Buttons list and click on one of the buttons to assign the function.

If you now physically click the button you have just assigned, the mapped scene on OBS should be triggered.

Repeat the process for all desired controls and functions.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://academy.showcockpit.com/showcockpit-for-windows/tutorials/video/controlling-obs-with-a-midi-device.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
