Skip to content

Instantly share code, notes, and snippets.

@sonocircuit
Created October 13, 2023 18:27
Show Gist options
  • Select an option

  • Save sonocircuit/e0cfb7466b0e97b93bb1de7c1e8ec522 to your computer and use it in GitHub Desktop.

Select an option

Save sonocircuit/e0cfb7466b0e97b93bb1de7c1e8ec522 to your computer and use it in GitHub Desktop.
norns clock handler test
-- norns clock handler test
--
-- when clock.get_beat_sec() is called via tempo_change_handler the value is off by 1bpm
function clock.tempo_change_handler(tempo)
print("params get bpm: "..params:get("clock_tempo")) -- tempo set in params
print("clock handler bpm: "..tempo) -- the correct tempo is passed as arg
print("calculated beat sec: "..60/tempo)
print("clock get beat sec: "..clock.get_beat_sec())
end
function key(n, z)
if z == 1 then
print(clock.get_beat_sec()) -- when this is called the correct beat_sec value is returned
end
end
function init()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment