I think there’s some problems with formatter functions. I’m trying right now to update my presets to 5.03 firmwire version, and most of my formatters not working at all.
Every formatter on my list items not working, when on 4.1.4 firmwire everything was working perfect. Some of controls have defined text overlays with dynamic range edit, and this dynamic range define what string should be exposed on UI.
That was my orginal function, what works on older version of firmwire.
function formatRhythmSelect(valueId, value)
local intVal = math.floor(tonumber(value) or 0)
-- 1. Obsługa nienaruszonego zakresu fabrycznego (0-13)
if intVal <= 13 then
return FIXED_BANK_NAMES[intVal] or "---"
end
-- 2. Logika dynamicznego wyliczania nazw dla kart EXP (14-65)
local expIndex = intVal - 13 -- Uzyskujemy wirtualne przesunięcie (1, 2, 3...)
local currentSum = 0
if type(JV.system.detectedCards) == "table" then
for i = 1, 8 do
local cardId = JV.system.detectedCards[i]
if cardId then
local cardDef = EXP_CARD_RHYTHM_MAP[cardId]
if cardDef and cardDef.sets > 0 then
-- Sprawdzamy, czy szukany bank leży w obrębie tej karty
if expIndex <= (currentSum + cardDef.sets) then
local localBankNum = expIndex - currentSum
if cardDef.sets == 1 then
return cardDef.name
else
return string.format("%s %02d", cardDef.name, localBankNum)
end
end
currentSum = currentSum + cardDef.sets
end
end
end
end
-- Zwrot w przypadku braku fizycznej karty w slocie (Zgodnie z planem do testów <<No Media>>)
return string.format("EXP [B:%02d]", expIndex)
end
I was trying to update it for new firmwire where i changed using two arguments, to one. Debugger seems like everything is fine in that function, when i set propertly value, i have propertly feedback from debugger, but on electra nothing change.
function formatRhythmSelect(value)
local raw = value:getValue()
local intVal = math.floor(tonumber(raw) or 0)
local result
if intVal <= 13 then
result = FIXED_BANK_NAMES\[intVal\] or "---"
else
local expIndex = intVal - 13
local currentSum = 0
local found = false
if type(JV.system.detectedCards) == "table" then
for i = 1, 8 do
local cardId = JV.system.detectedCards\[i\]
if cardId then
local cardDef = EXP_CARD_RHYTHM_MAP\[cardId\]
if cardDef and cardDef.sets > 0 then
if expIndex <= (currentSum + cardDef.sets) then
local localBankNum = expIndex - currentSum
if cardDef.sets == 1 then
result = cardDef.name
else
result = string.format("%s %02d", cardDef.name, localBankNum)
end
found = true
break
end
currentSum = currentSum + cardDef.sets
end
end
end
end
if not found then
result = string.format("EXP \[B:%02d\]", expIndex)
end
end
print("\[FMT\] raw=" .. tostring(raw) .. " -> '" .. tostring(result) .. "'")
return result
end
Also much simpler format functions, for dials, are working fully propertly:
function efxFormat1(v)
if isParsingSysex or isEngineRefreshing or isRefresingEFX then return "---" end
return efxParamFormat(v, 1)
end
I’ve nothing changed in json code between versions of presets, on older presets every formatter for list objects stop working propertly. On some controls i have defined text overlays, on some totally not, but i need to set range, for working, even there’s no text in them, so json automatically make “value”: and “label”: in control structure, i’m afraid it will always overwrite formatter labels, but i’m not sure about that. I think, there’s something wrong with that, and i have a lot of work with other problems, so i decided to write this post.
Anyway, working on new firmwire is much more pleasant and smoother, much added options are honey for me. I’m really satisfied with that!