Note: the rhythm depends on the gtk timeout_add function to play the rhythm, so it is not very precise.