• Oleksandr Komarov
  • Oleg Galchonkov
  • Alexander Nevrev
  • Oksana Babilunga


genetic algorithm, chromosome, fitness function, tonal model, population, harmonization, computational costs


The problem of musical accompaniment harmonization for adjacent transitional fragments in computer games is considered. A harmonization method based on a tonal model of the musical composition in conjunction with a genetic algorithm seeking the global extremum of the harmonic function is proposed. For the method under consideration, all operators of the genetic algorithm and fitness functions are defined. A scheme was developed for the formation of transitional musical compositions and a flowchart was proposed for using the genetic algorithm in its implementation. Using examples of well-known musical compositions, a study was conducted of the genetic algorithm features and its most appropriate parameters were found in the context of the problem under consideration. This allowed us to obtain expression for the computational costs of the proposed method, which are necessary for balancing the computational load in the computer between the game algorithm itself and the musical harmonization algorithm. Moreover, the study showed that using genetic algorithm allows even for a small number of iterations to achieve melody harmonization level no worse than professional composer achieved, and even exceed this level when performing extra iterations.


T. Adam, M. Haungs, F. Khosmood, “Procedurally generated, adaptive music for rapid game development,” Proceedings of Workshops Co-located with the 9th International Conference on the Foundations of Digital Games, Florida, April 2014, pp. 1-7. [Online]. Available at:

Entertainment Software Association: Essential Facts About the Computer and Video Game Industry. ESA, Washington, DC, 2018. [Online]. Available at:

A. Berndt, K. Hartmann, “The functions of music in interactive media,” in Spierling U., Szilas N. (eds.), Interactive Storytelling. ICIDS 2008. Lecture Notes in Computer Science, Springer, Berlin, Heidelberg, 2008, vol. 5334, pp. 126-131, DOI: 10.1007/978-3-540-89454-4_19

M. Sweet, Writing Interactive Music for Video Games: A Composer's Guide, Addison-Wesley Professional, Piscataway, 2014, 512 p.

K. Collins, “An introduction to procedural music in video games,” Contemporary Music Review, vol. 28, pp. 5-15, 2009, DOI: 10.1080/07494460802663983.

M. Hendrikx, S. Meijer, J. van der Velden, A. Iosup, “Procedural content generation for games: A survey,” ACM Transactions on Multimedia Computing, Communications, and Applications, vol. 9, pp. 1-22, 2013, DOI: 10.1145/2422956.2422957.

D. Plans, D. Morelli, “Experience-driven procedural music generation for games,” IEEE Transactions on Computational Intelligence and AI in Games, vol. 4, issue 3, pp. 192–198, 2012, DOI: 10.1109/TCIAIG.2012.2212899

W. Phillips, A Composer's Guide to Game Music, MIT Press, 2014, 288 p.

P. Peerdeman, Sound and Music in Games, VU Amsterdam, 2010.

I. Karydis, D. Makris, S. Sioutas, “Automatic melodic harmonization: an overview, challenges and future directions,” in Kostagiolas P., Martzoukou K., Lavranos C. (eds.), Trends in Music Information Seeking, Behavior, and Retrieval for Creativity, IGI Global, 2016, pp. 146-165.

C.E. Palazzi, S. Ferretti, S. Cacciaguerra, Roccetti M. “On maintaining interactivity in event delivery synchronization for mirrored game architectures,” Proceedings of the IEEE Global Telecommunications Conference Workshops, 2004, pp. 157-165. DOI: 10.1109/GLOCOMW.2004.1417568.

S. Ferretti, M. Roccetti, “Fast delivery of game events with an optimistic synchronization mechanism in massive multiplayer online games,” Proceedings of the International Conference on Advances in Computer Entertainment Technology ACE’2005, 2005, pp. 405-412. DOI: 10.1145/1178477.1178570.

G. Armitage, “An experimental estimation of latency sensitivity in multiplayer Quake 3,” Proceedings of the 11th IEEE International Conference on Networks, 2003, pp. 137-141. DOI: 10.1109/ICON.2003.1266180.

Pathologic Classic HD. [Online]. Available at:

C. Schmidt-Jones, Understanding Basic Music Theory, 12th Media Services, 2018, 278 p.

E. Geisera, E. Ziegler, L. Jancke, M. Meyer, “Early electrophysiological correlates of meter and rhythm processing in music perception,” Cortex, vol. 45, pp. 93-102, 2009, DOI: 10.1016/j.cortex.2007.09.010.

I. Sposobin, Elementary Theory of Music, Moscow, 1996, 208 p. (in Russian).

Y.Y. Shi, X. Zhu, H.G. Kim, K.W. Eom, “A tempo feature via modulation spectrum analysis and its application to music emotion classification,” Proceedings of the 2006 IEEE International Conference on Multimedia and Expo, 2006, pp. 1085-1088. DOI: 10.1109/ICME.2006.262723.

P. Gomez, B. Danuser, “Relationships between musical structure and psychophysiological measures of emotion,” Emotion, vol. 7, pp. 377–387, 2007. DOI: 10.1037/1528-3542.7.2.377.

H.V. Koops, J.P. Magalhaes, W.B. de Haas, “A functional approach to automatic melody harmonization,” Proceedings of the first ACM SIGPLAN Workshop on Functional Art, Music, Modeling & Design, 2013, pp. 47-58. DOI: 10.1145/2505341.2505343.

A. Zacharakis, M. Kaliakatsos-Papakostas, C. Tsougras, E. Cambouropoulos, “Musical blending and creativity: An empirical evaluation of the CHAMELEON melodic harmonisation assistant,” Musicae Scientiae, vol. 22, pp. 119-144, 2018, DOI: 10.1177/1029864917712580.

F. Simonetta, F. Carnovalini, N. Orio, A. Roda, “Symbolic music similarity through a graph-based representation,” Proceedings of the Audio Mostly 2018 on Sound in Immersion and Emotion, (AM’18), September 12–14, 2018, Wrexham, United Kingdom, pp. 26:1-26:7, DOI: 10.1145/3243274.3243301.

D. Deutsch, J. Feroe, “The internal representation of pitch sequences in tonal music,” Psychological Review, vol. 88, pp. 503-522, 1981, DOI: 10.1037/0033-295X.88.6.503.

S. Phon-Amnuaisuk, A. Tuson, G. Wiggins, “Evolving musical harmonization,” in: Pearson D.W., Dobnikar A., Albrecht R. (eds.), Proceedings of the International Conference on Artificial Neural Nets and Genetic Algorithms, Portorož, Slovenia, 1999, pp. 229-234. Springer-Verlag Wien, Vienna, 1999, DOI: 10.1007/978-3-7091-6384-9_39.

G. Papadopoulos, G. Wiggins, “AI methods for algorithmic composition: A survey, a critical view and future prospects,” Proceedings of the AISB’99 Symposium on Musical Creativity, 1999, pp. 110-117.

A.R.R. Freitas, F.G. Guimaraes, “Melody harmonization in evolutionary music using multiobjective genetic algorithms,” Proceedings of the 8th Sound and Music Computing Conference. Sound and Music Computing Network, 2011, pp. 346-353. [Online]. Available at:

S. Phon-Amnuaisuk, G. Wiggins, “The four-part harmonisation problem: A comparison between genetic algorithms and a rule-based system,” Proceedings of the Symposium on Musical Creativity AISB’99, 1999, pp. 22-34.

D.A. Matic, “Genetic algorithm for composing music,” Yugoslav Journal of Operations Research, vol. 20, pp. 157-177, 2010, DOI: 10.2298/YJOR1001157M.

J.D. Fernandez, F. Vico, “AI methods in algorithmic composition: A comprehensive survey,” Journal of Artificial Intelligence Research, vol. 48, pp. 513-582, 2013, DOI: 10.1613/jair.3908.

Yu.N. Kholopov, Harmony. A Practical Course, Moscow, Publishing house “Composer”, 2005, 472 p. (in Russian).

I. Dubovsky, S. Evseev, I. Sposobin, V. Sokolov, A Textbook of Harmony, Moscow: Muzyka, 1987, 436 p. (in Russian).

D. Moelants, “Preferred tempo reconsidered,” In: Stevens C. J., Burnham D. K., McPherson G., Schubert E., Renwick J. (eds.) Proceedings of the 7th International Conference on Music Perception and Cognition, Causal Productions, Sydney, Adelaide, 2002, pp. 580-583.

T. Jones, Evolutionary Algorithms, Fitness Landscapes and Search, 1995, 249 p. [Online]. Available at:

G.R. Harik, F.G. Lobo, “A parameter-less genetic algorithm,” in: Banzhaf W., Daida J.M., Eiben A.E., Garzon M.H., Honavar V. (eds.) Proceedings of the 1st Annual Conference on Genetic and Evolutionary Computation GECCO'99, 1999, pp. 258-265.

There is a Balm in Gilead. [Online]. Available at:

He Keeps me Singing. [Online]. Available at:

Moment by Moment. [Online]. Available at:

Jesus, Thy Boundless Love to Me. [Online]. Available at:




How to Cite

Komarov, O., Galchonkov, O., Nevrev, A., & Babilunga, O. (2020). THE USE OF A GENETIC ALGORITHM FOR MUSIC HARMONIZATION OF TRANSITIONAL FRAGMENTS IN COMPUTER GAMES. International Journal of Computing, 19(3), 365-376. Retrieved from