Is there a special term for composing/melodizing a fictional song?
Some novels have songs with made-up lyrics written by the authors; and sometimes, music is composed for those songs in real life.
For example, there is a fictional song called The Bear and the Maiden Fair from the novel A Song of Ice and Fire by George R.R. Martin. Later, for the TV show Game of Thrones, they composed music for the song.
The producers of Game of Thrones enlisted Brooklyn indie rock band The Hold Steady to record a version of the song, with music composed by Ramin Djawadi. Their cover of the song plays during the end credits for episode 3 of Season 3, "Walk of Punishment".
I did some research and couldn't find a term for what I am looking for; but I found something different (almost vice versa) but related:
In Elmegreen’s novel “Reveille,” written as his thesis project, the thoughts and emotions of the main character, a musician named Spencer, and others sometimes emerge as musical notes rather than words.
It is described as writing the melody of a novel and composing the soundtrack of silent reading.