Incorporating Structure and Chord Constraints in Symbolic Transformer-based Melodic Harmonization

📅 2025-12-08
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This study addresses the chord-alignment problem in melodic harmonization—a core task in symbolic music generation—where predefined chord constraints must be strictly satisfied at specified metrical positions. To ensure beat-level adherence to input chords while maintaining computational efficiency, we propose a novel method integrating structured constraints with search-based optimization. Specifically, we design a B* algorithm that uniquely unifies beam search, A* heuristic search, and backtracking, enabling precise constraint satisfaction per beat and effective pruning. Built upon a pretrained Transformer architecture, our approach performs end-to-end controllable harmonization conditioned on both the input melody and its beat-aligned chord sequence. Experiments demonstrate its feasibility and high constraint fidelity. Although the algorithm exhibits theoretical exponential time complexity, it establishes a foundational paradigm and empirical basis for developing scalable, heuristic-driven harmonization methods.

Technology Category

Application Category

📝 Abstract
Transformer architectures offer significant advantages regarding the generation of symbolic music; their capabilities for incorporating user preferences toward what they generate is being studied under many aspects. This paper studies the inclusion of predefined chord constraints in melodic harmonization, i.e., where a desired chord at a specific location is provided along with the melody as inputs and the autoregressive transformer model needs to incorporate the chord in the harmonization that it generates. The peculiarities of involving such constraints is discussed and an algorithm is proposed for tackling this task. This algorithm is called B* and it combines aspects of beam search and A* along with backtracking to force pretrained transformers to satisfy the chord constraints, at the correct onset position within the correct bar. The algorithm is brute-force and has exponential complexity in the worst case; however, this paper is a first attempt to highlight the difficulties of the problem and proposes an algorithm that offers many possibilities for improvements since it accommodates the involvement of heuristics.
Problem

Research questions and friction points this paper is trying to address.

Incorporating chord constraints in symbolic melodic harmonization
Forcing pretrained transformers to satisfy chord constraints at correct positions
Proposing B* algorithm to handle chord constraints with backtracking
Innovation

Methods, ideas, or system contributions that make the work stand out.

B* algorithm combines beam search and A* with backtracking
Forces pretrained transformers to satisfy chord constraints
Incorporates chord constraints at correct onset and bar positions
🔎 Similar Papers
No similar papers found.