Poetry and music have been intertwined for thousands of years. In antiquity, poems were often sung: the first lyric poets in ancient Greece performed their work to the accompaniment of the lyre, and the oldest anthology of Chinese poetry, the Shijing, was a collection of songs. In southern Europe in the middle ages, the popularity of troubadour poets granted them unprecedented freedom of speech and social influence in their time, and their lyrical work would influence European poetry for centuries. The ballad form continues to be a common form for both poems and songs. Emily Dickinson famously wrote her sometimes irreverent poems to the rhythms and forms of church hymns, and more recent poets such as W.H. Auden, J.D. McClatchy, and Eileen Myles have written successful opera libretti.
Today poets still draw on the forms and rhythms of different musical traditions, from jazz, rap, and hip-hop to folk songs and country music. *
*Details from The Poetry Foundation

