In no particular order, books (of all genres, except for artist biographies)* that I love where music plays an important role:
Thomas Mann: Dr. Faustus
Mann's gut-punch take on Faustian bargains; in this instance, by a composer who pays the price of syphilis-induced madness for a few years of success -- and whose deal with the devil simultaneously symbolizes that of the German people with Adolf Hitler.
Peter Shaffer: Amadeus
The play that reached an even wider audience when adapted for the screen by Miloš Forman: all about the punk rock genius of classical music and his rival, the "patron saint of mediocrity", Antonio Salieri.
Martin Goldsmith: The Inextinguishable Symphony
Goldsmith's biography of his musician parents (and their families), who met in Nazi Germany and, after much hardship, eventually managed to emigrate to the U.S. and establish a new life for themselves and their children there.
Colum McCann: Dancer
McCann's novelized biography of Rudolf Nureyev -- from the time before McCann moved to the U.S. and went all politically correct. Lyrical, muscular and visually powerful prose to match the art of its protagonist.
Sharon Maas: Speech of Angels
The story of a musically gifted orphan who is taken to Europe from the streets of Bombay and has to find out who she is (Indian, European or ...?) and what exactly music means to her life.
Ellis Peters: The Sanctuary Sparrow
A young musician takes sanctuary in the abbey of St. Peter and St. Paul after having falsely been accused of murder, and it is up to Brother Cadfael to find out what really happened.
Peter Grainger: An Accidental Death
Music may not exactly be central to the mystery, but blues music is definitely key to the protagonist's (D.C. Smith's) personality.
Anne Rice: Cry to Heaven and Violin
Cry to Heaven, a novel set in the world of the baroque castrati, just might be the best thing Rice ever wrote (when she was still listening to her editors). Violin was the last book of hers that I liked; it occasionally borders on the melodramatic, but the translation of the (autobiographically-based) mental anguish of losing a loved one into music is by and large very well done.
... and Ngaio Marsh's mysteries set either in the world of opera or otherwise involving (performances set to) music:
* Overture to Death
* Death and the Dancing Footman
* Off With His Head (aka Death of a Fool)
* Photo Finish
Honorary mention to two movies (and screenplays) focusing on music:
* Jane Campion: Piano
* Andrée Corbiau: Farinelli
... and to the movies which I discovered and / or love twice as much solely because Mark Knopfler (fomerly of Dire Straits) wrote the score:
* Local Hero
* The Princess Bride
* If I'd include artist and composer biographies, this list would be endless.
(Task: Music is an important part of a Kwanzaa celebration. Which is / are your favorite book(s) where music plays an important role in the plot?)