Learning regular grammars to model musical style: Comparing different coding schemes

  • Pedro P. Cruz-Alcázar
  • Enrique Vidal-Ruiz
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1433)


An application of Grammatical Inference (GI) in the field of Music Processing is presented, were Regular Grammars are used for modeling musical style. The interest in modeling musical style resides in the use of these models in applications, such as Automatic Composition and Automatic Musical Style Recognition. We have studied three GI Algorithms, which have been previously applied successfully in other fields. In this work, these algorithms have been used to learn a stochastic grammar for each of three different musical styles from examples of melodies. Then, each of the learned grammars was used to stochastically synthesize new melodies (Composition) or to classify test melodies (Style Recognition). Our previous studies in this field showed the need of a proper music coding scheme. Different coding schemes are presented and compared according to results in Composition and Style Recognition. Results from previous studies have been improved.


Code Scheme Average Success Rate Musical Style Grammatical Inference Symbol String 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Amengual J.C., Vidal E. and Benedí J.M. October 1996. Simplifying Language through Error-Correcting Decoding. Proceedings of the ICSLP96 (IV International Conference on Spoken Language Processing), pp. 841–844, Philadelphia, PA., USA, 3–6.Google Scholar
  2. 2.
    Amengual J.C. and Vidal E. 1996. Two Different Approaches for Cost-efficient Viterbi Parsing with Error Correction. Advances in Structural and Syntactic Pattern Recognition, pp. 30–39. P. Perner, P. Wang and A. Rosenfeld (eds.). LNCS 1121. Springer-Verlag.Google Scholar
  3. 3.
    Carrasco, R.C.; Oncina, J. 1994. Learning Stochastic Regular Grammars by means of a State Merging Method. “Grammatical Inference and Applications”. Carrasco, R.C.;Oncina, J. eds. Springer-Verlag, (Lecture notes in Artificial Intelligence (862)).Google Scholar
  4. 4.
    Cruz P.P. 1996. Estudio de diversos algoritmos de Inferencia Gramatical para el Reconocimiento Automático de Estilos Musicales y la Composición de melodías en dichos estilos. PFC. Facultad de Informática. Universidad Politécnica de Valencia.Google Scholar
  5. 5.
    Cruz P.P. 1997. A study of Grammatical Inference Algorithms in Automatic Music Composition. Proceedings of the SNRFAI97 (VII Simposium Nacional de Reconocimiento de Formas y Análisis de Imágenes). Vol. 1, pp. 43–48. Sanfeliu A.,Villanueva J.J. and Vitrià J. Eds. Centre de Visió per Computador, Universidad Autónomade Barcelona.Google Scholar
  6. 6.
    Cruz P.P. 1997. A study of Grammatical Inference Algorithms in Automatic Music Composition and Musical Style Recognition. Proceedings from the ‘Workshop on Automata Induction, Grammatical Inference, and Language Acquisition', celebrated during the ICML97 (The Fourteenth International Conference on Machine Learning) Nashville, Tennessee. Electronic publication in the Workshop Web page ( Scholar
  7. 7.
    Eberhart, R.C.; Dobbins, R.W. 1990. Neural Network PC Tools. Academic Press Inc, pp.295–312.Google Scholar
  8. 8.
    Forney, G. D. 1973. The Viterbi algorithm. IEEE Proc. 3, pp. 268–278.MathSciNetCrossRefGoogle Scholar
  9. 9.
    Fu, K.S. 1982. Syntactic Pattern Recognition and Applications. Prentice Hall.Google Scholar
  10. 10.
    García P., Vidal E., Casacuberta F. 1987. Local Languages, the Successor Method, and a step towards a general methodology for the Inference of Regular Grammars. IEEE Trans.on Pattern Analysis and Machine Intelligence. Vol.PAMI-9, No.6, pp.841–844.CrossRefGoogle Scholar
  11. 11.
    García, P.; Vidal, E. 1990. Inference of K-Testable Languages In the Strict Sense and Application to Syntactic Pattern Recognition. IEEE Trans. on PAMI, 12, 9, pp. 920–925.Google Scholar
  12. 12.
    Nuñez, A. 1992. Informática y Electrónica Musical. Ed. Paraninfo.Google Scholar
  13. 13.
    Rulot, H.; Vidal, E. 1987. Modelling (sub)string-length based constraints through a Gramatical Inference method. NATO ASI Series, Vol. F30 Pattern Recognition Theory and Applications, pp. 451–459. Springer-Verlag.Google Scholar
  14. 14.
    Rumsey, F. 1994. MIDI Systems & Control. Ed. Focal Press.Google Scholar
  15. 15.
    Schwanauer S.M.; Levitt D.A. 1993. Machine Models of Music. The MIT Press.Google Scholar
  16. 16.
    Segarra, E. 1993. Una Aproximación Inductiva a la Comprensión del Discurso Continuo. Facultad de Informática. Universidad Politécnica de Valencia.Google Scholar
  17. 17.
    Todd P. 1989. A sequential network design for musical applications. Proc. of the 1988 Connectionist Models Summer School. Morgan Kaufmann Publishers, pp. 76–84.Google Scholar
  18. 18.
    Vidal E., Casacuberta F., García P. 1995. Grammatical Inference and Automatic Speech Recognition. In “Speech Recognition and Coding: New Advances and Trends”, A.Rubio y J.M.López, Eds., Springer Verlag.Google Scholar
  19. 19.
    Vidal E., Llorens D. 1996. Using knowledge to improve N-Gram Language Modelling through the MGGI methodology. In ‘Grammatical Inference: Learning Syntax from Sentences'. Proc. of 3rd ICGI. L.Miclet, C. de la Higuera (Eds.). Springer-Verlag (Lect.Notes in Artificial Intelligence, Vol.1147).Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1998

Authors and Affiliations

  • Pedro P. Cruz-Alcázar
    • 1
  • Enrique Vidal-Ruiz
    • 2
  1. 1.EPSAUniversidad Politécnica de Valencia, DISCA-AlcoyAlicanteSpain
  2. 2.DSICUniversidad Politécnica de ValenciaValenciaSpain

Personalised recommendations