用音乐结构信息优化注意力,让AI作曲更自然不重复。
Musical Attention Transformer: Music Generation Using a Music-Specific Attention Model

- 将小节、调性、速度等音乐元信息融入注意力机制
- 生成旋律重复率显著降低,音符多样性与和声一致性提升
- 适合需要高质量音乐生成的创作者或音乐科技研究者
本研究旨在通过引入元信息提升基于Transformer的音乐生成质量。尽管Transformer能有效捕捉乐曲的长程依赖关系,但生成的音乐常出现音符过度重复或冗余,导致旋律不自然。为此,我们提出音乐注意力(Musical Attention)机制,将小节号、调性、拍号、速度等元信息融入注意力计算过程。在框架中,每个音符由五个事件(音高、小节号、起始时间、持续时间、力度)和三个元数据共同表征,共八维特征。注意力机制据此建模这八类特征间的相关性,使模型更精准把握音乐结构特性。实验表明,该模型在音乐连贯性、变化性和整体质量上优于全注意力与分块注意力方法,显著减少重复现象,增强生成旋律的多样性与和声一致性。音乐注意力为人工智能音乐生成提供了重要进展,有助于创作更自然、富有表现力的作品。
原文摘要 · Abstract (English)
This study aims to enhance the quality of music generation using Transformers by incorporating meta-information. While Transformer-based approaches are effective at capturing long-term dependencies in musical compositions, the music they generate often suffers from issues such as excessive repetition or duplication of notes, leading to unnatural melodies. To address these limitations, we propose Musical Attention, a mechanism that incorporates meta-information such as bar numbers, key, signatures, and tempos into the attention process. Musical Attention explicitly leverages both the structural properties of music and its associated metadata, enabling the Transformer's attention mechanism to operate more effectively and thereby improving the quality of the generated output. In our framework, each musical note is represented as a combination of five events-pitch, bar number, onset, duration, and velocity in addition to the three metadata elements. The attention mechanism is then modified to reflect the correlations among these eight features, allowing the model to better capture the inherent characteristics of musical composition. Experimental results demonstrate that the model incorporating Musical Attention outperforms prior methods, such as Full Attention and Strided Attention, in terms of musical coherence, variation, and overall quality. Notably, it significantly reduces repetition and enhances the model's ability to generate diverse, harmonically consistent melodies. Musical Attention thus represents a meaningful advancement in AI-driven music generation, facilitating the creation of more natural and expressive compositions.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。