Purpose – The purpose of this paper is to propose an algorithm that is based on the ant colony optimization (ACO) metaheuristic for producing harmonized melodies. ACO is a nature inspired metaheuristic where a colony of ants searches for an optimum of a function. The algorithm works in two stages. In the first stage it creates a melody. The obtained melody is then harmonized according to the rules of baroque harmony in the second stage. A multi‐objective version of the algorithm is also proposed, where each tier is optimized as a separate objective. Design/methodology/approach – The ACO metaheuristic is adapted to graphs representing notes and chords. Desirability of a sequence of notes is measured by conformance to compositional rules. The fitness of a melody is evaluated with five equally weighted rules governing smoothness of the melody curve, its contour, tendency tone resolution, tone colors and the pitch of the final note. Harmonization is guided by six rules, grouped into three tiers of two rules each. These rules cover chord arrangement, voice distance, voice leading, harmonic progression, smoothness, and chord resolution. Rules of a tier do not score unless those of the previous tier yield high values. Findings – The proposed algorithm improves on the only other existing musical ACO by adding the notion of harmony and by evolving voices codependently. The output is comparable to different types of other existing algorithms (genetic algorithm, rule‐based search algorithm) in the field. The multi‐objective variant significantly enhances solution quality and convergence speed, which makes extensions of the system for real time performance realistic. Originality/value – This algorithm is the first ACO algorithm proposed for the problem of melody creation and harmonization.
International Journal of Intelligent Computing and Cybernetics – Emerald Publishing
Published: Jun 6, 2008
Keywords: Optimization techniques; Programming and algorithm theory; Music; Computer applications