= Input/output section

image:realearn/screenshots/main-panel-input-output.png[Screenshot]

Use this section to connect ReaLearn to a specific controller.

Also see xref:best-practices.adoc#best-practices-input-output[].

[#input]
== Input menu

Allows you to select the xref:key-concepts.adoc#input-port[] to which this ReaLearn unit listens.
ReaLearn works with MIDI or OSC input.
In addition, it can listen to keyboard input.

[[fx-input]] MIDI: <FX input>::
When selected, ReaLearn captures all MIDI events that flow into this ReaLearn VSTi FX instance, for example coming from track MIDI items, track MIDI receives or the track input.
This is the default selection.

MIDI: _Some input device_::
When selected, ReaLearn captures events from the given MIDI device directly, before it reaches REAPER's tracks.
+
This will only work if _Enable input from this device_ is checked for the selected MIDI input device in REAPER's preferences (menu:Options[Settings > MIDI Inputs]).
The device name is prefixed with the device ID, which also shows up in the REAPER preferences.

Unavailable MIDI input devices::
This submenu contains MIDI input devices which are currently disconnected or not enabled in the REAPER preferences.

OSC: _Some device_::
When selected, ReaLearn captures events from the given OSC device.
Before any device shows up here, you need to add it via <<manage-osc-devices>>.

Unavailable OSC devices::
This submenu contains OSC devices for which control is currently disabled.


[[manage-osc-devices]] Manage OSC devices::
Lets you display and modify the list of OSC devices (globally).

<New>:::
Opens a dialog window for adding a new OSC device.
See <<osc-device-dialog>>.

_Some OSC device_:::

Edit::::
Lets you edit the device.
See <<osc-device-dialog>>.

Remove::::
Removes the device.
This is a global action.
If you remove a device, all existing ReaLearn instances which use this device will point to a device that doesn't exist anymore.
+
CAUTION: This can't be undone!

Enabled for control:::: If you disable this, ReaLearn will stop listening to this device.
This can save resources, so you should do this with each device that is not in use (as an alternative for removing it forever).

Enabled for feedback:::: If you disable this, ReaLearn won't send anything to this device.

Can deal with bundles:::: By default, ReaLearn aggregates multiple OSC messages into so-called OSC bundles.
Some devices (e.g. from Behringer) can't deal with OSC bundles.
Untick the checkbox in this case and ReaLearn will send single OSC messages.

Stream Deck: <None>::
Disables Stream Deck control.

Stream Deck: _Some device_::
When selected, this ReaLearn instance will _additionally_ listen to button presses of the chosen Stream Deck device. See xref:sources/stream-deck.adoc[] for details.
+
Unlike MIDI or OSC, choosing a Stream Deck device automatically enables feedback to the Stream Deck buttons, so you won't find a Stream Deck entry in the <<output>>.

_Unavailable Stream Deck devices_::
This submenu contains supported Stream Deck devices that are currently not connected.

[[computer-keyboard]] Computer keyboard::

If enabled, this ReaLearn instance will _additionally_ listen to key press and release events.

[#output]
== Output menu

Here you can choose to which xref:key-concepts.adoc#output-port[] ReaLearn should send MIDI/OSC xref:key-concepts.adoc#feedback[].

<None>::
This means, ReaLearn won't send any feedback to MIDI or OSC devices.
This is the default.

[[fx-output]] MIDI: <FX output>::
This makes feedback MIDI events stream down to the next FX in the chain or to the track's hardware MIDI output.
+
CAUTION: Under normal circumstances, it is better to use <<midi-some-output-device, select a specific output device>> instead. See xref:best-practices.adoc#best-practices-input-output[].

[[midi-some-output-device]] MIDI: _Some output device_::
If selected, ReaLearn will send feedback to the given MIDI output device.
This only works if _Enable output to this device_ is checked in REAPER's preferences (menu:Options[Settings > MIDI Outputs]).

OSC: _Some device_::
When selected, ReaLearn will send feedback to the given OSC device.
Before any device shows up here, you need to add it via <<manage-osc-devices>>.

Unavailable OSC devices::
This submenu contains OSC devices for which feedback is currently disabled.

Manage OSC devices::
See <<manage-osc-devices>> in the input section of the menu.

[#osc-device-dialog]
== OSC device dialog

The OSC device dialog lets you edit the settings of a ReaLearn OSC device and can be opened via <<manage-osc-devices>>.

Name:: A descriptive name of the device, e.g. "TouchOSC on my Android phone".

Local port:: Required for control.
The UDP port on which ReaLearn should listen for OSC control messages.
+
This port must be reserved exclusively for ReaLearn!
If you already use this port in another application (e.g. in REAPER's own OSC control surface) it won't work and ReaLearn will bless you with an "unable to connect" message in the "Input" dropdown.

Device host:: Required for feedback only.
It's the IP address of the OSC device to which ReaLearn should send feedback messages.
This address is usually displayed on your OSC device (e.g. as "Local IP address").
When targeting an OSC software that runs on the same computer as REAPER and ReaLearn, enter the special IP address `127.0.0.1` (or `localhost`).
+
When you configure your OSC connection on the device side, you must provide a _host_ as well.
There you should enter the IP address of the computer which runs REAPER and ReaLearn.
You can easily find it by pressing the xref:further-concepts/unit.adoc#projection[] button in ReaLearn, choosing the old browser-based projection and scrolling down a bit.
It's the value next to *Host* and should start with `192.168.`.

Device port:: Required for feedback only.
The UDP port on which the OSC device listens for OSC feedback messages.

All OSC device configurations will be saved in the REAPER resource directory (menu:Options[Show REAPER resource path in explorer/finder]) in the file
`Helgoboss/ReaLearn/osc.json`.