Abstract
This paper presents a novel approach to genetic algorithms (GAs) in music composition through trajectory-based fitness evaluation. By utilizing cubic Bézier curves to define high-level compositional structures—such as rhythmic density and instrument interaction—the system overcomes the traditional "fitness bottleneck" of subjective human evaluation and rigid objective rules. Experimental results demonstrate that GAs can effectively evolve rhythmic patterns that adhere to these user-defined artistic arcs.
Introduction
Genetic algorithms (GAs) in music composition frequently encounter the "fitness bottleneck." Traditional evaluation methods typically fall into two categories: subjective evaluation, which suffers from human evaluator fatigue and inconsistency, and objective evaluation, which relies on static, hard-coded rules that often produce either chaotic or overly simplistic results. This research proposes a middle ground: allowing users to define high-level trajectories that guide the evolution of an entire piece, bridging the gap between human artistic intent and computational efficiency.
Methodology
The core of this approach is the representation of a rhythmic "individual" as a 2D matrix where one axis represents instruments and the other represents time. Fitness is evaluated based on two primary trajectory types:
- Column Trajectories: These define the temporal evolution of specific features, such as "Temporal Beat Density." Users specify the start and end values along with two control points to generate a cubic Bézier curve. The GA calculates fitness by measuring the squared difference between the actual feature value and the curve's target value at any given point in time.
- Row Trajectories: These govern the relationships between instruments. Examples include "Unison" (forcing instruments to play identical parts) and "Double Rhythms" (allowing parts to be circularly shifted in time). By designating a "master row," the system enables one instrument to lead while others follow, mimicking real-world musical dynamics.
Experimental Setup
The system was evaluated using four controlled test sets, each consisting of 20 unique iterations over 50 generations to evolve 8-beat patterns for 4 instruments:
- Test 1: Temporal Beat Density only.
- Test 2: Density combined with Unison trajectories.
- Test 3: Density combined with Double Rhythms trajectories.
- Test 4: A combination of all three applied across different instrument rows.
Results and Discussion
The study confirmed that the GA could successfully navigate the search space to satisfy user-defined trajectories. While single trajectories (beat density) were the easiest to solve, the system remained robust even when interaction rules were added.
Notably, a "Complexity Paradox" was observed: although "Double Rhythms" presents a mathematically larger search space than "Unison," the GA solved both with similar efficiency. This suggests that for standard rhythmic patterns, search space size is not the primary hurdle for the GA. This methodology essentially treats music composition like graphic design; a composer can "draw" the tension and release of a song, and the GA fills in the notes to match that curve.
Conclusion
Trajectory-based evaluation offers a viable alternative to manual human rating, providing a way to automate the "master" composer's intent. However, limitations remain regarding pattern length and the computational cost of longer structures. Future work will explore relative weighting of trajectories and Pareto-optimal comparisons to ensure a diverse range of musical outputs, preventing the GA from converging on a single "perfect" but repetitive pattern.
Summary updated