Synchronizing Pong to music with constrained optimization

The author explores creating a music visualizer inspired by the classic game pong, where the ball bounces to the beat of a song. By altering the game’s physics and retaining key rules, such as the contact point of the ball on the paddle determining its angle of reflection, the author delves into maximizing screen utilization using an optimization approach. The process involves defining parameters, constraints, and objectives to solve the problem. The solution, implemented using CVXPY, provides optimal paddle positions for hitting the ball, resulting in a visually appealing visualization. The author encourages further exploration of constrained optimization in creating unique visualizers.

https://victortao.substack.com/p/song-pong

To top