[Python] How can I do a precise metronome?

Discussão em 'Python' iniciado por Stack, Agosto 27, 2025.

  1. Stack

    Stack Membro Participativo

    I tried to do a very simple metronome that is working at 30 bpm:

    While True:
    winsound.Beep(1000, 200)
    time.sleep(2 - 0.2)


    Then, I turned on a metronome app on my phone together with the beep in the computer, and it became less precise as the time went on. Is there another way to do the "time.sleep()"? Is it even the "time.sleep()" guilt?

    Continue reading...

Compartilhe esta Página