A rhapsody was a job before it was a mood. In ancient Greece, a rhapsode was a professional performer who recited Homer and other poets in public, often for large fees.
The Greek word rhapsōidos joins rhaptein, "to sew or stitch," with ōidē, "song," the same word that gave English ode. So the rhapsode was a stitcher of songs. Scholars disagree on what exactly was being stitched. One reading is that the poet sewed verse onto verse in long, unbroken epic lines. Another, noted by the classicist William Mure in 1850, is that a rhapsody was first a section of an epic handed to one performer in a relay.
The ancients had a rival theory too. Some linked the word to rhabdos, the staff a singer leaned on, making the rhapsode "a singer with a staff." Britannica says modern scholars prefer the stitching explanation.
Rhapsodes were a fixture of Athenian life. At some point in the 6th or 5th century BC, their performances became a regular part of the city's Panathenaic festival. Plato's dialogue Ion is named after a famous one, and it gives a vivid picture of their dramatic, showy recitals.
English borrowed the word in the 1540s, through Latin and French, for an epic poem or one book of it. It soon loosened. In the 16th and 17th centuries a rhapsody could be any rambling, miscellaneous piece of writing. By the 1630s it meant gushing, over-the-top talk, a sense that survives when someone "rhapsodizes" about a meal.
Music took the name last. Christian Schubart published Musicalische Rhapsodien, mostly songs with keyboard accompaniment, in 1786. Václav Jan Tomášek's piano rhapsodies began appearing in 1810, the first solo piano pieces with the title. Franz Liszt wrote the Hungarian Rhapsodies and started the fashion for orchestral rhapsodies. A musical rhapsody is a single movement, episodic and free in structure, with sharp swings of mood.
That loose, patchwork shape is the old meaning in a new medium. When Queen released "Bohemian Rhapsody" in 1975, a song built from very different sections, it was a stitched song in the most literal sense.