who wrote the music for the song purple rain