According to military accounts, "Taps" was written in July of 1862, during the Civil War.
A Union General, Daniel Adams Butterfield, and his Third Brigade had just barely come through a bloody and failed campaign to take Richmond, Virginia, the capital of the Confederacy.
More than 600 of Butterfield's men had been killed or wounded in one day of fighting, and the general himself was seriously wounded.
As the Third Brigade rested and regrouped at Harrison Landing on the banks of the James River, south of Richmond, Butterfield was overwhelmed with melancholy. At the close of day on July 2, 1862, it came time for the brigade bugler to play "Lights Out," a bugle call borrowed from the French.
"The call did not seem to be as smooth, melodious and musical as it should be," Butterfield later wrote in an 1898 letter to Century magazine. He wanted something with more grace and emotion.
The general called the bugler, Oliver Wilcox Norton, to his tent, and asked for Norton's help. As Norton later told the story, Butterfield could neither read nor write music, so he whistled a version of a new "Lights Out" tune he had in mind -- a tune music historians say is similar to the last bars of an 1835 tattoo, which Butterfield may have heard earlier in his career and recalled.
Butterfield asked Norton to play the tune on the trumpet. Norton did. The general then made a few markings in pencil on the back of an envelope, to indicate which notes he thought should be held longer. Norton made the adjustments -- and played the resulting version of "Taps" for the first time that night.
"The music was beautiful on that still summer night, and was heard far beyond the limits of the brigade," Norton later recalled. "The next day, I was visited by several buglers from neighboring brigades, asking for copies of the music, which I gladly furnished. The call was gradually taken up throughout the Army of the Potomac."
Butterfield's tune became mandatory at military funeral ceremonies in 1891.