i need to use select() on a bool because the module pygame.midi lets you know when a midi message is ready only through the function Input.poll() that returns a bool.
if i check this value in the simple way, i do busy waiting and my cpu works at 100% all the time.
is there a way to use the select() or similar functions to wait for a variable to change its value in a context without automatic event raising?
(i don't strictly need to live eventless, indeed i would love to use them, but i can't see midi events anywhere in the package..)
When developing games you usually do everything in a main loop. If you want e.g. 50 fps, then you want to go through this loop 50x per second. If you assume that you are not doing anything time consuming, then you can sleep for 20ms at the end of every iteration.
So I think that's the reason why only poll is available, you are supposed to check whether the midi is loaded in your loop. If it is, then you can do something with it, otherwise you would continue rendering or doing something else. Generally while creating games and apps that should have consistent fps, you don't want to wait for some event.
python - select() on boolean variable