• Stars
    star
    133
  • Rank 272,600 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 2 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Official Implementation of "Multitrack Music Transformer" (ICASSP 2023)

Multitrack Music Transformer

This repository contains the official implementation of "Multitrack Music Transformer" (ICASSP 2023).

Multitrack Music Transformer
Hao-Wen Dong, Ke Chen, Shlomo Dubnov, Julian McAuley and Taylor Berg-Kirkpatrick
IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2023
[homepage] [paper] [code] [reviews]

Content

Prerequisites

We recommend using Conda. You can create the environment with the following command.

conda env create -f environment.yml

Preprocessing

Preprocessed Datasets

The preprocessed datasets can be found here. You can use gdown to download them via command line as follows.

gdown --id 1owWu-Ne8wDoBYCFiF9z11fruJo62m_uK --folder

Extract the files to data/{DATASET_KEY}/processed/json and data/{DATASET_KEY}/processed/notes, where DATASET_KEY is sod, lmd, lmd_full or snd.

Preprocessing Scripts

You can skip this section if you download the preprocessed datasets.

Step 1 -- Download the datasets

Please download the Symbolic orchestral database (SOD). You may download it via command line as follows.

wget https://qsdfo.github.io/LOP/database/SOD.zip

We also support the following two datasets:

Step 2 -- Prepare the name list

Get a list of filenames for each dataset.

find data/sod/SOD -type f -name *.mid -o -name *.xml | cut -c 14- > data/sod/original-names.txt

Note: Change the number in the cut command for different datasets.

Step 3 -- Convert the data

Convert the MIDI and MusicXML files into MusPy files for processing.

python convert_sod.py

Note: You may enable multiprocessing with the -j option, for example, python convert_sod.py -j 10 for 10 parallel jobs.

Step 4 -- Extract the note list

Extract a list of notes from the MusPy JSON files.

python extract.py -d sod

Step 5 -- Split training/validation/test sets

Split the processed data into training, validation and test sets.

python split.py -d sod

Training

Pretrained Models

The pretrained models can be found here. You can use [gdown] to download all the pretrained models via command line as follows.

gdown --id 1HoKfghXOmiqi028oc_Wv0m2IlLdcJglQ --folder

Training Scripts

Train a Multitrack Music Transformer model.

  • Absolute positional embedding (APE):

    python mmt/train.py -d sod -o exp/sod/ape -g 0

  • Relative positional embedding (RPE):

    python mmt/train.py -d sod -o exp/sod/rpe --no-abs_pos_emb --rel_pos_emb -g 0

  • No positional embedding (NPE):

    python mmt/train.py -d sod -o exp/sod/npe --no-abs_pos_emb --no-rel_pos_emb -g 0

Generation (Inference)

Generate new samples using a trained model.

python mmt/generate.py -d sod -o exp/sod/ape -g 0

Evaluation

Evaluate the trained model using objective evaluation metrics.

python mmt/evaluate.py -d sod -o exp/sod/ape -ns 100 -g 0

Acknowledgment

The code is based largely on the x-transformers library developed by lucidrains.

Citation

Please cite the following paper if you use the code provided in this repository.

Hao-Wen Dong, Ke Chen, Shlomo Dubnov, Julian McAuley and Taylor Berg-Kirkpatrick, "Multitrack Music Transformer," IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2023.

@inproceedings{dong2023mmt,
    author = {Hao-Wen Dong and Ke Chen and Shlomo Dubnov and Julian McAuley and Taylor Berg-Kirkpatrick},
    title = {Multitrack Music Transformer},
    booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
    year = 2023,
}

More Repositories

1

musegan

An AI for Music Generation
Python
1,784
star
2

muspy

A toolkit for symbolic music generation
Python
432
star
3

pypianoroll

A toolkit for working with piano rolls
Python
132
star
4

lakh-pianoroll-dataset

A collection of 174,154 multi-track piano-rolls
Python
80
star
5

ismir2019tutorial

Website for tutorial "Generating Music with GANs: An Overview and Case Studies"
Jupyter Notebook
73
star
6

bmusegan

Code for “Convolutional Generative Adversarial Networks with Binary Neurons for Polyphonic Music Generation”
Python
57
star
7

arranger

Official Implementation of "Towards Automatic Instrumentation by Learning to Separate Parts in Symbolic Multitrack Music" (ISMIR 2021)
Python
54
star
8

dan

Source code for "Towards a Deeper Understanding of Adversarial Losses under a Discriminative Adversarial Network Setting"
Python
42
star
9

deepperformer

Deep Performer: Score-to-audio music performance synthesis
SCSS
41
star
10

bach-violin-dataset

A collection of high-quality public recordings of Bach's sonatas and partitas for solo violin (BWV 1001–1006)
Python
32
star
11

musicgpt

Music Generative Pretrained Transformer
Python
26
star
12

binarygan

Code for "Training Generative Adversarial Networks with Binary Neurons by End-to-end Backpropagation"
Python
26
star
13

music-segmentation

Segmentation algorithms adapted for multitrack pianorolls
Jupyter Notebook
9
star
14

chord-analysis

Final project for "Probability and Statistics for Data Science" (UCSD ECE 225, Fall 2019)
Jupyter Notebook
7
star
15

flows

Final project for "Probabilistic Approaches to Unsupervised Learning" (UCSD CSE 291, Fall 2020)
Jupyter Notebook
4
star
16

muspy-exp

Code for the experiments in the paper "MusPy: A Toolkit for Symbolic Music Generation"
Python
4
star
17

meow-meow

A Smart Pet Interaction System
HTML
3
star
18

ntuee-machine-learning

Assignments and final project for "Machine Learning" (NTU EE 5177, 2016 Fall)
Python
1
star
19

music-ai-reading-group

HTML
1
star