Count beats and bars.