This thesis presents the formalization and development of the music analysis software MORFOS (Multiscale Oracle Representations For Organized Sounds). It is an automation of the Cognitive Algorithm presented by Jean-Marc Chouvel, which is in line with the continuity of semiological analysis and cognitive musicology, and enables the multi-scale representation of a model of cognition during musical listening. By automating this algorithm, we aim to gain a better understanding of the phenomena of musical listening, and more specifically of the phenomena of classification and segmentation over time, as well as the phenomena of anticipation and surprise. We are also interested in the visualization of the resulting representation, known as a multi-scale formal diagram. We aim to analyze the contribution of hierarchization to the musical phenomena studied, and the relationships that emerge between the elements studied at different time scales.