17To prepare timely motor actions we constantly predict future events. Regularly repeating 18 events are often perceived as a rhythm to which we can readily synchronize our movements, 19 just as in dancing to music. However, the neuronal mechanisms underlying the capacity to 20 encode and maintain rhythms are not understood. We trained nonhuman primates to maintain 21 the rhythm of a visual metronome of different tempos and then we recorded neural activity in 22 the supplementary motor area (SMA). SMA exhibited rhythmic bursts of gamma band (30-40 23 Hz) reflecting an internal tempo that matched the extinguished visual metronome. Moreover, 24 gamma amplitude increased throughout the trial and provided an estimate of total elapsed 25 time. Notably, the timing and amplitude of gamma bursts reflected systematic timing biases 26 and errors in the behavioral responses. Our results indicate that premotor areas use dynamic 27 motor plans to encode a metronome for rhythms and a stopwatch for total elapsed time.28 65 appeared on one side, switched to the other, and the back to the initial location. This 66 alternating stimulus defined three entrainment intervals of an isochronous rhythm. On each 67 trial the interval duration was pseudo-randomly chosen to be 500, 750, or 1000 ms. In this 68 manner, animals were presented with a visual metronome whose tempo was changed on a 69 trial-by-trial basis ( Figure 1A). 70 71 5 72 Figure 1. The visual metronome task.73 (A) Rhythms of different tempos were defined by a left-right alternating visual stimulus that appeared on a touch 74 screen. While keeping eye and hand fixation, subjects first observed three isochronous entrainment intervals with 75 duration of either 500, 750, or 1000 ms (pseudo-randomly selected on each trial). After the last entrainment 76 interval, the visual stimulus disappeared initiating the maintenance intervals, during which the subjects had to 77 keep track of the stimulus' virtual location (left of right, broken lines). A go-cue (extinction of the hand fixation) at 78 6 the middle of one of the four maintenance intervals prompted the subjects to reach towards the estimated location 79 of the stimulus. It is important to note that this was not an interception task because the left-right switching 80 stopped at the time of the go-cue. Monkeys received a liquid reward when correctly indicating the stimulus 81 location. 82 (B) The proportion of correct responses is plotted as a function of elapsed time during the maintenance intervals.83 Colors indicate the performance for the three tempos (500, 750, 1000 ms). Performance was significantly above 84 chance (broken line at p=0.5; z-test p<0.001; n=131 sessions; median ± I.Q.R. over sessions). The decrease in 85 performance as a function of elapsed time is expected from variability of the subjects' internal timing in the 86 absence of the external visual rhythm. This drop in performance was captured by a model of timing subject to 87 scalar variability (continuous lines).88 (C) Reaction times to th...