MILITARY ACTION has been linked to music at least since Joshua blew down the walls of Jericho. The connection comes principally in the form of marches and bugle calls, but also in battle pieces--usually elaborations on this kind of material. Back in the days when war was a more orderly business, marches helped to keep the soldiers moving together, and bugle calls included codes to transmit orders and apprise the troops of developments in the field. Generals also nursed the fond hope that an army's music might inspire its troops and scare the enemy at the same time.

Nowadays, marches are heard mostly at football games (which are a symbolic relic of war in the good old days) and, of course, on the Fourth of July. In this tradition, the National Symphony Orchestra will present the world premiere of a new march (written by composer in residence Andreas Makris and appropriately titled the "Fourth of July") in its concert tonight on the East Lawn of the Capitol.

"Fourth of July" has been a favorite title for American music from the time of James Hewitt (1770-1827), who wrote a "grand military sonata" with that title, to the time of Charles Ives (1874-1954) who made it the title of a tone poem. Both are, naturally, full of marches, as are all the military tone poems composed during the last 200 years. The best-known of these works is Tchaikovsky's "1812" Overture, which was performed a week ago at Wolf Trap, but James Hewitt beat Tchaikovsky by nearly a century with his "Battle of Trenton," which was composed for piano in 1797.

The oldest battle music we are likely to hear performed today is not a march or an elaboration of marches, but a madrigal--"La Bataille" by the French Renaissance composer, Cle'ment Jannequin. It includes the sounds of fanfares, horses stamping, knights smashing one another's armor, the tide of battle swaying back and forth, and cries of "Victory," all conveyed by unaccompanied voices. But even this composition, more than four centuries old, is fairly recent in the history of war-related music. According to his early biographers, Nero sang a battle piece about the burning of Troy as he watched Rome being destroyed by fire.

Probably the war that has inspired the most music was World War II--"although it was not primarily a musical," as Tom Lehrer used to say. The music ranges from such epic works as Britten's "War Requiem" and Tippet's "A Child of Our Time" to "South Pacific" and "Goodbye, Mama, I'm Off to Yokohama." In between are such diverse items as Messiaen's "Quartet for the End of Time," which was performed last week at the Library of Congress, Arnold Schoenberg's eloquent "A Survivor From Warsaw," Marc Blitzstein's curious, propagandistic "Airborne" Symphony, the sprawling soundtrack music composed by Richard Rodgers for "Victory at Sea" and such sentimental ballads as "I'll Be Seeing You," "White Cliffs of Dover," "I'll Walk Alone" and "The Boogie-Woogie Bugle Boy of Company B." The last word on this curious corpus of music cannot be written in the foreseeable future, because new items will predictably continue to appear for a long time. They are still composing music about Napoleon 167 years after the Battle of Waterloo--most recently Carmine Coppola's lengthy and sometimes ingenious soundtrack for Abel Gance's silent film.

Music about Napoleon, whether it is composed by Beethoven, Tchaikovsky, Coppola or Zoltan Kodaly, has one common quality: it tends to be noisy--noisier, on the whole, than music about World War II. Even Haydn, who uses the big bang very sparingly, revs up the percussion for his two best-known Napoleonic pieces, the "Lord Nelson" Mass and the "Mass in Time of War." Cannon are often used for Tchaikovsky's "1812" overture, on the composer's instructions, and sometimes for Beethoven's "Wellington's Victory," although this is musicologically questionable. Beethoven did not originally compose this piece for orchestra, with or without cannon, but for a sort of giant music box called the Panharmonicon. Beethoven's other two well-known Napoleonic pieces have no cannon, only moderate noise and a rather tenuous connection with Napoleon. The "Eroica" Symphony was originally dedicated to Napoleon, but Beethoven withdrew the dedication angrily after Napoleon crowned himself emperor. The "Emperor" Concerto has nothing at all to do with Napoleon; its title is as apocryphal as that of the "Moonlight" Sonata.

Both "1812" and "Wellington's Victory" illustrate a fairly standard approach to the challenge of putting a battle into music--what we might call the clash of the tunes. In both pieces, one tune representing the good guys (and having some of the qualities of a hymn) engages in a musical struggle with another tune without such religious overtones. In "1812," it is the ancient hymn, "God Preserve Thy People," against the "Marseillaise."

French friends may tell you that the "Marseillaise" is as much a hymn as that old Russian tune, and as one who roots for it every time I hear the "1812" (one who is repeatedly disappointed, I might add), I would like to agree. Hector Berlioz, in his epic orchestration of the tune, treats it like a hymn--almost an oratorio, particularly when he gets into the part with the boys' chorus. But examine the words and the jaunty, stirring melody, and there is nothing religious about it. The basic sentiment is "murder the bums and let their foul blood fertilize our soil" ("qu'un sang impur abreuve nos sillons"). And when the music gets soft and the chords get ecclesiastical it turns out that the supernatural ideal permeating the music is not "Dieu" (God) but "La Patrie" (The Fatherland). Dashed off in the heat of the French Revolution, "La Marseillaise" is probably the first pointedly atheist national anthem in history, though hardly the first nonreverent marching song. Anyone who has been in the armed forces (or even the Boy Scouts) knows several, and they have an ancient if not an honorable history. The army of Julius Caesar used a marching tune whose lyrics can be translated: "Husbands, hide your wives; here comes the bald-headed stud."

Everyone recognizes the "Marseillaise." The tune that represents Napoleon in "Wellington's Victory" is also immediately recognizable, but it gives a little shock to English-speakers who are hearing the music for the first time. It is variously known in our language as "For He's a Jolly Good Fellow," "We Won't Be Home Until Morning" or "The Bear Went Over the Mountain" and we can't help wondering what it is doing in a tone poem about the Napoleonic Wars. But Beethoven was a contemporary of Napoleon and certainly knew more than Tchaikovsky about what Napoleon's soldiers actually sang. The fact is that the tune (which is also used by Coppola in his music for "Napoleon," with other tunes of the period) was a marching song of the French army at that time. It was called "Marlborough s'en va-t-en guerre" and it tells the sad story of a British military leader (undoubtedly an ancestor of Winston Churchill) who marches off to war and never returns. The sad story is sung to such a sprightly tune, no doubt, because the words (and the singers) are French.

The widespread feeling that World War II was "the last good war" seems to be reflected in our music. Three decades after the police action in Korea, try to find anyone who can hum you a tune from that military incident. Vietnam produced a lot of good songs about war, but they all seem to be anti-war songs. Perhaps the ultimate war music for our time is a song by Tom Lehrer--appropriately, about the ultimate war. "Every great war produces its great songs, and after each war we like to gather round the piano and sing these songs," Lehrer explains in his introduction. "We enjoy singing the songs because they remind us of how much we enjoyed the war. I feel that if any songs are going to come out of World War III, perhaps we'd better start writing them now."

"So long mom," the song begins, "I'm off to drop the bomb, so don't wait up for me." It comes to a rousing conclusion with: "I'll look for you when the war is over, an hour and a half from now."

Maybe it's better, come to think of it, to save our marches for football games