Created
March 31, 2022 15:45
-
-
Save HuangJiaLian/e860bdd39251fc1c1640586e7a09cd1b to your computer and use it in GitHub Desktop.
M to loop through modes of time signature
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
time_signatures = {0: [' 2 / 4', (2, 4)], 1: [' 3 / 4',(3 ,4)], 2: [' 4 / 4',(4, 4)], 3: [' 2 / 2',(2, 2)], | |
4: [' 6 / 8',(6, 8)], 5: [' 9 / 8',(9, 8)], 6: ['12/ 8',(12, 8)], | |
7: [' * / 4',(-1, 4)], 8: [' * / 2',(-1,2)], 9: [' * / 8',(-1,8)]} | |
def key_pressed(event): | |
global ON, ts_mode, time_signatures | |
if event.char == ' ': | |
ON = not ON | |
elif event.char == 't': | |
tap_estimate() | |
elif event.char =='m': | |
ts_mode.set((ts_mode.get() + 1)%len(time_signatures)) | |
elif event.char == 'q': | |
exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment