Well into the 19th century, it was a common practice to attach new words to existing melodies. For example, most early American hymnals (books of hymns to be sung in church) showed just the words and told singers which well-known tune they should sing the words to. This practice was only beginning to change during the period in which "The Star-Spangled Banner" was written. A new method for teaching sight-singing known as shape-note singing was being developed. Some congregations started hiring instructors to teach their members this method, which allowed them to sing new melodies. Still, many rural congregations hung onto the old hymnals that attached dozens of songs to a much shorter list of tunes.
Francis Scott Key's words, however, were not attached to one of the familiar sacred melodies. Instead, somebody—it’s not clear who—linked them to a popular drinking song written by a Brit 40 years earlier. "The Anacreontic Song" was composed by John Stafford Smith and sung by members of his social club, the Anacreontic Society. According to the society, its purpose was to promote music and music appreciation in the city of London. Despite its goals, the group was mostly known for its rowdy gatherings filled with drinking and singing. In fact, the group's namesake, Anacreon, was a Greek poet who lived in the sixth century B.C. and was famous for his works celebrating wine, women, and song.
The “standard” arrangement of the song has not changed all that much over the past 200 years. A 21st-century military band plays the song just about the same way an 18th-century band would have played it. Yet the influence of more recent musical genres, such as jazz and rock, has also shaped many contemporary renditions. For example, Whitney Houston’s popular performance of the song before the 1991 Super Bowl began with a fairly traditional military band instrumental before shifting to a more free-ranging soul vocal. Jim Hendrix incorporated many of his signature electric guitar tricks like the use of feedback and distortion within his performance of the song at Woodstock in 1969. Marvin Gaye even brought the R&B sensuality of his recently released “Sexual Healing” to his performance of the National Anthem at the 1983 NBA All-Star game.