Hi,
The function mem(0,taptempo.pulse(onbeat(music.1.beat))) detects the tempo of the music and generates a pulse in sync with the detected beats. It puts the result in a memory bin to be used by other sources.
The taptempo needs to detect a few beats before it can properly generate a pulse. That's the 3-4 beats delay you see.
The other source (at the bottom) using the pulse has this formula: if(recall(0), randint(0, 3) * 5, last). This is used to change the hue a little each time there's a beat.
You can also get rid of the taptempo detection and use the instant beats directly by using: mem(0,onbeat(music.1.beat)) instead of mem(0,taptempo.pulse(onbeat(music.1.beat))). The taptempo.pulse function tries to detect the tempo in order to generate regular pulses. But for some music styles with irregular beats, this may not be what you want.