John was a patron of music and the arts, and a considerably sophisticated writer on music; in addition to this, he was a composer. During his reign he collected one of the largest libraries in the world, but it was destroyed in the Lisbon earthquake of 1755. Among his writings is a defense of Palestrina, and a "Defense of Modern Music" (Lisbon, 1649). One famous composition attributed to him is a setting of the "Crux fidelis", a work that remains highly popular during Holy Week amongst church choirs. However, no known manuscript of the work exists, and it was first published only in 1869, in France. On stylistic grounds, it is generally recognized that the work was written in the 19th century.