Closed ken-tn closed 3 years ago
why did you close this PR?
i messed up some code, it's fixed now
I like most of these changes, especially using the "import keyboard" over the horrible boilerplate I was using before. I'm mixed about opening a new thread for every keypress, but it would solve most of the concurrency issues I remember having.
There still seems to be some issues. Playing "bach.mid" included in the directory. Some notes are generating a 2 second wait that shouldn't be.
Playing "CorridorsOfTime.mid", notes that are pressed in succession seem to not work due to the code meant to hold notes down instead of instantly releasing them.
keyboard.press(strLetter)
keyboard.call_later(keyboard.release, args=(strLetter), delay=t)
releasing the key earlier fixes this:
keyboard.call_later(keyboard.release, args=(strLetter), delay=t*.5)
Another an error that prevents certain notes from playing was also made on playSong.py:40 which needs to be keyboard.call_later(keyboard.release, args=(strLetter.lower()), delay=t)
instead of
keyboard.call_later(keyboard.release, args=(strLetter), delay=t)
With the above 2 changes, "CorridorsOfTime.mid" plays properly (after a manual tempo set in song.txt)
that should be most of the bugs gone might be some small things left though
uses import keyboard instead of pyhook uses import threading adds pausing, rewind, skip (del, end, home) use index instead of time dynamic tempo
not tested on linux/mac