Abstract. Stochastic deterministic finite automata have been introduced and are used in a variety of settings. We use them to model musical styles: a same automaton can be used to classify new melodies but also to generate them. Through grammatical inference these automata are learned and new pieces of music can be parsed. We show that this works by proposing promising classification results and discuss further work.