Closed dndrks closed 2 years ago
rad, thank you @artfwo !! folded the changes in -- much clearer, appreciate your eyes + insights!!
https://github.com/monome/norns/pull/1573 might be another approach, it allows chaining on top of existing param actions. The example on the lines forum would be something like:
params:append_action("clock_tempo", function ()
-- Do some other stuff
-- or even here call do_some_other_stuff()
end)
@artfwo , finally got the brain space to make these proposed changes -- please lmk if there's anything i'm misunderstanding?
@artfwo , finally got the brain space to make these proposed changes -- please lmk if there's anything i'm misunderstanding?
approved, looks good!
during scripting, sometimes it's helpful to push changes to
PARAMETERS > CLOCK > tempo
across other parts of the script which work within the bounds of timing but perhaps don't useclock.sync
. currently, this requires re-patching the system tempo change handler inside of the script, as described here: https://llllllll.co/t/norns-scripting/14120/1010to avoid development pitfalls / weird states if a script doesn't reset the system handler, this PR adds
clock.tempo_change_handler
, which is tied into the system-definedclock_tempo
parameter action, and passes thebpm
andsource
into a user script, eg:the above will print
91 internal
(for example) and send the engine the correct timing value.the
clock.tempo_change_handler
function is reset during clock cleanup, so there's a clean slate in between scripts. please lmk if there's anything else to consider on this! tyty!