Visual metronome stops after 10 beats

does this work properly?

Link: [Gig] Custom metronome with visual feedback