# Obsidian Onyx - Multiple OSC Devices

## Multiple Devices = Multiple IPs

Onyx identifies devices by their IP address. This all works great if you have different physical devices on a network, but can be confusing if you are connecting to Onyx via the Loopback interface. Before anything else, we need to set our IPs for each endpoint, even if you're using the Loopback interface.

If you need a step-by-step tutorial to configure multiple IP Addresses for your Loopback interface, please check out this ShowCockpit Academy article:

{% content-ref url="../../../tutorials/networking/multiple-ip-addresses-on-a-nic" %}
[multiple-ip-addresses-on-a-nic](https://academy.showcockpit.com/tutorials/networking/multiple-ip-addresses-on-a-nic)
{% endcontent-ref %}

In this example, we will use the Loopback interface with multiple IPs, one per entity:

* 2.0.0.1 - Onyx
* 2.0.0.101 - OSC Device 1
* 2.0.0.102 - OSC Device 2

Once you have configured the IP Addresses, you're ready to launch Onyx.

## Onyx OSC Configuration

### General OSC Settings

After launching Onyx, open Settings > Network > OSC

On the "Settings" tab, you will be able to set a OSC port and the network interface.

On this example, we will use the default port **8000** and select the interface that shows our first Loopback IP address 2.0.0.1.

<figure><img src="https://3766568293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LuTyAYhvh-0rGV983Jy%2Fuploads%2FVIxhc81IHhn3Fomraod9%2Fimage.png?alt=media&#x26;token=47ebbfcf-43a7-4f52-97a7-e83d887bc4de" alt=""><figcaption></figcaption></figure>

### OSC Devices

On the Devices tab, you will find 16 slots ready to be configured. We will use the first two.

<figure><img src="https://3766568293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LuTyAYhvh-0rGV983Jy%2Fuploads%2FFj9Smgq7lj3PU9S1Xx2S%2Fimage.png?alt=media&#x26;token=7f68eaf3-e80b-40bd-9362-0be7a6653f3e" alt=""><figcaption></figcaption></figure>

* Device 1
  * IP: 2.0.0.101
  * Port: 9001
  * Device Space 1
* Device 2
  * IP: 2.0.0.102
  * Port: 9002
  * Device Space 2

{% hint style="info" %}
**Device Space**: the number defines a synchronization ID. If you want to sync two OSC devices, you can set them to the same Device Space. Since we want them to work in different banks, we need to set different Device Space IDs.

Device Space 0 is synced with the UI (the bank that is displayed in Onyx main window is on Device Space 0).
{% endhint %}

## ShowCockpit Configuration

ShowCockpit can act as an OSC Device for Onyx. If you want to have two OSC devices, you need to add two Onyx OSC elements to your project.

<figure><img src="https://3766568293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LuTyAYhvh-0rGV983Jy%2Fuploads%2FsPpjtIaKJ4JM4XYvgUfT%2Fimage.png?alt=media&#x26;token=04b3a8ef-7047-4d77-b745-bcfb157e1f33" alt=""><figcaption></figcaption></figure>

There are a few relevant element options that need to be set:

* Onyx IP Address: the IP Address that Onyx listens on
* Outgoing Port: the port set in the Onyx OSC settings
* Local IP Address: the IP Address of the device - must match the OSC Device IP set in Onyx
* Incoming Port: must match the device incoming port set in Onyx

For our example:

|                  |  Device 1 |  Device 2 |
| ---------------- | :-------: | :-------: |
| Local IP Address | 2.0.0.101 | 2.0.0.102 |
| Incoming Port    |    9001   |    9002   |
| Onyx IP Address  |  2.0.0.1  |  2.0.0.1  |
| Outgoing Port    |    8000   |    8000   |

Once you have the elements connected, now you just need to map controls (faders, buttons) to each of these elements, as in the usual ShowCockpit workflow, according to your own needs.

{% hint style="warning" %}
Remember that changing OSC device banks must be done by the device itself - you will not be able to see in Onyx in what bank the device is on.

You must, at least, map and trigger a "Change Bank" function of the Onyx - OSC element to set it to a certain Onyx bank. Otherwise, you will be default bank Onyx assigns to your Device Space (usually bank 1).
{% endhint %}
