A music box can be similar to an expression that uses a modulo. Both can be used to trigger repetitive events, and both run in circles: the end connects with the beginning.
In todays episode we use the modulo to trigger a regular event. We draw a circle with a fixed size of 50 pixels, but when the event is triggered, the circle will quickly grow to 80 pixels, and then slowly shrink back to 50. The idea is to simulate a heartbeat animation, but using a circle.
With an if() statement we check if the circle has grown enough. When it has grown enough, we reverse the direction of the growth. We don't want it to grow all over the screen. Now that the circle is shrinking, we need another if() statement to make sure it does not become too small. We also need to stop the shrinking at some point.
So we could say the circle has three behaviours: waiting with a size of 50 pixels, growing to a size of 80, and shrinking back to 50. Repeat.