= Menu bar

image:realearn/screenshots/main-panel-menu-bar.png[Screenshot]

== Menu button

This opens the main menu of Helgobox/ReaLearn.
The same menu opens when you right-click an empty area.

It provides the following entries.

[[copy-listed-mappings]] Copy listed mappings::
Copies all mappings that are visible in the current mapping list (respecting group, search field and filters) to the clipboard.
You can insert them by opening the right-click menu of a xref:user-interface/main-panel/mapping-row.adoc[].

[[paste-mappings-replace-all-in-group]] Paste mappings (replace all in group)::
Replaces all mappings in the current group with the mappings in the clipboard.

Modify multiple mappings::

Auto-name listed mappings:::
Clears the names of all listed mappings.
As a result, ReaLearn will display dynamically auto-generated mapping names instead.

Name listed mappings after source:::
Sets the names of each listed mapping to the first line of its source label.

Make sources of all main mappings virtual:::
Attempts to make the sources in the main compartment virtual by matching them with the sources in the controller compartment.
This is useful if you already learned a bunch of MIDI/OSC/keyboard sources in the main compartment, just to find out later that you would like to use a controller preset that exposes virtual sources.

Make targets of listed mappings sticky:::
Changes the targets of all currently listed mappings so that they use xref:further-concepts/target.adoc#sticky-selectors[] object selectors by attempting to resolve the objects from xref:further-concepts/target.adoc#non-sticky-selectors[].

Make targets of listed mappings non-sticky:::
Changes the targets of all currently listed mappings so that they use the desired xref:further-concepts/target.adoc#non-sticky-selectors[].
You can see this in action in link:https://www.youtube.com/watch?v=kebF_NKAweA&list=PL0bFMT0iEtAgKY2BUSyjEO1I4s20lZa5G&index=9[tutorial video 9].
+
The general procedure is:
+
1. Choose the desired track selector
2. Choose the desired FX selector
3. ReaLearn will change the selectors for all targets where this is applicable

Move listed mappings to group::
Moves all currently listed mappings to the specified group.

Advanced::
Provides access to expert features.

Copy listed mappings as Lua:::
Like <<copy-listed-mappings>> but generates Lua/Luau code instead.

Copy listed mappings as Lua (include default values):::
Generates Lua/Luau code that contains even those properties that correspond to ReaLearn's defaults.

Paste from Lua (replace all in group):::
Like <<paste-mappings-replace-all-in-group>> but treats the clipboard content as Luau code.

[[dry-run-lua-script]] Dry-run Lua script from clipboard:::
Executes the Luau code in the clipboard and opens the returned data structure in a link:https://en.wikipedia.org/wiki/Text_editor[text editor].
See xref:best-practices.adoc#troubleshooting-luau-import[] to learn in which situations this can be useful.

[[compartment-parameters,Compartment parameters menu]] Compartment parameters::
This shows all parameters of the current compartment and makes it possible to customize them.
See xref:further-concepts/compartment.adoc#compartment-parameter[] to learn what such parameters are good for.
+
Each parameter provides the following customization options:

Name:::
Changes the name of this parameter.

[[set-compartment-parameter-value-count]]Value count:::
Lets you enter the maximum number of values.
This automatically turn this parameter into a discrete parameter.
See xref:further-concepts/compartment.adoc#continuous-vs-discrete-compartment-parameters[].

Compartment presets::

Create compartment preset workspace:::
Exports the Luau SDK files of this ReaLearn version into a new compartment preset workspace directory with a random name.
See section xref:further-concepts/compartment.adoc#writing-presets-with-luau[] for details.

Create compartment preset workspace (including factory presets):::
Exports the Luau SDK files of this ReaLearn version and all factory presets for this compartment into a new compartment preset workspace directory with a random name.
See section xref:further-concepts/compartment.adoc#writing-presets-with-luau[] for details.

Open compartment preset folder:::
Opens the ReaLearn preset folder for this compartment in a file manager.

[[reload-all-presets]] Reload all compartment presets from disk:::
If you made direct changes to preset files, you should choose this entry in order to reflect these changes in the preset list of this xref:key-concepts.adoc#compartment[].
+
This *will not* apply an adjusted preset to the current compartment, it will just reload the list.
If you want to apply a preset that has been changed on disk, you need to reload it by selecting it in the preset menu once again!

Compartment tools::

Convert toolbar to Stream Deck mappings:::
This takes a toolbar of your choice and converts it to a list of mappings that will project the toolbar on your Stream Deck via xref::sources/stream-deck.adoc[].
+
This feature is experimental and subject to improvement.
+
NOTE: It will work best with custom toolbars that use non-default icons.
Many of the default toolbar icons are not in the `Data/toolbar_icons` folder and therefore can't yet be loaded by ReaLearn.
However, in this case, you will see a descriptive text instead.


[[edit-compartment-wide-lua-code]] Edit compartment-wide Lua code::
Allows you to edit the compartment-wide Lua code.
See section xref:further-concepts/compartment.adoc#compartment-wide-lua-code[].

[[unit-options]] Unit options::

[[match-even-inactive-mappings]] Match even inactive mappings:::
By default, when encountering an incoming MIDI or keyboard event that matches at least one mapping, ReaLearn filters it out so that it doesn't reach other parts of REAPER anymore. Normally, xref:further-concepts/mapping.adoc#mapping-activation-state[inactive] mappings are not relevant here. Inactive mappings never match.
+
Consider a mapping with a xref:targets/track.adoc[track target], for example. As long as the corresponding track exists, the target and its mapping are active. Each incoming MIDI event which triggers that target will be filtered out. But as soon as you remove that track, the target and its mapping turn inactive. Consequently, the same type of MIDI events will not be filtered out anymore.
+
This behavior can be undesired. To get a more predictable MIDI and keyboard filtering behavior, you can enable this checkbox. If you do that, even inactive mappings will participate in matching. That way, temporarily inactive mappings will not let unwanted events "leak through".

[[send-feedback-only-if-track-armed]] Send feedback only if track armed:::
Here you can tell ReaLearn to only send feedback when the track is armed.
+
At the moment, this can only be unchecked if ReaLearn is on the normal FX chain.
If it's on the input FX chain, unarming forcefully disables feedback because REAPER generally excludes input FX from audio/MIDI processing while a track is unarmed (this is subject to change in the future).
+
[TIP]
.Recommendations
====
* If input is set to xref:user-interface/main-panel/input-output-section.adoc#fx-input[], you probably want to enable this option.
Rationale: Unarming will naturally disable control, so disabling feedback is just consequent.
* If input is set to a specific MIDI or OSC device, you probably want to disable this option in order to allow feedback even when unarmed.
====

Reset feedback when releasing source:::
When using ReaLearn the normal way, it's usually desired that feedback is reset when the corresponding sources are not in use anymore (e.g. lights are switched off, displays are cleared, motor faders are pulled down).
+
You can prevent this unit from doing that by disabling this option.
This can be useful e.g. when using REAPER/ReaLearn just in feedback direction, in order to take control of a hardware device (= using ReaLearn the other way around, "controlling from target to source").

[[make-unit-superior]] Make unit superior:::
Makes this unit superior.
See xref:further-concepts/unit.adoc#superior-units[] to learn more about this feature.

Use unit-wide FX-to-preset links only:::
By default, xref:further-concepts/unit.adoc#unit-fx-to-preset-link[unit-wide links] are applied *in addition* to the global links and take precedence over them.
This checkbox makes sure that *only* unit-wide links are used for this xref:key-concepts.adoc#unit[].

Stay active when project in background:::
Determines if and under which conditions this ReaLearn unit should stay active when the containing project tab is not the active one.
Applies to in-project ReaLearn instances only, not to monitoring FX instances!

Never::::
Will only be active when its project tab is active.
Only if background project is running::::
Follows REAPER's project tab settings ("Run background projects" and "Run stopped background projects").
Always (more or less)::::
Attempts to stay active no matter what.
Please note that this is technically not always possible when input is set to xref:user-interface/main-panel/input-output-section.adoc#fx-input[] or output to xref:user-interface/main-panel/input-output-section.adoc#fx-output[], when the background project is not running.

[[unit-fx-to-preset-links]] Unit-wide FX-to-preset links::
Manage a unit-wide list of links from FXs (plug-ins or JS effects) to ReaLearn main compartment presets.
Covered in link:https://www.youtube.com/watch?v=HtmWO7QNpgE&list=PL0bFMT0iEtAgKY2BUSyjEO1I4s20lZa5G&index=10[video tutorial 10].

Add link from last focused FX to preset:::
This lets you link whatever FX window was focused before focusing ReaLearn, to an arbitrary main compartment preset.
This only works if an FX has been focused before.

_Arbitrary FX ID_:::
If you have added a link already, you will see it here in the list.
In particular, you see the _FX ID_, which by default simply corresponds to the plug-in's original name (e.g. menu:Name: VSTi: ReaSynth (Cockos)[]).

[[edit-fx-id]] <Edit FX ID…>::::
With this, you can edit the FX ID manually.
See <<fx-id-dialog>> for details.

<Remove link>::::
(Globally) removes this FX-to-preset link.

_Arbitrary main preset_::::
The rest of the submenu tells you to which main preset the FX ID is linked.
You can change the linked preset by choosing another one in the list.

[[logging,Logging Menu]] Logging::

Log debug info (now)::: Logs some information about ReaLearn's internal state.
Can be interesting for investigating bugs or understanding how this plug-in works.
Log real control messages::: When enabled, all incoming MIDI messages, OSC messages or key presses will be logged to the console.
See xref:further-concepts/unit.adoc#logging-of-real-control-messages[].
Log virtual control messages::: When enabled, all triggered virtual control elements and their values will be logged (see xref:key-concepts.adoc#controller-compartment[]).
Log target control::: When enabled, all target invocations (parameter changes etc.) will be logged.
Log virtual feedback messages::: When enabled, all feedback events to virtual control elements will be logged (see xref:key-concepts.adoc#controller-compartment[]).
Log real feedback messages::: When enabled, all outgoing MIDI or OSC messages will be logged to the console.
See xref:further-concepts/unit.adoc#logging-of-real-feedback-messages[].

Send feedback now::
Usually ReaLearn sends feedback whenever something changed to keep the LEDs or motorized faders of your controller in sync with REAPER at all times.
There might be situations where it doesn't work though.
In this case you can send feedback manually for this xref:key-concepts.adoc#unit[] by selecting this menu entry.
+
There's a related REAPER action xref:reaper-actions.adoc#send-feedback-for-all-instances[] which sends feedback for all instances.

Instance options::

[[enable-global-control]] Enable global control:::
If you enable this option, this xref:key-concepts.adoc#instance[] will start to automatically add/remove units based on connected controllers.
See xref:further-concepts/instance.adoc#auto-units[].

[[open-pot-browser]] Open Pot Browser::
See xref:helgobox::plug-in/user-interface/menu-bar.adoc#open-pot-browser[].

Show App::
See xref:helgobox::plug-in/user-interface/menu-bar.adoc#show-app[].

Close App::
See xref:helgobox::plug-in/user-interface/menu-bar.adoc#close-app[].

User interface::

Background colors:::
Enables/disables the usage of background colors in the ReaLearn user interface (enabled by default).

Server::
See xref:helgobox::plug-in/user-interface/menu-bar.adoc#server[].

[[global-fx-to-preset-links]] Global FX-to-preset links::
Lets you manage xref:further-concepts/unit.adoc#global-fx-to-preset-link[global FX-to-preset links].
Works exactly as the <<unit-fx-to-preset-links>> menu.

[[fx-id-dialog]]
== FX ID dialog

The FX ID dialog is used to edit which properties of a FX trigger a preset change.
It is opened via menu action <<edit-fx-id>>.

FX name::
Allows you to adjust the (original) plug-in name that triggers the preset change.

FX file name::
Allows you to adjust the plug-in file name that triggers the preset change.

FX preset name::
Maybe the FX name or file name is not enough for you to decide which preset you want to load.
You can add a preset name as additional criteria.
+
.Samplers
====
If you have a sampler, you can load different ReaLearn presets depending on which sample library is loaded into your sampler.
Just add two links with the same FX file name (e.g. `Kontakt 5.dll`) but different preset names.
====

All above-mentioned fields support wildcards.
You can use `*` for matching zero or arbitrary many characters and `?` for matching exactly one arbitrary character.

.Matching both VST2 and VST3 plug-ins
====
Instead of relying on the original plug-in name you could match plug-ins with similar file names (e.g. VST2 and VST3 at once): `Pianoteq 7 STAGE.*` would match both `Pianoteq 7 STAGE.dll` (VST2) and `Pianoteq 7 STAGE.vst3` (VST3).
====

[[export-to-clipboard-button]]
== Export to clipboard button

Pressing the export button allows you to copy ReaLearn's settings to the clipboard so you can import them in another instance/unit or edit them in a link:https://en.wikipedia.org/wiki/Text_editor[text editor].
See xref:further-concepts/general.adoc#import-export[].

The following list only describes the ReaLearn-related menu entries. For the rest, see xref:helgobox::plug-in/user-interface/menu-bar.adoc#export-to-clipboard[] in the Helgobox Reference.

Export instance as JSON::
Copies a _complete_ dump of this xref:helgobox:ROOT:key-concepts.adoc#instance[] to the clipboard in JSON format.

Export main/controller compartment as JSON::
Copies a dump of the currently visible compartment to the clipboard.
It contains about the same data that a compartment preset would contain.

Export main/controller compartment as Lua::
Copies a dump of the currently visible compartment to the clipboard as Lua/Luau code.
This form of Lua/Luau export skips properties that correspond to ReaLearn's default values, resulting in a minimal result.
Perfect for pasting into a forum or programming ReaLearn with focus on only those properties that matter to you.

Export main/controller compartment as Lua (include default values)::
This Lua/Luau export includes even those properties that correspond to ReaLearn's default values, resulting in more text.
This gives you the perfect starting point if you want to extensively modify the current compartment (using the Luau programming language) or build a compartment from scratch, using even properties that you haven't touched yet in the user interface!

[[import-from-clipboard]]
== Import from clipboard button

Pressing the import button applies whatever ReaLearn dump is currently in the clipboard.
It supports JSON or Luau.
See xref:further-concepts/general.adoc#import-export[].

[#projection]
== Projection button

Click this button to enter ReaLearn's xref:further-concepts/unit.adoc#projection[] feature.
You can choose between the old browser-based projection (which is going to disappear at some point) and the new projection that is part of the xref:helgobox::app.adoc[] (but not yet fully functional).
Hopefully, the transition to the Helgobox App, including mobile versions of that App, will soon be finished.

== Help button (?)

See xref:helgobox::plug-in/user-interface/menu-bar.adoc#help[].
