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.
3 Comments
Michael Ruf
Sabine Pfeifer New How-To for 6.3 release, please proof-read. Thx
Sabine Pfeifer
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.
Michael Ruf
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.