How note-per-collision mapping works
The melody is held as an ordered queue of notes. When a collision occurs that qualifies as a trigger, the queue advances by one and that note is played. There is no timeline and no beat grid, which is why the result sounds tied to the motion rather than laid over it.
The consequence is that the physics is your sequencer. If collisions come faster, the song plays faster. If the run settles and impacts become sparse, the melody stretches out. This is a feature when the run is tuned for it and a problem when it is not, which is why setting gravity and arena size before attaching audio saves a lot of iteration.
You also control which collisions count. Restricting triggers to boundary contact gives a measured, deliberate performance. Allowing ball-to-ball contact in a spawner run produces something closer to a cascade, where the melody races through as the population climbs.