Skip to content

Events with operation "Random" can stop the clock from progressing #22

@meeeearcus

Description

@meeeearcus

Hi, I encountered a small setback while setting a random event for an NB voice parameter, which can cause the clock to stop. I thought I would report it rather than pass it by. I was able to produce a stack trace for you, and will show my naivety in a humble workaround that got me going again.

I wanted to thank you so much for making my favorite Norns script on the lines forum, but didn't expect this as my first contact... I didn't want to pollute your lines thread with a bug report, but you can get to me there as the user "carcus" if you want me to provide any more data. I've attached a pset for your convenience in case you wanted to reproduce it.

debug-pset.zip

Maiden stack trace:

starting
syncing to link_quantum
playing
lua: 
/home/we/norns/lua/core/clock.lua:68: /home/we/dust/code/dreamsequence/dreamsequence.lua:3676: bad argument #1 to 'random' (number has no integer representation)
stack traceback:
	[C]: in function 'error'
	/home/we/norns/lua/core/clock.lua:68: in function 'core/clock.resume'

Snip of event table where triggered:

-- Table: {1090}
{
   ["limit_min"]=0.28,
   ["id"]="nb_w/ramp",
   ["operation"]="Random",
   ["probability"]=100,
   ["limit_max"]=1,
   ["order"]=2,
   ["t"]=3,
   ["limit"]="On",
   ["event_type"]="param",
   ["value_type"]="continuous",
},

Humble workaround on lines 3674/3675, where I tried to make sure min/max was an integer. It seems to function but you could probably do much better.

limit_min = math.floor((limit_min or 0) * 100)
limit_max = math.ceil((limit_max or 1) * 100)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions