Skip to content

ChiragGupta16/Music-Generator-Using-ABC-Notation

Repository files navigation

Music Generation Using RNN

Overview

Tired of getting the same code everywhere ?
Here is something different from the ones using midi files :)
This code generates music using ABC Notation. They are also known as Sheet Notation. Its the same thing a pianist sees while playing piano. The model is based on RNN to predict the the next note.
It is made using tensorflow and keras.

Data Source and Libraries

I have used the ABC Notation files from Nottingham Music Database(https://abc.sourceforge.net/NMD/)
It contains over 1000 Folk Tunes stored in a special ABC format. Do check it out!
You can use any tune for training

For converting the abc format text to music we will use music21 library. You can get the documentation here(https://web.mit.edu/music21/doc/)
We will also use abcjs to download midi files generated from ABC Notation. You will find the link of the website inside the file. ChatGPT will also be used to check uniform line breaks in generated notation to save time.

General Idea

We will download the data set from the Nottingham Music Database.
During preprocessing, we will remove unnecessary lines and notation. We will then play the music using music21 library.
We will then convert each token in the data set to a unique number. Then these numbers will be fed into the model based on RNN.
After the traing is completed we will join the generated text with the original text and convet it back to ABC Notation. It is then checked for missing puncuations using ChatGPT to save manual labour.
The updated notation is then played on a website based on abcjs and we will download it from the website.

Note :

Increase the epoch while training for better result.

Happy Coding !!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published