A chorale is a melody to which a hymn is sung by a congregation in a German Protestant Church service. The typical four-part setting of a chorale, in which the sopranos (and the congregation) sing the melody along with three lower voices, is known as a chorale harmonization.
Starting in 1523, Martin Luther began translating worship texts into German from the Latin (Marshall and Leaver 2001). This created an immediate need for a large repertoire of new chorales. He composed some chorales himself, such as A Mighty Fortress. For other chorales he adapted Gregorian chant melodies used in Roman Catholic worship to fit new German texts, sometimes using the same melody more than once. For example, he fitted the melody of the hymn "Veni redemptor gentium" to three different texts, "Verleih uns Frieden gnädiglich", "Erhalt uns, Herr, bei deinem Wort", and "Nun komm, der Heiden Heiland" (Marshall and Leaver 2001). As early as 1524, Johann Walter published Eyn geystlich Gesangk Buchleyn, the first hymnal for choir, in Wittenberg.
Johann Sebastian Bach harmonised hundreds of chorales, typically used at the end of his cantatas and concluding scenes in his Passions. In his St Matthew Passion, he set five stanzas of "O Haupt voll Blut und Wunden" in four different ways. He also used hymns as the base for his cycle of chorale cantatas and chorale preludes. Bach concentrated on the chorales especially in the Chorale cantatas of his second annual cycle, composed mostly in 1724/25.