Is there a way to lower the latency from a knob action to the readout of the value on the display?
VSN1 Display
Replies (33)
Are you using the default configuration of the LCD?
Here's what I'm using:
if f > 0 then
f = f - 1
local a, xo =
map_saturate(v[1], v[2], v[3], 0.1, 1),
#tostring(v[1]) / 2 * s / 2 - #tostring(v[1]) - s // 32,
lcd:draw_area_filled(10, 10, 310, 230, c[1])
lcd:draw_rectangle_rounded(xc - p // 1 - 1, yc - p // 1 - 1, xc + p // 1 + 1, yc + p // 1 + 1, s, c[2])
lcd:draw_rectangle_rounded_filled(xc - p * a // 1, yc - p * a // 1, xc + p * a // 1, yc + p * a // 1, s, c[3])
lcd:draw_text_fast(v[1], xc - xo, yc + s, s / 2, c[2])
local xn = (#ids * (s / 2)) / 2 - s // 32
lcd:draw_text_fast(ids, xc - xn, yc - 1.5 * s, s / 2, c[2])
lcd:draw_swap()
end
I think it's something basic that I grabbed from somewhere in here
does sharing the config like this work?
grid-editor://?config-link=78xpqhubjl5yAWZZs8jE
I see, this looks like the basic configuration to me.
What you could do to make it faster to make the rendered visualization simpler.
Right now each refresh of the screen makes 5 draw calls, 2 of which are pretty slow.
This means if you are okay with reducing the visual flair of the visualization, simpler visuals can potentially reduce the delay.
It would be pretty nice if we could measure the delay somehow.
So for example using the following on the Draw Event should be one of the fastest (since there is no visual whatsoever).
if f > 0 then
f = f - 1
local a, xo =
map_saturate(v[1], v[2], v[3], 0.1, 1),
#tostring(v[1]) / 2 * s / 2 - #tostring(v[1]) - s // 32,
lcd:draw_area_filled(10, 10, 310, 230, c[1])
lcd:draw_text_fast(v[1], xc - xo, yc + s, s / 2, c[2])
local xn = (#ids * (s / 2)) / 2 - s // 32
lcd:draw_text_fast(ids, xc - xn, yc - 1.5 * s, s / 2, c[2])
lcd:draw_swap()
endYou could go one step further and add a simpler visual like this:
if f > 0 then
f = f - 1
local a, xo = map_saturate(v[1], v[2], v[3], 0.1, 1), #tostring(v[1]) / 2 * s / 2 - #tostring(v[1]) - s // 32
lcd:draw_area_filled(10, 10, 310, 230, c[1])
lcd:draw_area_filled(xc - p // 1, yc - p * a // 1, xc + p // 1, yc + p * a // 1, c[3])
lcd:draw_text_fast(v[1], xc - xo, yc + s, s / 2, c[2])
local xn = (#ids * (s / 2)) / 2 - s // 32
lcd:draw_text_fast(ids, xc - xn, yc - 1.5 * s, s / 2, c[2])
lcd:draw_swap()
endBut truth be told, I don't really feel the difference here.
Keep in mind that the screen runs at a constant 20 fps, which means that there is an inherent 50ms frametime here.
Just trying to see if I can get something that updates fast enough for me to not overshoot volume level if I’m looking at the display. It’s a champagne problem because I can also just listen or look at the floating monitor control window on my computer but on quieter parts I’ve overshot and been slammed with SPL a bit higher than I’d like when the content gets louder
I don’t think the 50ms added from the display should be too big of an issue but I haven’t tested the ones you shared yet
oh yeah this one is great
just tried it out
nice! glad to hear it
rounding is an expensive function, we used it for the visual because it looks nicer
but draw area will always be the fastest one
Cool, I didn’t particularly care for rounds anyways. Still gotta figure out the other display elements based on the mockup I did a while ago but if it comes at the expense of latency I’ll keep it simple
also my replacement knob just came in, this thing is nearing final form ❤️
In terms of speed, the fastest ones are draw_area_filled and draw_text_fast.
Polygons are probably the slowest especially if they are filled, rounding comes after that probably and then raster text in the form of draw_text.
So pick your poison I guess 😄
sorry for the basic question but how do I make the value readout larger if I decide to do the one that only has text?
It would probably be too big as the numbers are all powers of 2 for text_fast
But you can change the penultimate parameter of the first text_fast line to s from s/2
That will double it
that kind of shifts it to the bottom and a little off center but I'm not sure how to fix that
I used ChatGPT to get this:
if f > 0 then f = f - 1 local big_scale = s local small_scale = s / 2 local value_str = tostring(v[1]) local text_w = #value_str * big_scale / 2 local text_h = big_scale lcd:draw_area_filled(10, 10, 310, 230, c[1]) lcd:draw_text_fast(value_str, xc - text_w, yc, big_scale, c[2]) local xn = (#ids * small_scale) / 2 lcd:draw_text_fast(ids, xc - xn, yc - big_scale * 1.2, small_scale, c[2]) lcd:draw_swap() end
Yeah, looks good!
View on Discord
This post is from the Intech Studio Discord community.
