Skip to content
Open access

Neural network monophonic melody generation with RNN, LSTM and GAN architectures

Sep 2026 · Scientific Reports · 0 citations

TL;DR

The study found that, tanh activation function led to higher accuracy and lower loss compared to softmax function in generating melodies, and the comparative analysis of the 3 networks prove that, RNN-LSTM has the best accuracy.

Abstract

Music is an expression of emotion and a universal language that connects people across various cultures. From timeless classical pieces to modern electronic beats, artificial intelligence is capable of composing, arranging, and even crafting refined musical arrangements in a wide variety of styles. This study, trains and develops an automated model to create melodies, on the monophonic genre specific datasets that serve as inputs to the Melody Generative System (MGS) to generate and compose melody automatically. To accomplish this, Recurrent Neural Network (RNN), Long Short-Term Memory (LSTM) network and Generative Adversarial Network (GAN) was used. To train the model, we used musical datasets, in Kern and MIDI formats primarily featuring solo piano compositions. Here, the Kern dataset uses specific text based notations to represent musical elements, whereas MIDI is a format containing information about musical performance data like notes and duration. This article also compares the results obtained from three different architectures using different activation functions, distinctly tanh and softmax. The study found that, tanh activation function led to higher accuracy and lower loss compared to softmax function in generating melodies. The comparative analysis of the 3 networks prove that, RNN-LSTM has the best accuracy of 98.39% for 80 − 20 train-test-split. Whereas, the performance of GAN network fell short compared to Simple RNN and RNN-LSTM when trained with both Kern and MIDI datasets. This study showcases the capabilities of different melody generation algorithms for generating monophonic melodies, and also demonstrates how deep learning can effectively recognize and replicate musical patterns.

Read PDF

Similar papers

#reinforcement learning Open access Oct 2026

Research on deep reinforcement learning-driven music melody generation algorithms

A novel hybrid melody-generation framework which integrates a Variational Autoencoder (VAE) with Reinforcement Learning (RL) through Proximal Policy Optimization (PPO) to enhance musical structure, coherence, and statistical expressiveness. For the purpose of providing a clean training corpus, the Lakh MIDI Dataset Cle...

Kui Su · 0 citations
Open access 2026

African Beats and Lyrics Composition Using Recurrent Neural Networks and Transformer-Based Models

Human music composition frequently struggles with challenges such as ensuring originality, maintaining lyrical coherence, and managing elaborate polyrhythms. These difficulties are particularly evident in African music, which is characterized by complex rhythms, call and response structures, rhythmic improvisation, and...

Olajide Adegunwa, O. Awodele, Adeniyi Akanni · 0 citations
Preprint Sep 2026

Composer2Vec: A Continuous Embedding Space of Composer Style Learned from Symbolic Melody Generation

We analyze the composer embeddings learned by a composer-conditioned Transformer as a continuous latent space of compositional style, rather than merely as an internal representation for generation. A model that recursively predicts melody continuations was trained on melodic sequences extracted from MIDI data, conditi...

Sakutaro Nishio, Osamu Ichikawa · 0 citations
Sep 2026

Music Generation Model Based on Multi-Encoder Transformer and Improved GAN

Driven by the advancement of artificial intelligence in music generation and cross-modal composition, achieving coherence of musical themes and accurate matching of background music in videos has become a research hotspot. To this end, this study constructs a music generation model with a multi-encoder Transformer and...

Ruo-Qi Wang · 0 citations
Open access Sep 2026

Guitar Chord Music Generation Based on Melody Constraints and Transformer Generation Network

With the in-depth application of artificial intelligence in music creation, the automatic generation of guitar chords based on deep learning still has shortcomings in melody-harmony consistency, long-term modeling, and playability. To address the aforementioned challenges, this study proposes a Melody-Constrained Bidir...

Qing-Ling Xu, Jing Wang, Zhao-Feng Xue et al. · 0 citations
Open access Sep 2026

Music plagiarism detection using neural network models

In recent years, the creation and publication of musical works have become significantly simplified thanks to the spread of digital technologies, generative artificial intelligence, and tools based on it. At the same time, detecting musical plagiarism remains crucial for copyrights holders, as the timely detection of p...

B. Panchenko, Томас Олексійович Пасенченко · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.