def release_keys(): # clear all the still pressed keys after script finishes k.ReleaseKey(k.STRUM) k.ReleaseKey(k.STAR) for n in NOTES: k.ReleaseKey(n) time.sleep(0.1)
def notes_worker(): prev_notes, notes = note_q.get() for key in prev_notes: k.ReleaseKey(key) for key in notes: k.PressKey(key) k.PressKey(k.STRUM) time.sleep(0.025) # doesn't block other threads! k.ReleaseKey(k.STRUM) time.sleep(0.025) note_q.task_done()
def notes_worker(): prev_notes = [] while True: notes = note_q.get() for key in prev_notes: k.ReleaseKey(key) for key in notes: k.PressKey(key) k.PressKey(k.STRUM) time.sleep(0.017) k.ReleaseKey(k.STRUM) prev_notes = notes
def release_keys(): k.ReleaseKey(k.STRUM) k.ReleaseKey(k.STAR) for n in NOTES: k.ReleaseKey(n) time.sleep(0.1)