skip to main content

Effects of Temperature Sampling and Tempo Variation on LSTM-Based Music Generation

Universitas Hamzanwadi, Indonesia

Received: 17 Oct 2025; Revised: 17 Sep 2026; Accepted: 11 Nov 2026; Published: 19 Nov 2026.
Open Access Copyright (c) 2026 The authors. Published by Department of Informatics Universitas, Diponegoro
Creative Commons License This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Citation Format:
Abstract

Long Short-Term Memory (LSTM) models for symbolic music generation may produce repetitive sequences under deterministic decoding. This study examines how sampling temperature and externally imposed tempo variation affect the statistical characteristics of generated MIDI music. A factorial experiment combined four decoding settings (Argmax and temperature sampling at T = 0.6, 0.7, and 1.0) with fixed- and dynamic-tempo rendering. Using one trained LSTM checkpoint and controlled seeds, 40 MIDI files were generated across eight conditions, with five runs per condition. The dataset was split by MIDI file before sequence construction to reduce data leakage. Generated outputs were assessed using pitch entropy, repetition ratios, N-gram overlap, pitch-class distribution similarity, rhythmic diversity, and tempo statistics. At T = 1.0, mean pitch entropy was highest (5.57 ± 0.13 bits), immediate repetition lowest (0.10 ± 0.01), and Chroma Jensen-Shannon Divergence lowest (0.0244 ± 0.0163). Higher temperatures also reduced trigram overlap with the validation corpus, indicating a diversity-similarity trade-off. Dynamic-tempo rendering introduced timing variation without changing pitch-based metrics under matched sampling conditions. These results distinguish effects of token sampling from tempo rendering but do not establish perceptual musical quality.

Keywords: Neural music generation, Long Short-Term Memory, temperature sampling, dynamic tempo, MIDI, musical diversity

Article Metrics:

  1. Y. Zhang, “Using LSTM neural network to generate music,” Theoretical and Natural Science, vol. 19, no. 1, pp. 111–115, Dec. 2023. doi: 10.54254/2753-8818/19/20230512
  2. A. Joshi, A. Gokhale, A. Khandekar, A. Kesar, S. Khade, and N. Tarapore, “Music Generation Using Recurrent Neural Networks,” Int J Res Appl Sci Eng Technol, vol. 10, no. 12, pp. 1352–1358, Dec. 2022. doi: 10.22214/ijraset.2022.48200
  3. M. Conner, L. Gral, K. Adams, D. Hunger, R. Strelow, and A. Neuwirth, “Music Generation Using an LSTM,” arXiv, 2022. doi: 10.48550/arXiv.2203.12105
  4. N. Kotecha and P. Young, “Generating Music using an LSTM Network,” arXiv, 2018. doi: 10.48550/arXiv.1804.07300
  5. S. Mangal, R. Modak, and P. Joshi, “LSTM Based Music Generation System,” IARJSET, vol. 6, no. 5, pp. 47–54, May 2019, doi: 10.17148/IARJSET.2019.6508
  6. R. V. Uppuluri, “Music Generation Using Recurrent Neural Networks : An LSTM Approach to Melodic and Harmonic Composition,” International Journal of Research Publication and Reviews, no. 5, pp. 1623–1628, 2024. [Online]. Available: https://ijrpr.com/uploads/V5ISSUE10/IJRPR33995.pdf
  7. S. Oore, I. Simon, S. Dieleman, D. Eck, and K. Simonyan, “This time with feeling: learning expressive musical performance,” Neural Comput Appl, vol. 32, no. 4, pp. 955–967, Feb. 2020. doi: 10.1007/s00521-018-3758-9
  8. S. A. Fathima, S. Hariram, S. M. Kanagalingam, B. M. Nitish, and M. M. Muthu, “Neural Harmony: Advancing Composition with RNN-LSTM in Music Generation,” in 2024 IEEE International Conference on Contemporary Computing and Communications (InC4), IEEE, Mar. 2024, pp. 1–6. doi: 10.1109/InC460750.2024.10649223
  9. K. Soundarya, K. R. Pandik, S. Samsher, V. S. Kishore, and A. S. Lavanya, “Music Generation Using Recurrent Neural Network,” Journal of Nonlinear Analysis and Optimization, vol. 15, no. 02, pp. 913–919, 2024. doi: 10.36893/JNAO.2024.V15I2.142
  10. G. Keerti, A. Vaishnavi, P. Mukherjee, A. Vidya, G. S. Sreenithya, and D. Nayab, “Attentional networks for music generation,” Multimed Tools Appl, vol. 81, pp. 5179–5189, 2020. doi: 10.1007/s11042-021-11881-1
  11. D. Fudholi, D. N. A. Putri, R. B. M. A. A. Wijaya, J. E. Kusnadi, and J. C. Amarissa, “The Application of LSTM in the AI-Based Enhancement of Classical Compositions,” Journal of Informatics Information System Software Engineering and Applications (INISTA), 2024. doi: 10.20895/inista.v7i1.1628
  12. M. K. Jedrzejewska, A. Zjawinski, and B. Stasiak, “Generating Musical Expression of MIDI Music with LSTM Neural Network,” in 2018 11th International Conference on Human System Interaction (HSI), IEEE, Jul. 2018, pp. 132–138. doi: 10.1109/HSI.2018.8431033
  13. J. Huang, “Multitrack Symbolic Music Composition with LSTM-GAN,” 2022 2nd International Conference on Big Data, Artificial Intelligence and Risk Management (ICBAR), pp. 35–40, 2022. doi: 10.1109/ICBAR58199.2022.00014
  14. S. Chikkamath and S. R. Nirmala, “Melody generation using LSTM and BI-LSTM Network,” 2021 International Conference on Computational Intelligence and Computing Applications (ICCICA), pp. 1–6, 2021. doi: 10.1109/iccica52458.2021.9697286
  15. B. Nag, A. I. Middya, and S. Roy, “Melody generation based on deep ensemble learning using varying temporal context length,” Multim. Tools Appl., vol. 83, pp. 69647–69668, 2024. doi: 10.1007/s11042-024-18270-4
  16. A. Dhar and A. Victor, “Neural Harmony: Advancing Polyphonic Music Generation and Genre Classification through LSTM-Based Networks,” 2024 IEEE International Conference on Electronics, Computing and Communication Technologies (CONECCT), pp. 1–6, 2024. doi: 10.1109/CONECCT62155.2024.10677254
  17. A. Elmsley, T. Weyde, and N. Armstrong, “Generating Time: Rhythmic Perception, Prediction and Production with Recurrent Neural Networks,” vol. 1, 2017. doi: 10.5920/JCMS.2017.04
  18. A. Ycart and E. Benetos, “Learning and Evaluation Methodologies for Polyphonic Music Sequence Prediction With LSTMs,” IEEE/ACM Trans Audio Speech Lang Process, vol. 28, pp. 1328–1341, 2020, doi: 10.1109/TASLP.2020.2987130
  19. S. Chakraborty, S. Kishor, S. Patil, and J. Timoney, “LeaderSTeM-A LSTM model for dynamic leader identification within musical streams,” Zenodo, 2020. doi: 10.5281/zenodo.4285378
  20. Y. Huang, X. Huang, and Q. Cai, “Music Generation Based on Convolution-LSTM,” Computer and Information Science, vol. 11, no. 3, p. 50, Jun. 2018, doi: 10.5539/cis.v11n3p50
  21. K. Gupta, K. Srivastava, K. Singh, and R. Pillai, “Music Generation and Retrieval Using LSTM and VAE,” in 2023 14th International Conference on Computing Communication and Networking Technologies (ICCCNT), IEEE, Jul. 2023, pp. 1–6. doi: 10.1109/ICCCNT56998.2023.10307558
  22. A. Agarwal, “Application of Music Retrieval & Generation,” International Journal Of Scientific Research In Engineering And Management, vol. 08, no. 05, pp. 1–5, May 2024. doi: 10.55041/IJSREM34003
  23. J. Liu, “Expressive Music Data Processing and Generation,” arXiv, 2025. doi: 10.48550/arXiv.2503.11896
  24. D. Evangeline, M. Bhuvan, A. Parkavi, A. Manikarnike, M. Harikrishnan, and B. S. Adiga, “Automated Music Synthesis Using Recurrent Neural Network and Long Short Term Memory,” in 2023 International Conference on New Frontiers in Communication, Automation, Management and Security (ICCAMS), IEEE, Oct. 2023. doi: 10.1109/ICCAMS60113.2023.10525888
  25. A. A. S. Gunawan, A. P. Iman, and D. Suhartono, “Automatic music generator using recurrent neural network,” International Journal of Computational Intelligence Systems, vol. 13, no. 1, pp. 645–654, 2020. doi: 10.2991/ijcis.d.200519.001
  26. M. Djamaluddin, I. Fathurrahman, and M. N. Wathani, “Pengembangan Model Deep Learning Long Short-Term Memory untuk Generasi Musik Berbasis Data MIDI [Development of a Long Short-Term Memory Deep Learning Model for Music Generation Based on MIDI Data],” Infotek: Jurnal Informatika dan Teknologi, vol. 9, no. 1, pp. 197–208, Jan. 2026, doi: 10.29408/jit.v9i1.33165

Last update:

No citation recorded.

Last update: 2026-11-19 13:57:10

No citation recorded.