SciELO - Scientific Electronic Library Online

 issue44FPGA Implementation of Fuzzy Mamdani System with Parametric Conjunctions Generated by Monotone Sum of Basic t-NormsAn Approach to Cross-Lingual Textual Entailment using Online Machine Translation Systems author indexsubject indexsearch form
Home Pagealphabetic serial listing  

Services on Demand




Related links

  • Have no similar articlesSimilars in SciELO



On-line version ISSN 1870-9044

Polibits  n.44 México Jul./Dec. 2011


Automatic Music Composition with Simple Probabilistic Generative Grammars


Horacio Alberto García Salas1, Alexander Gelbukh2, Hiram Calvo3, and Fernando Galindo Soria4


1 Natural Language Laboratory, Center for Computing Research, National Polytechnic Institute, CIC–IPN, 07738, DF, México (e–mail:

2 Waseda University, Tokyo, Japan, on Sabbatical leave from the Natural Language Laboratory, Center for Computing Research, National Polytechnic Institute, CIC–IPN, 07738, DF, México (e–mail:

3 Natural Language Laboratory, Center for Computing Research, National Polytechnic Institute, CIC–IPN, 07738, DF, México (email:

4 Informatics Development Network, REDI (e–mail:


Manuscript received February 10, 2011.
Manuscript accepted for publication July 30, 2011.



We propose a model to generate music following a linguistic approach. Musical melodies form the training corpus where each of them is considered a phrase of a language. Implementing an unsupervised technique we infer a grammar of this language. We do not use predefined rules. Music generation is based on music knowledge represented by probabilistic matrices, which we call evolutionary matrices because they are changing constantly, even while they are generating new compositions. We show that the information coded by these matrices can be represented at any time by a probabilistic grammar; however we keep the representation of matrices because they are easier to update, while it is possible to keep separated matrices for generation of different elements of expressivity such as velocity, changes of rhythm, or timbre, adding several elements of expressiveness to the automatically generated compositions. We present the melodies generated by our model to a group of subjects and they ranked our compositions among and sometimes above human composed melodies.

Key words: Evolutionary systems, evolutionary matrix, generative grammars, linguistic approach, generative music, affective computing.





The work was done under partial support of Mexican Government (CONACYT 50206–H, SIP–IPN 20113295, COFAA–IPN, PIFI–IPN, SNI).



[1] J. A. Biles, "GenJam: Evolution of a Jazz Improviser," Creative Evolutionary Systems, Section: Evolutionary Music, San Francisco, CA, USA. Morgan Kaufmann Publishers Inc., 2001, pp. 165–187.         [ Links ]

[2] D. Birchfield, "Generative Model for the Creation of Musical Emotion, Meaning and Form," in Proceedings of the 2003 International Multimedia Conference ACM SIGMM, Berkeley, California: Workshop on Experiential Telepresence, Session: Playing experience, 2003, pp. 99–104.         [ Links ]

[3] S. Blackburm, and D. DeRoure, "A tool for content based navigation of music," in Source International Multimedia Conference. Proceedings of the sixth ACM international conference on Multimedia. Bristol, United Kingdom, 1998, pp. 361–368.         [ Links ]

[4] T. Blackwell, "Swarming and Music," Evolutionary Computer Music. Springer London, 2007, pp. 194–217.         [ Links ]

[5] M. Bulmer, "Music From Fractal Noise," in Proceedings of the Mathematics 2000 Festival, University of Queensland, Melbourne, 2000.         [ Links ]

[6] T. Cochrane, "A Simulation Theory of Musical Expressivity," The Australasian Journal of Philosophy, Volume 88, Issue 2, 191–207, 2010.         [ Links ]

[7] D. Eck, and J. Schmidhuber, A First Look at Music Composition using LSTM Recurrent Neural Networks, Source Technical Report: IDSIA–07–02. Publisher Istituto Dalle Molle Di Studi Sull Intelligenza Artificíale, 2002.         [ Links ]

[8] F. Galindo Soria, "Sistemas Evolutivos: Nuevo Paradigma de la Informática," en Memorias XVII Conferencia Latinoamericana de Informática, Caracas Venezuela, 1991.         [ Links ]

[9] F. Galindo Soria, "Enfoque Lingüístico," en Memorias del Simposio Internacional de Computación de 1995, Cd. de México: Instituto Politécnico Nacional CENAC, 1995.         [ Links ]

[10] F. Galindo Soria, Teoría y Práctica de los Sistemas Evolutivos, Cd. de México, 1997.         [ Links ]

[11] F. Galindo Soria, "Matrices Evolutivas," en Memorias de la Cuarta Conferencia de Ingeniería Eléctrica CIE/98, Cd. de México: Instituto Politécnico Nacional, CINVESTAV, 1998, pp. 17–22.         [ Links ]

[12] A. García Salas, Aplicación de los Sistemas Evolutivos a la Composición Musical, México D.F: Tesis de maestría, Instituto Politécnico Nacional UPIICSA, 1998.         [ Links ]

[13] A. García Salas, A. Gelbukh, and H. Calvo, "Music Composition Based on Linguistic Approach," in Proceedings of the 9th Mexican International Conference on Artificial Intelligence, Pachuca, México, 2010, pp. 117–128.         [ Links ]

[14] M. Gardner, "Mathematical Games: White and Brown Music, Fractal Curves and One–Over–f Fluctuations," Scientific American, 4, 16–32, 1978.         [ Links ]

[15] H. Hild, J. Feulner, and W. Menzel, "Harmonet: A Neural Net for Harmonizing Chorales in the Style of J. S. Bach," Neural Information Processing 4. Germany: Morgan Kaufmann Publishers Inc., 1992, pp. 267–274.         [ Links ]

[16] R. Hinojosa, Realtime Algorithmic Music Systems From Fractals and Chaotic Functions: Toward an Active Musical Instrument, Barcelona: PhD Thesis, Universitat Pompeu Fabra, 2003.         [ Links ]

[17] H. Järveläinen, "Algorithmic Musical Composition," in Seminar on content creation Art@Science, Helsinki: University of Technology, Laboratory of Acoustics and Audio Signal Processing, 2000.         [ Links ]

[18] K. Kosina, "Music Genre Recognition." Diplomarbeit. Eingereicht am Fachhochschul–Studiengang. Mediente Chnik Und Design in Hagenberg, 2002.         [ Links ]

[19] G. Maarten, J.L. Arcos, and R. López de Mántaras, "A Case Based Approach to Expressivity–Aware Tempo Transformation," Machine Learning, 65(2–3): 411–437, 2006.         [ Links ]

[20] K. McAlpine, E. Miranda, and S. Hoggar, "Making Music with Algorithms: A Case–Study System," Computer Music Journal, 23(2): 19–30, 1999.         [ Links ]

[21] M. Minsky, "Music, Mind, and Meaning." Computer Music Journal, 5(3), 1981.         [ Links ]

[22] A P. Ortega, A.R. Sánchez, and M. M. Alfonseca, "Automatic composition of music by means of Grammatical Evolution," ACM SIGAPL APL, 32(4): 148–155, 2002.         [ Links ]

[23] G. Papadopoulos, and G. Wiggins, "AI Methods for Algorithmic Composition: A Survey, a Critical View and Future Prospects," in Symposium on Musical Creativity 1999, University of Edinburgh, School of Artificial Intelligence Division of Informatics, 1999, pp. 110–117.         [ Links ]

[24] Y. Ledeneva and G. Sidorov, "Recent Advances in Computational Linguistics," Informatica. International Journal of Computing and Informatics, 34, 3–18, 2010.         [ Links ]

[25] P.M. Todd and G.M. Werner, "Frankensteinian Methods for Evolutionary Music Composition," Musical networks: Parallel distributed perception and performance, MA, USA: Cambridge, MIT, Press Bradford Books, 1999.         [ Links ]

Creative Commons License All the contents of this journal, except where otherwise noted, is licensed under a Creative Commons Attribution License