Hi. I have 3 fader controls in a preset that have a dual function depending on the value of a particular list control. Specifically, I need to change the range of the 3 faders and also display a different set of labels. I have the setRange part is working nicely. But can’t get the alternative labels to display. I thought this would work, and the code runs without error, but the alternative labels do not display. Here is my code. I wonder if anyone can see what I am doing wrong. I’m thinking perhaps the pot ref# is not the overlay Id as I am assuming.
Thanks
function showNotes() -- Range and Overlay for the Delay and LFO4 fader's note duration options when midi synced
local syncMode = parameterMap.get(deviceId,PT_NRPN,764) -- Midi sync mode
local control1 = controls.get (110) -- Delay1 level fader
local ctrlValue1 = control1:getValue ("value")
local control2 = controls.get (114) -- Delay2 level fader
local ctrlValue2 = control2:getValue ("value")
local control3 = controls.get (74) -- LFO4 frequency fader
local ctrlValue3 = control3:getValue ("value")
-- a list of labels for the 10 note duration options when Delay1 or Delay 1+2 are midi synced
local NoteDurationList1 = {
{ value = 0, label = "1/16D" }, { value = 1, label = "1/8D" }, { value = 2, label = "1/4D" },
{ value = 3, label = "1/16T" }, { value = 4, label = "1/8T" }, { value = 5, label = "1/4T" },
{ value = 6, label = "1/16" }, { value = 7, label = "1/8" }, { value = 8, label = "1/4" }, { value = 9, label = "1/2" }
}
-- a list of labels for the 12 note duration options when LFO4 is midi synced
local NoteDurationList2 = {
{ value = 1, label = "1/1" }, { value = 2, label = "1/2" }, { value = 3, label = "1/4" },
{ value = 4, label = "1/8" }, { value = 5, label = "1/16" }, { value = 6, label = "1/32" },
{ value = 7, label = "1/4T" }, { value = 8, label = "1/8T" }, { value = 9, label = "1/16T" },
{ value = 10, label = "1/4D" }, { value = 11, label = "1/8D" }, { value = 12, label = "1/16D" },
}
if syncMode == (2 or 6) then -- midi synced Delay1
ctrlValue1:setRange (0, 9,0, true)
overlays.create(110, NoteDurationList1)
elseif syncMode == (3 or 7) then -- midi synced Delay1+2
ctrlValue1:setRange (0, 9,0, true)
ctrlValue2:setRange (0, 9,0, true)
overlays.create(110, NoteDurationList1)
overlays.create(114, NoteDurationList1)
elseif syncMode == (1 or 5) then -- midi synced LFO4
ctrlValue3:setRange (1, 12,1, true)
overlays.create(74, NoteDurationList2)
else -- not midi synced
ctrlValue1:setRange (0, 127,0, true)
ctrlValue2:setRange (0, 127,0, true)
ctrlValue3:setRange (1, 127,1, true)
end
end