An algorithm, named TransProse, turns literature into music. The program, developed by Hannah Davis at New York University and Saif Mohammad at the National Research Council Canada, translates the basic emotions of the novel into a musical piece. A research paper on the algorithm can be found here in the journal Computation and Language.
The algorithm is explained here
on Medium. TransProse divides a novel into four parts, the beginning, early middle, late middle and the ending. TransProse then uses a set of statistics to describe the way different emotions rise and fall in each section. These data is the used to create the background music for each section.
You can listen to more of the novels on musicfromtext.com