Norns - params:hide not working properly

Hi again,
it’s me with another norns scripting question:

I want to have my script hide a params action after it’s used (a timer then counts down and sets it to visible again). Now my params:hide function is working fine when used as is in the redraw() function but in any other case I haven’t gotten it to work. See the following code for reference:

function init()
    -- Define default all steps on & add random mutes function to params page
  step_on = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}
  params:add{type="trigger", id="generate random mutes",action=function() gen_rnd_mutseq() end} 

function gen_rnd_mutseq()
  rand_allow = 0
  params:hide("generate random mutes")

So the print(rand_allow) at the bottom returns 0 when the I trigger the param from the edit menu. Why then doesn’t the params:hide() function hide the param?

Thanks in advance and cheers,

is it hidden if you toggle in/out of PLAY mode?

pretty sure the display tables are rebuilt with hide states when entering the menu. the hide command was not designed to be a dynamic UI element— it was more assumed that it’d be used within init


You’re right, when exiting and re-entering the edit menu the param is hidden so it seems to redraw at that point.

This however doesn’t happen when you just toggle the menu on and off by pressing key 1 which is how I use the params menu most of the time. So if I want to block a param from a users access I’ll have to look into other options to implement that. Thanks anyway!