Created
October 13, 2023 18:27
-
-
Save sonocircuit/e0cfb7466b0e97b93bb1de7c1e8ec522 to your computer and use it in GitHub Desktop.
norns clock handler test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 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