deeplearningunb / deeplearningunb/baich

Show me the solution

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

## Introduction

BAIch is AI (Neural Network) project to generate musics. The nature of the problem isn't simple, making music is an expression/criativity activity, but with the rise of eletronic music having a AI capable of creating music seems like a good idea.

We proposed an AI to:

- Create music, based on piano songs;
- Use notes, chords, and time to process and create the songs.

## Technical Explanation

- We used a Recurrent Neural Network (RNN) using Long Short Term Memory (LSTM);

| Figure 1 - Base Architecture for a LSTM Recurrent Neural Network |
| :---: |
| ![image](https://user-images.githubusercontent.com/17963713/99877147-cc934300-2bda-11eb-9cf3-292dda5fbd09.png) |

- We select the `music21` to extract the contents of the music (chords, notes, and time);

E.g.:

```
...
72.0
72.0
72.5
72.5
73.0
73.0
73.5
74.0
74.0
74.5
75.0
75.5
76.0
76.5
77.0
77.5
78.0
78.5
79.0
...
```

- Keras was used to create and train the model.

## Execution

- We gathered a dataset with some classical piano songs and other theme songs from Final Fantasy (the dataset can be found in [VGMusic](https://www.vgmusic.com)).
- We loaded each file into a music21 stream object using the `converter.parse($file)` function;
- Put all the notes and chords into a sequential list, that will serve as the input of our network;
- Map the input, normalize it and one-hot encode the output.
- Next step: create songs!!!

## Results

Music sheet for a generated song from the AI:

![Music Sheet](https://miro.medium.com/max/1000/1*tzfrAkHCbGjBXA5ZOthjrw.png)

Example song on SoundCloud.

[![Generated Song](https://user-images.githubusercontent.com/11671985/99876906-64545980-2bfa-11eb-9b84-709483892419.png)](https://soundcloud.com/sconetto/20201121-baich-generated-song)

Other generated songs can be found on (MIDI files): [Composed](https://github.com/deeplearningunb/baich/tree/main/assets/composed)

To verify the project evolution you can check our [CHANGELOG](https://github.com/deeplearningunb/baich/blob/main/CHANGELOG.md).

## Lesson Learned

- Gathering dataset takes time (that fit in the proposed solution);
- Costs time and processing (It took 8 hours to train the model);
- How to create a LSTM.

## Future Works

- Create better CLI for usage;
- For now it only works for a single instrument, if you add songs to the dataset with more than instrument it becomes chaotic for the network to learn and predict;
- Add beginning and ending pieces for the generated;
- Create CI/CD for releases;
- Create Script to auto-generate the music sheet.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.