Skip to content

mateuszdorobek/MIDI-Jazz-Music-AI-Generation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Music Generator

This project implements Deep Learning solution in generating music with it's image form - piano roll. It was part of my diploma thesis defended in January 2019.

LAST UPDATE - New article "Use of artificial intelligence for generating musical contents" PL

Listen AI Music at my SoundCloud

W3Schools

Input Data

I've decided to use piano roll format, becouse it has less data redundation than wave form and spectrogram:

Images in piano roll format was created from two midi databases:

Name Description Data type Data size
Dough McKeznie Jazz Piano Solo MIDI ~300 pieces, 20h
MAESTRO Recordings from classical piano competition Wave & MIDI ~2500 pieces, 170h

Using scripts in MidiScripts I've transformed raw midi files into piano roll image format.

Preprocessing steps:

Sample MIDI in text format (MIDI is basicly binary file)

MFile 1 2 384
MTrk
0 Tempo 500000
0 TimeSig 4/4 24 8
1 Meta TrkEnd
TrkEnd
MTrk
0 PrCh ch=1 p=0
806 On ch=1 n=42 v=71
909 Par ch=1 c=64 v=37
924 Par ch=1 c=64 v=50
939 Par ch=1 c=64 v=58
955 Par ch=1 c=64 v=62
970 Par ch=1 c=64 v=65
986 Par ch=1 c=64 v=68
...

Piano Roll example:

Neural Network

I've decided to use DCGAN architecture described and implemented here

Structure of DCGAN:

Training

To train I've used Google Collaboratory with their amazing Tesla K80, and my private device with NVidia 1050Ti which performed really well. As a result of training I've recived bunch of indistinguishable images which I've to transform back to midi form with imagesDecodeScript.py

Fake vs Real

Overal cost function in first experiments semms to prove some overfitting, but in this kind of images it's nothing suprising.

Cost Function

And here we have one of the most beautiful things in using GAN networks, learning progres animation

GIF

Results

As always not the theory, but results are the most interesting thigs in this type of projects.

Look at examples where you can find music generated using DCGAN.

Tech Stack

About

DCGAN generating music using piano roll format.

Resources

Stars

Watchers

Forks