Hello there..
I’m trying to build an arpeggiator to program my own arps for my Roland SH-201.
The arpeggiator consists of uiLabels which you can change on doubleclick with a popup menu. Schematically:
[X][ ][ ][X] [X][Tie][Tie][Tie] [X][Tie][Tie][Tie]
Essentially it consists of 16 rows of 32 uiLabels.
Every [] is a uiLabel named 1-1, 1-2, 1-3 and so on. (or 2-1, 2-2 for 2nd row)
x = note selected. Empty = empty. Tie = Tied Note, extends note
Most of the menu is working except for one small thing. I want to be able to delete all Tied notes until the next X. For instance: I deselect the X in the second bar. It should delete the Tie’s that follow until the next X. Because you cannot have Tied notes without a selected note. But it should not delete the Ties in the Third bar. Schematically:
[X][ ][ ][X] [][][][] [X][Tie][Tie][Tie]
(sC = L(comp:getOwner():getName())
(rowNr is componentGroupName of sC .. just 1 2 3 and so on)
(labelNr is componentVisibleName of sC .. just 1 2 3 and so on)
this deletes everything in selected row:
row = string.format("%s-", rowNr)
for i = 1,32 do
panel:getComponent(row..i):setText("")
end
How do I iterate over the uiLabels until an X is met which breaks the loop? Because:
i = tonumber(labelNr)
while i <= 31 do
i = i + 1
console("I = "..i)
console(row..i)
if panel:getComponent(row..i):getProperty("uiLabelText") == "Tie" then
panel:getComponent(row..i):setText("")
elseif panel:getComponent(row..i):getProperty("uiLabelText") == "X" then
break
end
end
results in a nil value for the first if statement..
without the if statement console prints 1-1, 1-2 1-3 and so on.. so why doesn’t it run over all the labels to see if it’s a Tie or X ?
I’m lost.. :-/
Thnx in advance..
I wish i could send the panel but i don’t know which file to send..