Complex sentence: Many modern rides are programmed to play multiple melodies with the music changing each time the ride is used, the logic being to prolong the interest of the child on the ride.
Split into simpler sentences: Many modern rides are programmed to play multiple melodies, alternating music each time the ride is used. The logic behind this is to prolong the interest of the child on the ride.