NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Automated composition of Galician Xota - tuning RNN-based composers for specific musical styles using deep Q-learning

Rodrigo Mira, Eduardo Coutinho, Emilia Parada-Cabaleiro, Björn W. SchullerPeerJ Comput. Sci 2023 · DOI

TL;DR

This paper tackles the challenge of generating music that not only sounds good but also adheres to a specific musical style, the Galician Xota. They achieve this by extending Google Magenta's RL Tuner with a custom rule-set derived from musicological analysis, demonstrating that combining genre-specific rules with general music principles leads to more stylistically accurate and perceptually pleasing compositions.

What Problem Does This Paper Address?

Automating music composition is a long-standing challenge, with many existing methods struggling to produce outputs that are both musically coherent and stylistically consistent. A common issue is the lack of discernible style and structure, leading to compositions that sound generic or repetitive. While deep learning models like RNNs have shown promise, they often fail to capture the nuances of specific musical genres. This paper aims to bridge this gap by developing an automated system capable of composing music in the distinct style of the Galician Xota, a traditional Spanish folk dance.

Methods

The core of this work builds upon Google Magenta's RL Tuner, a system that uses Deep Q-Learning to fine-tune RNN-based music composers. The authors introduce a novel approach by:

  • Developing a Genre-Specific Rule-Set: They conducted a musicological analysis of the Galician Xota to identify its characteristic rhythmic and melodic patterns, structural elements (like the volta and punto sections), and harmonic tendencies. This analysis was translated into a set of computational rules designed to enforce these stylistic features.
  • Combining Rule-Sets: To balance genre-specific adherence with general musical principles, they created three rule-sets:
  • Magenta Rule-set: Based on general music theory rules from the original RL Tuner.
  • Xota Rule-set: Composed entirely of rules derived from the Galician Xota analysis.
  • Magenta+Xota Rule-set: A hybrid set combining rules from both the Magenta and Xota rule-sets, excluding rules deemed incompatible.
  • Fine-tuning RNNs with Deep Q-Learning: Pre-trained RNN models (Magenta Basic RNN, Xota Basic RNN, and a re-trained Magenta+Xota Basic RNN) were then fine-tuned using the RL Tuner with these different rule-sets. The RL Tuner acts as an agent that learns to compose music by receiving rewards based on how well the generated music adheres to the defined rules.

Datasets

  • Magenta Dataset: A large dataset of MIDI files used to train the original Magenta models, encompassing various genres and styles.
  • Xota Dataset: A newly curated dataset of 712 monophonic MIDI files specifically featuring the Galician Xota genre. This dataset was augmented by transposing pieces to increase its size and diversity.

Key Insights and Ideas

  • The Power of Genre-Specific Rules: The study strongly suggests that incorporating rules derived from detailed musicological analysis of a specific genre is crucial for achieving stylistically accurate compositions. The Xota rule-set, when applied, significantly improved the adherence to the Galician Xota style.
  • Hybrid Rule-Sets Outperform: Combining general music theory rules with genre-specific ones (the Magenta+Xota rule-set) yielded the best results, indicating that a balanced approach is more effective than relying solely on one type of rule.
  • RL Tuning's Impact Varies: While RL tuning generally improved performance, its effectiveness was dependent on the initial state of the RNN and the rule-set used. Models that were already performing well on certain rules (e.g., Xota RNN on its own rules) showed less improvement, while those with weaker initial performance saw greater gains.
  • Rule Design Matters: The complexity and frequency of rule application significantly influence learning. Rules that are too complex or too infrequent are harder for the RL agent to learn, suggesting that careful rule design is as important as the RL algorithm itself.
  • Subjective Evaluation is Key: Objective metrics are valuable, but a subjective evaluation by an expert musicologist revealed that while rule-based tuning can improve structure, it can sometimes detract from the natural musicality if applied too rigidly.

Key Results

  • Objective Performance: The Magenta+Xota rule-set, when applied to models fine-tuned on the Xota dataset (M.3 and MX.3), showed the most significant improvements in adherence to the Xota rules, with average scores increasing by up to 30% compared to pre-RL performance.
  • Subjective Performance: The Magenta+Xota Basic RNN (MX) fine-tuned with the Xota rule-set achieved the highest overall scores in the subjective evaluation, indicating the most perceptually pleasing and stylistically accurate compositions.
  • Magenta Rule-set Limitations: The Magenta rule-set alone, even when applied to models trained on broader datasets, sometimes resulted in compositions that were perceptually worse than the pre-RL versions, suggesting it might be too restrictive.
  • Xota RNN Performance: The Xota Basic RNN (X.0) showed high objective scores on its own rules before RL tuning, but its subjective musicality was lower, suggesting it followed rules but lacked natural flow, possibly due to dataset size.

Limitations and Future Work

  • Dataset Size: The relatively small size of the Xota dataset is acknowledged as a potential overfitting factor, which could limit the flexibility of the trained RNNs.
  • Rule Complexity and Infrequency: Complex or infrequently applied rules proved challenging for the Deep Q Network to learn effectively, impacting their influence on the final compositions.
  • Future Work:
    • Inverse Reinforcement Learning (IRL): Exploring IRL techniques to automate the reward tuning process, which is currently time-consuming.
  • Emotional Rule-Sets: Developing rule-sets that go beyond musical structure to convey emotional meaning, aiming to steer composers towards specific emotional profiles.
  • Improving Motif Generation: Designing more effective rules to encourage consistent and repeated musical motifs, which are identified as crucial for characterizing the Galician Xota.

Summary updated

BibTeX
@article{mira2023automated,
  author = {Rodrigo Mira and Eduardo Coutinho and Emilia Parada-Cabaleiro and Björn W. Schuller},
  title = {{Automated composition of Galician Xota - tuning RNN-based composers for specific musical styles using deep Q-learning}},
  journal = {PeerJ Comput. Sci.},
  year = {2023},
  doi = {10.7717/peerj-cs.1356},
}
Figure