<P> The poem was set to the tune of a popular British song written by John Stafford Smith for the Anacreontic Society, a men's social club in London . "To Anacreon in Heaven" (or "The Anacreontic Song"), with various lyrics, was already popular in the United States . Set to Key's poem and renamed "The Star - Spangled Banner", it soon became a well - known American patriotic song . With a range of one octave and one fifth (a semitone more than an octave and a half), it is known for being difficult to sing . Although the poem has four stanzas, only the first is commonly sung today . </P> <P> "The Star - Spangled Banner" was recognized for official use by the United States Navy in 1889, and by U.S. President Woodrow Wilson in 1916, and was made the national anthem by a congressional resolution on March 3, 1931 (46 Stat. 1508, codified at 36 U.S.C. § 301), which was signed by President Herbert Hoover . </P> <P> Before 1931, other songs served as the hymns of American officialdom . "Hail, Columbia" served this purpose at official functions for most of the 19th century . "My Country,' Tis of Thee", whose melody is identical to "God Save the Queen", the United Kingdom national anthem, also served as a de facto anthem . Following the War of 1812 and subsequent American wars, other songs emerged to compete for popularity at public events, among them "The Star - Spangled Banner", as well as "America the Beautiful". </P> <P> On September 3, 1814, following the Burning of Washington and the Raid on Alexandria, Francis Scott Key and John Stuart Skinner set sail from Baltimore aboard the ship HMS Minden, flying a flag of truce on a mission approved by President James Madison . Their objective was to secure an exchange of prisoners, one of whom was Dr. William Beanes, the elderly and popular town physician of Upper Marlboro and a friend of Key's who had been captured in his home . Beanes was accused of aiding the arrest of British soldiers . Key and Skinner boarded the British flagship HMS Tonnant on September 7 and spoke with Major General Robert Ross and Vice Admiral Alexander Cochrane over dinner while the two officers discussed war plans . At first, Ross and Cochrane refused to release Beanes, but relented after Key and Skinner showed them letters written by wounded British prisoners praising Beanes and other Americans for their kind treatment . </P>

Whats the purpose of the star spangled banner
find me the text answering this question