How do I retrieve the label of an item detail?

I want to do the following:

With a List control, if have a selector called “ch 1” with parameter number 1001 where I select one of following list entries:

  • Value 0 (Oberheim)
  • Value 1 (Roland)
  • Value 2 (Korg)
  • Value 3 (Moog)

Depending on the choice I made, I want a variable, called channelName, to be updated, not with the list item values 0…3 but with the selected label of the item (f.i. ‘Roland’).

Can I make this happen? How?

1 Like

I don’t think you can (easily? at all?) pull this value from inside the preset yet. What I would do is create a separate table in the LUA and use the value number as an index to look up the text you want.

synthArray = {"Oberheim", "Roland", "Korg", "Roland"}
channelName = synthArray[value]

Of course if you have a huge array (or many different arrays) it becomes tedious to manage it all

1 Like

As it was asked several times already, I will add a set of Lua functions to work with overlay lists. For now, @oldgearguy is the only way to go…

already implemented

The issue with it is if people want to adopt someone else’s preset, they’ll have to dive in the script, which is a bit harder than just updating an item list.

There is another issue with the item lists: lua does not retrieve in a value function the value assigned to the selected item, but only its place in the order of the list. So a list with values such as {-24,-12,-7,-5,0,5,7,12,24} is read as a list with values {0,1,2,3,4,5,6,7,8}

1 Like

Yes, I ran into this yesterday. I’ve assigned values to my list items, but in my LUA function, the value parameter is actually set to the index of the selected item, not it’s actual value.