Brass players know the term Stadtpfeifer mostly in reference to a group of municipal trombonists and cornettists in Leipzig, whose members included composers Johann Pezel and Gottfried Reiche in the seventeenth and eighteenth centuries.
Other German towns sponsored similar bands. The first such bands (known in the literature as alta Bands) formed in the Middle Ages, and the last ones persisted into the nineteenth century. Bands started in other countries at about the same time (in England they were called waits), but the tradition did not last as long.
These bands, and similar ones all over Europe, grew from the need for night watchmen as early as the thirteenth century. Towns had walls and watch towers back then and needed protection from wars, fires, thieves, and local robber barons.
Watchmen could use flags and hand signals during the day, but not after dark. They found that signals from a loud musical instrument, such as a trumpet, horn, or shawm provided the best nighttime communication. In those days, trumpets could play only a few notes at the bottom of the overtone series, but that was enough to create a number of signals.
Towns came to depend on signals from wind instruments for safety at night. By the fourteenth century, some towns actually forbade anyone but the watchmen from playing them after dark–except at weddings.
Bologna first hired civic trumpeters in 1250. By that time, its leaders must have recognized that a group of trumpets could do more for them than just play signals from the towers at night. They could lend dignity and splendor to proclamations and other civic ceremonies on the ground.
Neither watch duty nor ceremonial duty required anything more than the ability to make a clear sound and memorize the signals. Eventually, though, someone realized that a group of trumpets and shawms could actually make music.
As early as 1310, watchmen in the town of Bruges performed as a musical ensemble to entertain for civic festivities. They did not just follow a government official to attract an audience to hear a proclamation. They played at a banquet.
For a while, the watchmen performed both musical and non-musical duties with their instruments. Other people, not on the town payroll, learned to play the watch instruments strictly as musical instruments. That is why it became necessary to outlaw playing of trumpets and shawms after dark by anyone but the official watchmen.
Eventually, the town watchmen became the town band. Little by little, they shed the watch duty. They stopped playing trumpets and took up the new and more flexible trombone (at that time, actually a slide-trumpet) instead. Eventually the shawm gave way to the cornett.Towns maintained a separate trumpet corps.
As the bands became strictly musical ensembles, they sought legal protection against non-members who competed against them for what we would now call freelance gigs. The music of Pezel and Reiche was still centuries in the future.