Skip to content

Lo-Fi Hip Hop Music Generation

2023-04-142 min read
Python
ML
Pytorch
Lo-Fi Hip Hop Music Generation

Summary

I completed this fun project in a team of four of my University of Toronto colleagues in an Applied Fundamentals of Deep Learning course.

In this project, we generate Lo-Fi Hip Hop music using a bidirectional LSTM network. Given a starting sequence of musical notes in MIDI format, our model will generate the next sequence of notes. We trained our model using publicly available Lo-Fi MIDI files. Our qualitative and quantitative metrics conclude that our model is able to generate music that people enjoy listening to, but it is only somewhat successful at producing music that replicates the same characteristics of Lo-Fi Hip Hop music.

Below are some of my personal contributions to the project, including a demo video. Our team paper is also available to read here.

Completed Project Tasks

1. Research

(a) Surveyed and documented multiple papers and videos on feasibility of music generation to guide team’s project direction, and found relevant datasets

(b) Tested preliminary LSTM models with my preprocessing code in TensorFlow to explain findings to team

(c) Researched how to use multiple loss functions (pitch and duration) with varied weightings for final iteration of primary model

2. Software Design

(a) Wrote custom preprocessing code to parse MIDIs in multiple formats, as documented in this colab

(b) Researched evaluation techniques such as NLTM and PCTM from a paper and implemented NLTM in this colab to present results from four datasets

(c) Tweaked hyperparameters of primary model

3. Documentation

(a) Wrote sections in the Project Proposal, Progress and Final Reports

4. Presentation Work

(a) Created slides for data processing and evaluation

(b) Recorded and edited final presentation video

5. Administrative

(a) Took initiative to organize meeting times and locations, and took team meeting minutes

Partially Completed Project Tasks

1. Consider time signature and beats per minute (BPM) to normalize duration. We did not consider this since our MIDI files did not encode BPM.

2. Track key changes, and augment the key of songs. We did not encode key changes, as the music21 functions did not yield the correct key signature for our Lo-Fi MIDIs. This could be a new ML problem!