TransPose: Translating Literature into Music.
From the website:
TransProse is the first iteration of a program that finds different emotions throughout different novels and programmatically creates music based on those values.
TransProse reads in the text of a novel and determines densities of eight different emotions (joy, sadness, anger, disgust, anticipation, surprise, trust, and fear) and two different states (positive or negative) throughout the novel. The musical piece chronologically follows the novel (broken up into beginning, early middle, late middle, and end parts, with four measures representing each of these sections). It uses the emotion density data to determine the tempo, key, notes, octaves, etc. for the piece depending on different rules and parameters.
And here's an example!