cool. (i agree with that assessment btw.)
anyways, if you want to just use “options” to change the display, how bout something like (untested!)
local grid_display_options = {"0", "90", "180", "270"}
params:add_option("grid_rotation", "Grid Rotation", grid_display_options)
params:set_action("grid_rotation", function(x)
local val = x - 1
grid_device:all(0)
grid_device:rotation(val)
grid_device:refresh()
end)
in other words (and sorry for all the noise,) i think the confusion boils down to 2 points:
- in the
options parameter type, the action function takes the numerical index of the selected option as its argument. (TIL: something funky happens if the options don’t have numerical indices.)
- the last argument to options creation is the default numerical index, and it is 1-based. (in this case, the default option is the first one, so the last parameter is not really needed.)
see this example in the mix menu page:
and - thanks for investigating! i learned things.