THE ONLY reason Francis Scott Key was anywhere near Fort McHenry the night the British shelled it in 1814 was that his old friend, Dr. William Beanes, one of the founding fathers of the Medical and Chirurgical Faculty of the State of Maryland, had got himself arrested. The arrest occurred when Dr. Beanes, outraged by some British sailors who were drunk and disorderly in his home town of Upper Mariboro, Md., had the sailors thrown into the local pokey. When work of this affront to the British Navy reached higher authoritieis, the crusty old doctor and a couple of his friends were hauled off to a British prison ship.

Enter F. S. Key, a smart young Georgetown lawyer and amateur poet. Armed with permission from President Madison, Key raced off to bargain with the enemy. Eventually, after some very high-powered arguing, Adm. Sir Alexander Cochrane, the British commander-in-chief agreed to free the impulsive prisoners. But not right away. The battle for Baltimore was about to begin - the admiral had boasted that Fort McHenry and the city would fall in a few hours, and he decided for security reasons, to keep the American prisoners until it was all over.

Which is why Francis Scott Key and Beanes and friends spent the night of Sept. 13-14, 1814, on board a mangy little ship, the Surprise, anchored off North Point at the mouth of the Patapsco River, less than 10 miles from Fort McHenry. All night long they watched the bombardment of the fort, and "by the dawn's early light," checked the results.

Key was so shsken up by the experience that he began writing a poem about it on bits of envelope from his pockets. Once the British finally released the prisoners and returned them to Baltimore, Key saw Beanes safely home and stayed up all night finishing his poem.

And what did he think of for music for his new peom? Why he just went back to a tune he used in 1805 when, with Tripoli pirates on his mind,he had written a song that included something about "the star-spangled flag." The tune had begun life decades earlier in England as a drinking song called "To Anacreon in Heaven."

Thirty-five years after the bombardment for Fort McHenry, the same tune was used again for 14-verse poem reminiscing about "The Battle of North Point," in which there were fire, sneering references to "plundering Cockgurn and Co., meaning British Amd. Sir George Cockburn, the man who ordered the burning of Washington.

So here we are today, stuck with a National Anthem that started life as a tavern song and came down to us almost by accident, born on an incident in the War of 1812, full of language that has no meaning today but that bristles with a blood-and-thunder spirit we neither feel nor want. Take a look at verse three: "And whereis that band who so valiantly swore. That the havoc of war and the battle's confusion. A home and a country, shall leave us no more. Their blood has wash'd out their foul footsteps' pollution. No refuge could save the hireling and slave. From the terror of flight or the gloom of the grave. And the star spingled banner in triumph shall wave O er the land of the free and the home of the brave."

The "Star Spangled Banner" has had official status only since 1931. But even with Congressional approval it still lacks any agreed-upon official version. The service bands differ on the right speed at which to take the song as they do on the length of some of the notes in the melody.

As for singing it, forget it. Who can sing it? The range of the "Banner" is the same as that of the Toreador song in Bizet's "Carmen," which the world's topflight baritones are paid thousands of dollars to sing. Both songs go from the B flat below middle C to the F an octave and a half above it, a range very few amateur singers possess. The notes look like this:

Now of course if you are Robert Merrill or Sherrill Milnes, those low B flats and high F's don't bother you at all. (Merrill's is one of the recordings of "The Star Spangled Banner" frequently used in stadiums and auditoriums where amplification systems make it possible to use records.) But to the average citizen, that long drum roll, (or maybe only a loud chord in B flat) that signals the beginning of "O: say can you see," which is the way Francis Scott Key punctuated his first line, usually comes like a summons to traffic court or as sign that it is time to take your castor oil.

By the way, look at those notes again. Notice that Bizet and his writers at least had the goodness to give Escamillo some nice open "ah's" on both the low and the high notes. For most singers, "ah" is the kind of vowwl where you can just let it all hang out and it won't sound so bad. But Mr. Key and his Anacreontic friends were not so nice. See what they expect you to do way up there those high F's: "red glare," and "free-e-e-e!" Asking a singer to go from "red" to "glare" on a high note is like asking a driver a shift gears ast 60 m.p.h.

As for a full-blooded, wide open "e-e-e" on a high note, nothing causes more immediate constriction of the average amateur throat. And notice how the low B flats in the "SSB" both occur on the syllable "ming," which is one of the more closed sounds for voices in a low register.

You can transpose the National Anthem down in order to avoid those top F's. Put the thing in A Flat instead of B Flat. Fine - that is, if you are a bass, because those low notes are now lower than ever and most of the world's highest-paid men singers became relatively inaudible down on their low. A flats, while the ladies will just stare at you if you suggest that they produce something attractive down there.

What's the answer? Obviously, it is get another national anthem. This is hardly an original thought. Several radio and TV stations have been campaigning along these lines this spring, while musicians, singers, band leaders, and the general public have brought the whole thing up at regular intervals for years.

In a time when we are thinking about emerging nations and the Third World and looking for ways of reducing arms and armament races, we don't really need to stand up and sing about "bombs bursting in air," or even to remember a brief period in one of our early wars.

We have an American poem set to American music in which this country is idealized in a reasonable, healthy way. The range of the melody is one octave plus one note, a compass within the reach of the average singer. Its musical and literary content is infinitely loftier than the strange conglomerate we now use. Let's hear it for "America the Beautiful."