Music composition is now appealing to both musicians and non-musicians equally. It branches into various musical tasks such as the generation of melody, accompaniment, or rhythm. This paper discusses the top ten artificial intelligence algorithms with applications in computer music composition from 2010 to 2020. We give an analysis of each algorithm and highlight its recent applications in music composition tasks, shedding the light on its strengths and weaknesses. Our study gives an insight on the most suitable algorithm for each musical task, such as rule-based systems for music theory representation, case-based reasoning for capturing previous musical experiences, Markov chains for melody generation, generative grammars for fast composition of musical pieces that comply to music rules, and linear programming for timbre synthesis. Additionally, there are biologically inspired algorithms such as: genetic algorithms, and algorithms used by artificial immune systems and artificial neural networks, including shallow neural networks, deep neural networks, and generative adversarial networks. These relatively new algorithms are currently heavily used in performing numerous music composition tasks.