A new mathematical model can predict how the brain reacts when learning a rhythmic beat. The model shows how a neural network can act as a 'neural metronome' by estimating time intervals between beats within tens of milliseconds. The metronome relies on gamma oscillations to keep track of time.