RNN Music Generation

TL;DR

Context

Project carried out as part of my training in artificial intelligence. The objective was to automatically generate piano music sequences by exploring deep learning approaches applied to musical data.

Description and goals

To test different methods of automatic music generation, particularly through GANs and RNNs, to produce MIDI files that are plausible in terms of rhythm and melody.

Technical Stack

Implementation

Initial attempts with GANs

We first experimented with two variants of GANs:

Although promising in theory, these approaches proved inconclusive in our case:

Final solution: RNN on MIDI data

Due to the technical limitations encountered with GANs, we refocused our approach on Recurrent Neural Networks (RNNs), which are particularly well suited to sequential data such as music.

We used the MAESTRO dataset (classical pieces in MIDI format), which allowed us to work directly on the notes rather than on the audio signal.

Main steps:

Results and limitations

The results generated are modest; the pieces produced are coherent over short sequences, but quickly show repetitive patterns, inconsistent notes, or unstable rhythms.

This result can be explained by several factors:

That said, the project was not intended to result in AI that generates commercial or publishable music, but rather to serve as an experimental exploration. It demonstrates:

Areas for improvement

Code & demo

The source code is available on this GitHub repository.