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
Code Block | ||
---|---|---|
| ||
-- 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.