Hi,
preset.getGroups() gives back a table. When I try to get the slot number of the last group in the table then I get “nil” !
pg = preset.getGroups()
print(pg[#pg]:getSlot())
Dieter
Hi,
preset.getGroups() gives back a table. When I try to get the slot number of the last group in the table then I get “nil” !
pg = preset.getGroups()
print(pg[#pg]:getSlot())
Dieter
Did you create pg is a table first?
pg = {}
Not before, but that changes nothing.
Testing with other presets it works correct.
May be Martin can have a look at my personal preset “Clone of Prophet-5 V” ? Relevant code is on top of LUA script.
Dieter
I reviewed the preset. There is a catch there. getSlot() expects controls and groups placed at standard grid slots (ie. x, y, width, height defined by the layout editor). your scrip changes the position of the groups:
ctrl:setBounds({w[1]-3, w[2], w[3]+9, w[4]})
it is moved by Lua off the standard slot grid. Similar change is applied to dials.