This paper introduces an ecological approach to quantifying diversity in musical compositions. The approach considers notations with distinct pitches and duration as equivalents of species in ecosystems, measures within a composition as equivalents of ecosystems, and the sum of measures (i.e., the entire composition) as a landscape in which ecosystems are embedded. Structural diversity can be calculated at the level of measures (“alpha diversity”) and the entire composition (“gamma diversity”). An additional metric can be derived that quantifies the structural differentiation between measures in a composition (“beta diversity”). We demonstrate the suitability of the approach in music using specifically composed examples and real songs that vary in complexity. We discuss the potential of the approach with selected examples from a potentially ample spectrum of applications within musicology research. The method seems particularly suitability for hypothesis testing to objectively identify many of the intricate phenomena in music. Because the approach extracts information present in the compositions – it lets the songs tell their structure – it can complement more complex modeling approaches used by music scholars. Combined such approaches provide opportunities for interdisciplinary research. They can help to fill knowledge gaps, stimulate further research and increase our understanding of music.