Maybe I just don’t get it, but when playing this pattern what I hear does not agree with the pattern on the right.
Am I overlooking something?
-- Emit notes with certain probability
return pattern {
unit = "1/8",
pulse = {1, 1, 1, 1}, -- Regular pattern
event = function(context)
if math.random() < 0.3 then -- 30% chance to emit
return "e4" elseif
math.random() > 0.6 then
return "e5"
end
end
}
I am thinking this is something doing with the random functions since the rendered result at the right only shows the first iteration of the generated result and it doesn’t update for every note trigger, but random is… random which is not predictable, so the rendered result can’t reflected that latest iteration.
Update: if you switch between the scripts and editor view, you could see the randomized result got updated.
Thanks, I see. Wondered already why the pattern does not change with each note trigger, but that explains it.
Still.. maybe it’s possible to autoupdate the pattern somehow?