In the era of muskets and closed troop formations, musicians marched together with the solders and played marching music even during the battle.
When was the last time such practices were used in battle?
In the USA Civil War they were certainly used, and I would guess in WW1 they were no longer used. Is it possible to narrow it down even further?
I would guess the Franco-Prussian war was technologically not too much different from the American Civil War. Could that be the answer?