Cantus firmus is a pre-existing melody forming the basis of a polyphonic composition, serving as a structural framework for harmony and counterpoint. Originating in the medieval period, it remains a fundamental concept in the study of Western music theory and composition, illustrating the evolution of musical texture and complexity.