During battles or marching into battles did armies (like the Spartan or Eastern European armies) have music/chants to march to?
As Historynet's article The Music of War notes,
Music has been an integral part of warfare and the soldier’s life since the dawn of history.... The function of music in war has always been twofold: as a means of communication and as a psychological weapon.
In Asia Minor, M.L.West, in Ancient Greek Music cites Herodotus who
describes Alyattes' Lydian army marching [against Miletus] to the motley sound of auloi, panpipes, and harps.
In the case of the Greeks, there are a number of sources citing this. Anne Margaret Wright in City States, while noting that we don’t exactly know what Greek music sounded like, says,
The Greeks sang many different types of song. Some were sung at home, some on stage, and some when marching into battle...Songs were accompanied by string or wind instruments
M. L. West gives more details:
The paean, which might be anything from a brief solemnity consisting of little more than the formula Ie Paian, Ie Paian, sung in unison, to a long and elaborate song... was frequently sung by soldiers or sailors at moments of exaltation, whether going into battle, or during it, or returning from it in triumph.
He also cites a number of examples from ancient sources:
Corinthian vase-painters of the seventh century show a piper accompanying lines of warriors into the fight, and in the fifth century and later many authors attest this as the regular usage of the Spartan army. Thucydides describes the Spartans advancing to battle 'slowly, to the music of many pipers, as is their established custom, not for religious reasons but so that their approach should be even and rhythmical and their line not broken, as tends to happen with large forces as they come forward'
West also cites Plutarch:
When their battle-line was ready drawn up, with the enemy looking on, the king would slaughter the nanny-goat, giving the word for everyone to put on wreaths and telling the pipers to pipe the Castor tune, while he gave the lead in the marching paean. It was a solemn and terrifying sight to see them, stepping in time to the pipe, with no split in their line and no disturbance in their spirits, calmly and cheerfully following the music into mortal danger.
Note: 'The king' here refers to one of the kings of Sparta who traditionally led the Spartan army into battle. There were, however, also other commanders who were not kings (e.g. Lysander, Brasidas).
If we broaden the definition of music, chanting has long been a means of raising morale and / or striking fear into the enemy and the Greeks used it too. On one occasion (413 BC) during the Peloponnesian War, it didn't quite have the intended effect:
...a small Argive contingent joined the reinforcements which the Athenians had decided to send to Syracuse, where their major contribution seems to have been to throw the Athenians into a panic by the use of the Dorian war chant that the Athenians normally heard from their enemies.
Source: R.A.Tomlinson, Argos and the Argolid
Elsewhere, Historynet notes
Rome’s Celtic enemies.... for centuries charged — and later marched — into battle accompanied by their own array of horns, drums and bagpipes.
Similarly, the article Cavalry Trumpet and Kettledrum Practice from the Time of the Celts and Romans to the Renaissance observes that
...the Britons..began their military assaults by taunting the enemy with songs and deafening howls accompanied by the blowing of horns and trumpets.
"Diodurus Siculus, writing between 60 and 30 BC, described the strange carnyx of the Gauls: 'Their trumpets are of peculiar nature and such as barbarians use, for when they are blown upon they give forth a harsh sound, appropriate to the tumult of war'." Text & image source: The Carnyx: An Ancient War Trumpet
Musical instruments were common in Roman armies but were not always used for marching, or even to make music. As this article on Roman Military Brass Instruments notes, musical instruments were regularly used for communication (as was also the case in other armies at other times):
Military musicians in the Roman army were senior centurions, the highest rank of noncommissioned officers, indicating the important role that musical instruments played in military communication. Trumpets, cornu and buccina were used to sound the alarm, to signal attack, retreat and formation changes during battle, to announce changes of the watch, and were played to provide accompaniment for soldiers while marching.
For the Romans, war cries were common, but only at certain times:
Like all peoples of Antiquity, Roman troops used war cries to frighten the enemy, demonstrate strength and eagerness, and heighten individual and collective determination, but the demands of discipline and tactical cohesion required them to exercise restraint....battle cries were only permitted immediately prior to or upon engaging the enemy at close quarters....This practice is documented during the Principate....In Late Antiquity, tactical treatises continue to recommend similar procedures
The Romans, it seems, also learned from their enemies:
In the 4th century CE, Roman infantry favored the barritus, a war cry of Germanic origin, apparently imitated from a martial custom prevalent among auxilia palatina from east of the Rhine. It began as low murmuring and gradually crescendoed to a loud roar
Turning to medieval times, music does not seem to have been used on the battlefield for the first half of the middle ages. The Crusaders were to change this, though, after their encounters with the Saracens. Referring to the Saracens in 1191, the Itinerarium Regis Ricardi says:
In front came certain of their admirals, as was their duty, with clarions and trumpets; some had horns, others pipes and timbrels, gongs, cymbals and other instruments, producing a horrible noise and clamour. The earth vibrated from the loud and discordant sounds, so that the crash of thunder could not be heard amid the tumultuous noise of horns and trumpets. They did this to excite their spirit and courage, for the more violent the clamour became, the more bold were they for the fray.
Cited in Military music, which incorrectly attributes this to Geoffrey of Vinsauf.
One might argue that 'a horrible noise and clamour' does not qualify as music, but the Crusaders noted its effectiveness and introduced the idea into medieval Europe:
Impressed by the Saracens’ use of military bands as both a means of instantly transmitting orders to distant formations and as a weapon of fear and affray, as Bartholomaeus Anglicus expressed it in the 13th century, the Christian knights soon emulated them. Among the Saracen instruments adapted were the anafil, a straight, valveless trumpet; the tabor, a small drum, sometimes snared; and thenaker, a small, round kettledrum, usually deployed in pairs.
Battle of Dornach (1499), part of a contemporary woodcut. Note the wind instrument on the left side.
As with the Romans, one should beware of assuming the use musical instruments in the middle ages solely in relation to marching. For example,
European military drums were used in many ways, from demoralizing enemy, setting up parleys, communication between two warring sides, military communication between ranks, drills, military ceremonies and honor music.
Even with the advent of musical instruments, war cries or chants remained in common use in medieval Europe. Examples include
the ‘Hui hui’ of the Magyars. War cries were often to saints—the English ‘St George’, the French ‘St Denis’.
Source: The Routledge Companion to Medieval Warfare, J.Bradbury (ed.)
Going back further in time
Early applications of the trumpet
The military culture of early civilization utilized instruments for the purpose of conducting war. Specimens of ancient trumpet-type devices are documented in nearly every culture including those of the Ancient Egyptians, Assyrians, Israelites, Greeks, Etruscans, Romans, Teutonic Tribes, Celts, as well as Asian cultures. These instruments were used for religious ceremonial functions as military signaling devices. (Edward Tarr, The Trumpet (Portland: Amadeus Press, 1988) pp 20)