He was one of those composers who flourished when the Stuart heir, Charles II, returned from exile to the English throne in 1660 after Cromwell's era. It is thought that Locke perhaps shared this exile of the royalists, possibly in the Netherlands, during the 1640's but himself returned to England in 1651 to live near Hereford.
A West Countryman by birth, Locke was already a composer of repute by the time of Charles' return. He had collaborated with Christopher Gibbons in writing the opera Cupid and Death during 1653.
He was also known for the instrumental music he had written, as well as for having written part of the music for the now-lost early English opera The Siege of Rhodes, by William Davenant. He was also associated with various other English composers of that time, including H. Lawes and Simpson.
Locke apparently had a somewhat nasty personality. Records indicate that he was vindictive and difficult to get along with and was involved in many controversies during his later years.
Nonetheless, he and Henry Purcell were close friends; apparently Purcell learned much about music from Locke and eventually succeeded him as Composer in Ordinary to the king.
Among the compositions for which Locke is remembered are several consort pieces for brass and wind instruments, as well as a large number of anthems, motets and songs. Many were ceremonial pieces written for occasions of state. In particular, he provided the music for the coronation of Charles II in 1661.
The following year he was named organist to the Queen. It was for these various services to the crown that he was appointed as Composer in Ordinary to the king. In addition, his body of works includes some incidental music for the stage, dance music, and keyboard compositions.