Astonishingly, in dribs and drabs, the music comes. Sometimes the contour of a phrase occurs to him before he has a hint of what the words themselves will be; sometimes the words call forth the cadence; sometimes the shade of a melody, having hovered for days on the edge of hearing, unfolds and blessedly reveals itself.
Yes! Like most things for Lurie, the music takes place only in his head. Even the horrific events he goes through in the novel don't significantly change his disconnection from reality—the reality in which he is no composer at all. "A crank" describes him perfectly.
What's odd about this is that David Lurie is not a composer but a bit of a crank. As so often in Coetzee, the beautiful bit is called into question by its context in the story.