Page tree
Skip to end of metadata
Go to start of metadata

In most situations, simple menus are well suited to select a parameter value from a list of strings, for example, a filter type selector that contains various filter types. If the number of available values gets too high, it can be helpful to create substructures inside the menu, for a better overview and usability. To implement such a nested menu, you need to deliver the menu entries as a stringlist parameter with strings in the following notation:

/Folder/Subfolder/../Menu Entry

Please see the example below for details.

This example shows how to build multi-level menus using the generic graphics of the operating system. If you want to create menus with customized graphical elements, please refer to Custom Multi-Level Menus and Custom Popup Menus.

On this page:

Related pages:

Prerequisites

  • A macro page with a menu, text, and label control (optionally combined as a template)
  • A MIDI or UI script that provides parameter definitons and functions

Defining parameters for the menu

The following code example shows how to create the menu entries and the resulting display string.

Example

 -- Create tables for menu entry strings and display output strings
entry_and_output = {
	{ "/Folder1/Entry1", "Value 1" },
	{ "/Folder1/Entry2", "Value 2" },
	{ "/Folder2/Entry1", "Value 3" },
	{ "/Folder2/Entry2", "Value 4" },
}
entries = {}
outputs = {}
for i,v in ipairs(entry_and_output) do
 entries[i] = v[1]
 outputs[i] = v[2]
end
-- Define the parameter "Entry" to be connected to a menu control and the parameter "Output" to display the selected menu entry
defineParameter("Entry", nil, 1, entries, function() Output = Entry end)
defineParameter("Output", nil, 1, outputs)

In the example VST preset below this was implemented as UI script. The UI script is attached to the macro page.

The template parameters Text Output and Menu Entries must be connected to the parameters Output and Entry of the UI script.

In this example the Output parameter is not connected to a physical parameter. To set the value of the desired parameter, the Output parameter must be connected to the respective parameter in the program.

Example VST Preset

3 Comments

  1. Sabine Pfeifer New How-To for 6.3 release, please proof-read. Thx

  2. Michael Ruf: proofread done. Ich hab das Example Preset oben im Text schon verlinkt, weil Matthias das auch immer so gemacht hatte. Vielleicht magst du dann den Link unten rausschmeißen? Und oben bei den "Related Pages" könnte man noch "Creating Custom Popup Menus" verlinken.

  3. Sabine Pfeifer

    bei Matthias Kapiteln waren die Beispiel Presets auch zwei mal velinkt, oben und unten. Mir ist das persönlich egal, sollten wir nur einheitlich machen.