International audienceOne of the pinnacle forms of classical Western music, the fugue is often used in the teaching of music analysis and composition. Fugues alternate between instances of a subject and other patterns and modulatory sections, which are called episodes. Musicological analyses are generally built on these patterns and sections.We propose several algorithms to perform an automated analysis of a fugue, starting from a score in which all the voices are separated. By focusing on the diatonic similarities between pitch intervals, we detect subjects and countersubjects, as well as partial harmonic sequences inside the episodes. We also propose tools to detect subject scale degrees, cadences and pedals, as well as a method for segmenting the fugue into exposition and episodic parts.Our algorithms were tested on a corpus of 36 fugues by Bach and Shostakovich. We provide formalized ground truth data on this corpus as well as a dynamic visualization of the ground truth and of our computed results. The complete system showed correct or good results for about one half of the fugues tested, enabling us to sketch their design