View Single Post
Old 04-27-2018, 06:31 AM   #106
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,647
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.
Lokasenna is online now   Reply With Quote