Church music in Scotland includes all musical composition and performance of music in the context of Christian worship in Scotland, from the beginnings of Christianisation in the fifth century, to the present day. The sources for Scottish Medieval music are extremely limited due to factors including a turbulent political history, the destructive practices of the Scottish Reformation, the climate and the relatively late arrival of music printing. In the early Middle Ages, ecclesiastical music was dominated by monophonic plainchant, which led to the development of a distinct form of liturgical Celtic chant. It was superseded from the eleventh century by more complex Gregorian chant. In the High Middle Ages, the need for large numbers of singing priests to fulfill the obligations of church services led to the foundation of a system of song schools, to train boys as choristers and priests. From the thirteenth century, Scottish church music was increasingly influenced by continental developments. Monophony was replaced from the fourteenth century by the Ars Nova consisting of complex polyphony. Survivals of works from the first half of the sixteenth century indicate the quality and scope of music that was undertaken at the end of the Medieval period. The outstanding Scottish composer of the first half of the sixteenth century was Robert Carver, who produced complex polyphonic music.
The Reformation had a severe impact on church music. The song schools of the abbeys, cathedrals and collegiate churches were closed down, choirs disbanded, music books and manuscripts destroyed and organs removed from churches. The Lutheranism that influenced the early Scottish Reformation attempted to accommodate Catholic musical traditions into worship. Later the Calvinism that came to dominate was much more hostile to Catholic musical tradition and popular music, placing an emphasis on what was biblical, which meant the Psalms and most church compositions were confined to homophonic settings. James VI attempted to revive the song schools, however, the triumph of the Presbyterians in the National Covenant of 1638 led to and end of polyphony. In the eighteenth century Evangelicals tended to believe only the Psalms of the 1650 Psalter should be used in the services in the church, while the Moderates attempted to expand psalmody in the Church of Scotland to include hymns the singing of other scriptural paraphrases. Lining out began to be abandoned in favour of singing stanza by stanza. In the second half of the eighteenth century these innovations became linked to a choir movement that included the setting up of schools to teach new tunes and singing in four parts. More tune books appeared and the repertory further expanded.
The nineteenth century saw the reintroduction of accompanied music into the Church of Scotland, influenced by the Oxford Movement. Organs began to be added to churches from the mid-nineteenth century, but they remained controversial and were never placed in some churches. Hymns were also adopted by the main denominations. The American Evangelists Ira D. Sankey and Dwight L. Moody helped popularise accompanied church music in Scotland. In the Scottish Episcopal Church, the Oxford Movement and links with the Anglican Church led to the introduction of more traditional services and by 1900 surpliced choirs and musical services were the norm. In Episcopalian cathedrals and churches that maintain a choral tradition, the repertoire of Anglican church music continues to play an important part of worship.
In the twentieth century ecumenical movements including the Iona Community and the Dunblane Consultations on church music, were highly influential on church music throughout Britain and the United States and there was a return to the composition of choral music.