MIDI-Based Music Generation via Gated Recurrent Units

Authors

  • Abdurrahim Hüseyin Ezirmik Department of Computer Engineering, Balıkesir University Author

DOI:

https://doi.org/10.56158/jcosml.2026.1.02.9

Keywords:

Deep learning, Recurrent neural networks, GRU, Music information retrieval, MIDI

Abstract

Recent advances in artificial intelligence have increased interest in the application of deep learning to automated music composition. In this study, a Gated Recurrent Unit (GRU) network was employed to generate instrumental music in MIDI format using an unsupervised learning approach. The model was trained on sound data to learn musical patterns and generate new note sequences. The generated MIDI files were visualized using piano roll representations to examine their pitch distributions, temporal patterns, and note densities. The results revealed differences between single-note-based and randomly initialized generation approaches. Single-note-based generation exhibited a more concentrated pitch distribution and a relatively regular temporal structure, whereas random initialization resulted in a broader and less uniform distribution of notes across pitch and time. These findings illustrate how the initialization strategy can influence the structural characteristics of GRU-generated MIDI sequences and demonstrate the potential of recurrent neural networks for automated instrumental music generation.

References

References

[1] Hang Chen, Qian Xiang, Jiaxin Hu, Meilin Ye, Chao Yu, Hao Cheng, and Lei Zhang. Comprehensive exploration of diffusion

models in image generation: a survey: H. chen et al. Artificial Intelligence Review, 58(4):99, 2025.

[2] Yupian Lin, Tong Ruan, Jingping Liu, and Haofen Wang. A survey on neural data-to-text generation. IEEE Transactions on

Knowledge and Data Engineering, 36(4):1431–1449, 2023.

[3] Lijun Wei, Yuanyu Yu, Yuping Qin, and Shuang Zhang. From tools to creators: A review on the development and application of

artificial intelligence music generation. Information, 16(8):656, 2025.

[4] Yue Fu, Michele Newman, Lewis Going, Qiuzi Feng, and Jin Ha Lee. Exploring the collaborative co-creation process with ai:

A case study in novice music production. In Proceedings of the 2025 ACM Designing Interactive Systems Conference, pages

1298–1312, 2025.

[5] Paul D Lehrman and Tim Tully. What is midi? MIDI for the Professional. Amsco Publications, 2017.

[6] Jim Heckroth. A tutorial on midi and wavetable music synthesis. Application Note, CRYSTAL a division of CIRRUS LOGIC, 1998.

[7] David Samuel and Martin Pilát. Composing multi-instrumental music with recurrent neural networks. In 2019 international joint

conference on neural networks (IJCNN), pages 1–8. IEEE, 2019.

[8] Jean-Pierre Briot and François Pachet. Deep learning for music generation: challenges and directions. Neural Computing and

Applications, 32(4):981–993, 2020.

[9] Adrien Ycart, Emmanouil Benetos, et al. A study on lstm networks for polyphonic music sequence modelling. ISMIR, 2017.

[10] Nipun Kulshrestha. Use of Deep Learning methods such as LSTM and GRU in polyphonic music generation. PhD thesis, Dublin,

National College of Ireland, 2020.

[11] Sanidhya Mangal, Rahul Modak, and Poorva Joshi. Lstm based music generation system. arXiv preprint arXiv:1908.01080, 2019.

[12] Fangzhu Jin, Peng Li, and Xiaojun Wu. A theme music generation model based on hybrid variational autoencoders and conditional

generative adversarial networks. Engineering Applications of Artificial Intelligence, 161:112131, 2025.

[13] Lianyu Zhou, Liang Yin, Yukun Qian, Changjun He, Heng Li, and Mingjiang Wang. Esmg: An efficient llm-based symbolic music

generation model with discrete piano-roll tokens. Neurocomputing, page 135133, 2026.

[14] Curtis Hawthorne, Ian Simon, Rigel Swavely, Ethan Manilow, and Jesse Engel. Sequence-to-sequence piano transcription with

transformers. arXiv preprint arXiv:2107.09142, 2021.

[15] Man Zhang. Advancing deep learning for expressive music composition and performance modeling. Scientific Reports, 15(1):

28007, 2025.

© 2026 The Author(s). Published by JCoSML. Open access under CC BY-NC 4.0. 11

JCoSML · Journal of Computational Optimization and Scientific Machine Learning 1(2) 2026, 17–29

[16] Dan Teodor Avramescu, Paul Stefan Popescu, Mihai Mocanu, and Marian Cristian Mihaescu. Automatic music transcription by

deep learning. International Journal of User-System Interaction, 14(3):87–100, 2021.

[17] Colin Raffel and Daniel P. W. Ellis. Intuitive analysis, creation and manipulation of midi data with pretty_midi. In Proceedings of

the 15th International Society for Music Information Retrieval Conference Late Breaking and Demo Papers, 2014.

[18] Xianchao Wu, Chengyuan Wang, and Qinying Lei. Transformer-xl based music generation with multiple sequences of time-valued

notes. arXiv preprint arXiv:2007.07244, 2020.

[19] Robert Ciesla. Midi and composing in the digital age. In Sound and Music for Games: The Basics of Digital Audio for Video

Games, pages 147–185. Springer, 2022.

[20] Taegyun Kwon, Dasaem Jeong, and Juhan Nam. Audio-to-score alignment of piano music using rnn-based automatic music

transcription. arXiv preprint arXiv:1711.04480, 2017.

[21] Hans Petter Langtangen. Dictionaries and strings. In A Primer on Scientific Programming with Python, pages 333–408. Springer,

2016.

[22] Barathi Subramanian, Rathinaraja Jeyaraj, and Anand Paul. Contrast-enhanced gating in grus for robust low-data sequence learning.

In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 613–622, 2026.

[23] Alexander Agung Santoso Gunawan, Ananda Phan Iman, and Derwin Suhartono. Automatic music generator using recurrent

neural network. International Journal of Computational Intelligence Systems, 13(1):645–654, 2020.

[24] Shudong Yang, Xueying Yu, and Ying Zhou. Lstm and gru neural network performance comparison study: Taking yelp review

dataset as an example. In 2020 International workshop on electronic communication and artificial intelligence (IWECAI), pages

98–101. IEEE, 2020.

[25] Aston Zhang, Zachary C Lipton, Mu Li, and Alexander J Smola. Dive into deep learning. Cambridge University Press, 2023.

[26] Md Ahnaf Zahin. Multi-headed self-attention mechanism-based transformer model for predicting bus travel times across multiple

bus routes using heterogeneous datasets. Master’s thesis, University of Missouri-Columbia, 2023.

[27] Ali Kianfar, Parvin Razzaghi, and Zahra Asgari. Integrating convolutional layers and biformer network with forward-forward and

backpropagation training. Scientific Reports, 15(1):7230, 2025.

[28] Christian Walder. Modelling symbolic music: Beyond the piano roll. In Asian conference on machine learning, pages 174–189.

PMLR, 2016.

Downloads

Published

2026-12-04

Issue

Section

Research Articles