 Music for Casablanca was composed by Max Steiner, who scored the film Gone with the Wind and also wrote the Perry Mason theme. As for the song, as time goes by, it had been part of the story from the original play. Steiner wanted to write his own composition to replace it.