Danish traditional music (Danish: spillemandsmusik) is the music genre that has its roots in pre-modern Denmark. In this period it was common for towns to have one or more town musicians (Danish: spillemand) who played at dances, processions and certain rituals. In the 17th and 18th centuries, professional music performances were monopolized by town musicians, who also traveled into the neighboring rural areas to perform. Urban music and dance styles, often from other parts of Europe, penetrated the countryside and almost eradicated earlier styles. This period also saw the introduction of the fiddle as the most important instrument and the abandonment of earlier chain dances in favor of pair dances. Until around 1900, traditional music was the common musical culture of Denmark, but with increasing urbanization and the spread of classical music it became marginalized to rural areas.
Through the Middle Ages and into the 19th century there are reports of "chain dances", processions and ceremonial dances accompanied by pipes, drums and singing.
In the 17th and 18th centuries, throughout Denmark the practice of music was under the monopoly of the appointed city musicians (stadsmusikant), who with their journeymen and apprentices were the only musicians allowed to play for a salary within an assigned territory. Since the city musician was trained in the cities, this meant that courtly repertoires made their way into the countryside, and that most areas did not maintain local musical traditions during this time. Only a few areas, such as Bornholm and Amager, never had the stadsmusikant monopoly, and a few others such as Fanø maintained a local tradition by an arrangement whereby local musicians leased the right to perform on the island from the city musician of Ribe. Since city musicians frowned on the use of instruments deemed impure such as drums, bagpipes and hurdy-gurdies, this period also saw the rise of the fiddle as the main instrument for dance music.
From around 1500, medieval chain dances were displaced by pair dances. The oldest known pair dance in Denmark is the pols, an adapted variant of a Polish dance that was popular in Sweden as early as the 16th century. It is assumed that the pols was prevalent in the Danish countryside by the second half of the 17th century, and in the 18th century it was the most common popular dance along with the minuet. These Polish dances were usually performed in two parts: a slow march and a faster 3/4 second part. Often in the oldest hand-written tune books only the first part was written, as the fiddler improvised the second half based on the first.
From the end of the 18th century English-style contra and square dances became popular. In the 19th century the waltz became the most popular dance in the cities, after having been known in the countryside for a while. Other dance types of the early 19th century are hopsa, rheinlænder, galop, sveitrit and schottish all of which were integrated into the popular English style dances, and later developed their own local dance forms. Around 1850 the polka and mazurka entered the popular repertoire. At the end of the 19th century the earlier dance tradition began to lose its place to modern dances from England, Southern Europe and America. From the local tradition of the island of Fanø the tune types sønderhoning and fannik have made their way into the standard repertoire of Danish traditional music, and are remnants of the early tradition of Polish derived dances.
To counter the loss of traditional dances, the Association for the Promotion of Folkdancing was founded in 1901, focusing on the preservation of popular dances from the period 1750-1850. Many local chapters of such preservation societies appeared during the first decades of the 20th century, and in 1929 there were as many as 16,000 members. These dance associations had a homogenizing effect on the popular dances, creating a standard repertoire of Danish folk dances. They often danced in folk dress. In response to this homogenizing effect of the folkdancing guilds, informal dance organizations working to keep local dance traditions alive in informal settings were also developed, under the name of "Old Dance". Certain rural areas of Denmark such as Fanø, Læsø, Ærø and parts of Western Jutland maintained living traditions of dancing from the late 18th century well into the 20th century.
The earliest known Danish traditional music comes from the handwritten tune collections of musicians, such as the large collection of tunes by Rasmus Storm (ca. 1760). Collection of Danish folkmelodies began in the early 19th century, and figures such as Svend Grundtvig (1824–83), A. P. Berggreen (1801-80) and Evald Tang Kristensen (1843-1929) published significant collections of tunes and songs. In the early 20th century with the establishment of the field of ethnology in Denmark, the collection of folk tradition including music, song, and dances began in earnest.