View Single Post
Old 04-27-2018, 06:31 AM   #106
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Quote:
Originally Posted by snooks View Post
If you want to translate that to a string then you can store the note names in a table...
Code:
local note_names = { [1] = "A", [2] = "Bb"..... }

local selected_note = note_names[number]
You can also read from the Radio element's option array:

Code:
local val = GUI.Val("my_opt2")
local name = GUI.elms.my_opt2.optarray[val]
or

Code:
local name = GUI.elms.my_opt2.optarray[ GUI.Val("my_opt2") ]
I can look at making some of the :Val methods return both a number and the associated string.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote