摘要: 针对符号音乐生成模型在多轨编配任务中难以充分刻画乐器轨道间和声关系、节奏组织和音乐理论约束的问题,提出一种融合美学计算与混合学习的多轨音乐生成模型(HL-MTMG)。现有符号音乐生成方法多侧重音符序列建模或通用可控生成,能够在一定程度上学习音乐数据分布,但在钢琴、吉他、贝斯等多轨乐器共同生成场景中,仍容易出现轨道间和声关系松散、节奏结构不稳定、重复音符比例偏高以及旋律音高控制不足等问题。为提升多轨生成结果的协调性和艺术表现力,HL-MTMG从音乐美学计算角度出发,将跨轨道协同建模与音乐理论规则约束结合起来,使模型既能学习单条轨道内部的序列规律,又能建模不同乐器轨道之间的交互关系。在技术实现方面,HL-MTMG主要由混合学习模块和奖励反馈网络组成。混合学习模块同时引入掩蔽自注意力机制和跨轨道注意力机制,其中掩蔽自注意力机制用于学习单轨内部的时序依赖关系,跨轨道注意力机制用于计算钢琴、吉他和贝斯轨道之间的相关性,从而增强模型对多轨协同关系的表达能力。奖励反馈网络基于生成对抗学习思想构建,将旋律音高范围约束和音符重复抑制规则转化为奖励信号,并与交叉熵损失共同作用于训练过程,引导生成器在学习数据分布的同时保持较好的旋律规范性和和声合理性。实验使用Lakh MIDI数据集构建三轨符号音乐实验子集。数据预处理阶段筛选同时包含钢琴、吉他和贝斯音轨的流行音乐MIDI文件,并进行轨道映射、节拍对齐、异常样本剔除和4小节切分,最终得到11,840条三轨音乐片段。为避免数据泄漏,实验以原始MIDI文件为单位进行划分,并按照8∶1∶1的比例构建训练集、验证集和测试集。所有对比模型和消融模型均采用相同的数据划分方式、输入表示、生成长度和评价流程。为进一步验证泛化能力,本文还构建包含300条外部三轨音乐片段的External-MIDI测试集,用于检验模型在非训练数据来源上的适应能力。实验将HL-MTMG与MuseGAN、HRNN、XMusic三种代表性基线模型以及三种消融变体进行对比。客观结果显示,HL-MTMG在主实验中取得0.61的和弦匹配度和0.72的和谐度,整体高于所选对比模型和消融变体。在音符特征方面,HL-MTMG的三个连续音符数与总音符数之比(NCTN)为0.22,低于其他模型;同时,该模型在有效节拍内音符出现频率(QR)、音高类别数(UPC)和复音率(PP)上分别达到0.47、0.72和0.64,表明其在节奏组织、音高丰富性和多轨复音表现方面具有较好效果。在External-MIDI测试集上,HL-MTMG的和弦匹配度、和谐度、NCTN、QR、UPC和PP分别为0.56、0.67、0.25、0.45、0.68和0.60,说明其在外部数据来源上仍能保持相对稳定的生成质量。主观评价方面,实验邀请10位专业作曲家和90位音乐爱好者对生成结果进行评分。音乐爱好者评价结果显示,HL-MTMG在旋律、音乐形式和可听性维度上的得分分别为7.87、8.17和7.47;专业作曲家评价结果显示,HL-MTMG在和弦、音程、和声、音高和音乐风格五个维度上的得分分别为6.6、7.6、7.8、7.4和9.1。Kendall协调系数检验结果表明,节奏、旋律、完整性、音乐形式、可听性和流畅性六个维度的Kendall’s W分别为0.74、0.81、0.76、0.79、0.72和0.75,且均达到显著水平,说明主观评分具有较高一致性。综合实验结果表明,跨轨道注意力机制能够增强模型对钢琴、吉他和贝斯之间协同关系的建模能力,音乐理论奖励反馈能够改善旋律音高控制和重复音符抑制效果。HL-MTMG在所构建的三轨符号音乐生成任务中能够提升生成结果的和声协调性、节奏组织能力和部分主观评价表现,为多轨音乐生成中引入美学计算和音乐理论规则提供了一种可行思路。当前实验主要面向固定三轨、固定长度的符号音乐片段,未来仍需在更多乐器组合、音乐风格和长结构音乐生成任务中进一步验证模型的适应性。
Abstract: To address the problem that symbolic music generation models often fail to adequately capture harmonic relationships, rhythmic organization, and music-theoretical constraints among different instrument tracks in multi-track arrangement tasks, this paper proposes a multi-track music generation model integrating aesthetic computing and hybrid learning, namely HL-MTMG. Existing symbolic music generation methods mainly focus on note sequence modeling or general controllable generation. Although these methods can learn the distribution of music data to a certain extent, they still tend to produce loose harmonic relationships, unstable rhythmic structures, excessive repeated notes, and insufficient pitch control when generating multi-track music involving piano, guitar, and bass. To improve the coordination and artistic expressiveness of generated multi-track music, HL-MTMG combines cross-track collaborative modeling with music-theoretical rule constraints from the perspective of music aesthetic computing, enabling the model to learn both the internal sequential patterns of individual tracks and the interactions among different instrument tracks. Technically, HL-MTMG consists of a hybrid learning module and a reward feedback network. The hybrid learning module introduces both masked self-attention and cross-track attention mechanisms. The masked self-attention mechanism is used to learn temporal dependencies within each single track, while the cross-track attention mechanism calculates the correlations among piano, guitar, and bass tracks, thereby enhancing the model’s ability to represent multi-track collaborative relationships. The reward feedback network is constructed based on the idea of generative adversarial learning. It converts melodic pitch-range constraints and note repetition suppression rules into reward signals, which are combined with the cross-entropy loss during training. In this way, the generator is guided to learn the data distribution while maintaining better melodic regularity and harmonic rationality. Experiments are conducted on a three-track symbolic music subset constructed from the Lakh MIDI dataset. During data preprocessing, pop MIDI files containing piano, guitar, and bass tracks are selected, followed by track mapping, beat alignment, abnormal sample removal, and four-bar segmentation. Finally, 11,840 three-track music segments are obtained. To avoid data leakage, the dataset is divided at the original MIDI-file level rather than at the segment level, and the training, validation, and test sets are constructed at a ratio of 8:1:1. All comparison models and ablation models adopt the same data split, input representation, generation length, and evaluation procedure. To further evaluate the generalization ability of the proposed model, an External-MIDI test set containing 300 external three-track music segments is also constructed to examine its adaptability to non-training data sources. HL-MTMG is compared with three representative baseline models, namely MuseGAN, HRNN, and XMusic, as well as three ablation variants. Objective evaluation results show that HL-MTMG achieves a chord matching degree of 0.61 and a harmonious degree of 0.72 in the main experiment, outperforming the selected comparison models and ablation variants overall. In terms of note-level features, the ratio of three consecutive notes to the total number of notes (NCTN) of HL-MTMG is 0.22, which is lower than that of the other models. Meanwhile, the model achieves 0.47, 0.72, and 0.64 on qualified rhythm (QR), used pitch classes (UPC), and polyphonicity (PP), respectively, indicating better rhythmic organization, pitch richness, and multi-track polyphonic performance. On the External-MIDI test set, HL-MTMG obtains 0.56, 0.67, 0.25, 0.45, 0.68, and 0.60 in chord matching degree, harmonious degree, NCTN, QR, UPC, and PP, respectively, showing that the model can still maintain relatively stable generation quality on external data sources. For subjective evaluation, 10 professional composers and 90 music enthusiasts are invited to rate the generated results. The evaluation by music enthusiasts shows that HL-MTMG obtains scores of 7.87, 8.17, and 7.47 in melody, music form, and audibility, respectively. The professional composers’ evaluation shows that HL-MTMG achieves scores of 6.6, 7.6, 7.8, 7.4, and 9.1 in chord, interval, harmony, pitch, and music style, respectively. The Kendall’s coefficient of concordance test further shows that the Kendall’s W values for rhythm, melody, integrity, music form, audibility, and fluency are 0.74, 0.81, 0.76, 0.79, 0.72, and 0.75, respectively, all reaching a significant level, indicating a high degree of consistency in the subjective ratings. The experimental results demonstrate that the cross-track attention mechanism can enhance the model’s ability to capture collaborative relationships among piano, guitar, and bass, while the music-theoretical reward feedback helps improve melodic pitch control and repeated-note suppression. In the constructed three-track symbolic music generation task, HL-MTMG improves harmonic coordination, rhythmic organization, and several subjective evaluation dimensions of the generated results, providing a feasible approach for introducing aesthetic computing and music-theoretical rules into multi-track music generation. The current experiments are mainly conducted on fixed-length symbolic music segments with three fixed tracks. Future work will further verify the adaptability of the model in more instrument combinations, music styles, and long-structure music generation tasks.
马军, 侯雪娜, 赵静阁, 李小兵, 高妍, 周晴雯, 帖云. 融合美学计算与混合学习的多轨音乐生成研究[J]. 计算机工程, doi: 10.19678/j.issn.1000-3428.0260313.
Ma Jun, Hou Xuena, Zhao Jingge, Li Xiaobing, Gao Yan, Zhou Qingwen, Tie Yun. Research on Multi-track Music Generation Integrating Music Aesthetic Computing and Hybrid Learning[J]. Computer Engineering, doi: 10.19678/j.issn.1000-3428.0260313.