I'm trying to create a python program that measures trill velocity of pianists. Trills are a musical ornament consisting of a rapid alternation between two adjacent keys on the piano, so I think this can be simulated with two keys of the pc keyboard, like "K" and "O". Keys would be pressed at a frequency of 10 beats per second or higher.
Is there a way to register in Python the time when a keystroke happens?
Once obtained that data, I could use it to make statistics, etc.