Large-scale quantitative investigations into the cultural evolution of music have mostly focused on only a limited range of time periods and genres. Here, we analyze more than 40,000 pieces of plainchant to better understand the evolution of modes and pitch distributions in a period of five centuries that saw the development of the Western modal practice. Specifically, we employ a hierarchical Markov mixture model to analyze the eight medieval modes and their substructure represented as pitch distributions and observe their historical changes. We found that the individual modes exhibit internal clusters, that the relative frequencies of the eight modes remained remarkably stable over time, and that there were comparatively large changes in the pitch distributions of individual modes. We discuss our results on the background of musicological insights and point to the need for further interdisciplinary work.