Skip to content

Aligning Music Transformer to Human Preferences (my music preferences to be precise)

License

Notifications You must be signed in to change notification settings

ojus1/AlignedMusicTransformer

 
 

Repository files navigation

Aligned Music Transformer

TLDR; Use Reinforcement Learning From Human Feedback (RLHF) to tune a Music Transformer to generate Piano music that I like.

Examples of pieces I love:

  1. Somnus - Dreaming of the Dawn
  2. Sorrow Without Solace
  3. Secret of the Forest

Data

Combine ADL-Piano-MIDI, GiantMIDI; and MIDI files scraped from Ichigo's and VGMusic. Scripts to scrape from Ichigo's and VGMusic are under here.

The combined dataset is about 22K MIDI files, totalling about 1800 hours of piano music. To the best of my knowledge, this results in the biggest publicly available Piano MIDI dataset (the second biggest being GiantMIDI, 1200 hours).

Method 1

First download GiantMIDI and ADL-Piano-MIDI, and extract under data/giant_midi and data/adl-piano-midi respectively. Then run the following:

python3 scrape/ichigos.py
python3 scrape/vgmusic.py
cp data/vgmusic/* data/all/
cp data/ichigos/* data/all/
cp data/giant_midi/* data/all/
cp data/adl-piano-midi/midi/adl-piano-midi/*/*/*/*.mid data/all/

Method 2

Download from this link (link to be added later).

Preprocessing

python3 preprocess.py data/all data/processed

Changes: Parallelized the existing MIDI preprocessing code, and replaced progress with tqdm

About

Aligning Music Transformer to Human Preferences (my music preferences to be precise)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.7%
  • Cuda 1.8%
  • C++ 0.5%