Use the JavaScript TimingInfo object

The TimingInfo object contains timing information that describes the state of the host transport and the current musical tempo and meter. A TimingInfo object can be retrieved by calling GetTimingInfo().

TimingInfo properties

Print the beat position while the transport is running