Abstract
PurposeThe 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/approachThe 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.FindingsThe 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/valueThis algorithm is the first ACO algorithm proposed for the problem of melody creation and harmonization.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have