Runtime formatter change

I’m looking to emulate the Roland S-1’s “Shift” workflow. When a user holds down a Shift button, turning a knob controls a secondary parameter.

The issue is the primary and secondary parameters often use completely different value scales and string formats.

Is there a way to dynamically swap a knob’s formatter, or push a custom string format/overlay via a script when a Shift button is enabled/on?

Appreciate any insights

For sure, but it takes some structure. Check out for instance the last version of the Micro Q I made, and have a look at the effects section: any time you change the effect, controls appear and disappear, change places, get different colors and names, have a different range and get a different overlay assigned. You could do similar by get 2 states, one with and one without shift.

Many thanks will take a look - much appreciated

Many thanks to NewIgnis for his code assist.

Sharing sample code here - always seems simpler after you step away for a bit;

-- dB Overlay

local dbOverlay = {}

for value = 0, 127 do
    dbOverlay[#dbOverlay + 1] = {
        value = value,
        label = string.format("%d dB", value - 64)
    }
end
overlays.create(OVERLAY_DB, dbOverlay)

-- Waveform Overlay 

local waveOverlay = {
    { value=0, label="Sine" },
    { value=1, label="Triangle" },
    { value=2, label="Peak" },
    { value=3, label="Random" },
    { value=4, label="Ramp" },
    { value=5, label="Square" }
}
overlays.create(OVERLAY_WAVEFORM, waveOverlay)

…then apply as needed. The string.format was tripping me up.

1 Like