MuseMorphose
PyTorch implementation of MuseMorphose (published at IEEE/ACM TASLP), a Transformer-based model for music style transfer.
Install / Use
/learn @YatingMusic/MuseMorphoseREADME
MuseMorphose
This repository contains the official implementation of the following paper:
- Shih-Lun Wu, Yi-Hsuan Yang
MuseMorphose: Full-Song and Fine-Grained Piano Music Style Transfer with One Transformer VAE
accepted to IEEE/ACM Trans. Audio, Speech, & Language Processing (TASLP), Dec 2022 [<a href="https://arxiv.org/abs/2105.04090" target="_blank">arXiv</a>] [<a href="https://slseanwu.github.io/site-musemorphose/" target="_blank">demo website</a>]
Prerequisites
- Python >= 3.6
- Install dependencies
pip3 install -r requirements.txt
- GPU with >6GB RAM (optional, but recommended)
Preprocessing
# download REMI-pop-1.7K dataset
wget -O remi_dataset.tar.gz https://zenodo.org/record/4782721/files/remi_dataset.tar.gz?download=1
tar xzvf remi_dataset.tar.gz
rm remi_dataset.tar.gz
# compute attributes classes
python3 attributes.py
Training
python3 train.py [config file]
- e.g.
python3 train.py config/default.yaml
- Or, you may download the pretrained weights straight away
wget -O musemorphose_pretrained_weights.pt https://zenodo.org/record/5119525/files/musemorphose_pretrained_weights.pt?download=1
Generation
python3 generate.py [config file] [ckpt path] [output dir] [num pieces] [num samples per piece]
- e.g.
python3 generate.py config/default.yaml musemorphose_pretrained_weights.pt generations/ 10 5
This script will randomly draw the specified # of pieces from the test set.
For each sample of a piece, the rhythmic intensity and polyphonicity will be shifted entirely and randomly by [-3, 3] classes for the model to generate style-transferred music.
You may modify random_shift_attr_cls() in generate.py or write your own function to set the attributes.
Customized Generation (To Be Added)
We welcome the community's suggestions and contributions for an interface on which users may
- upload their own MIDIs, and
- set their desired bar-level attributes easily
Citation BibTex
If you find this work helpful and use our code in your research, please kindly cite our paper:
@article{wu2023musemorphose,
title={{MuseMorphose}: Full-Song and Fine-Grained Piano Music Style Transfer with One {Transformer VAE}},
author={Shih-Lun Wu and Yi-Hsuan Yang},
year={2023},
journal={IEEE/ACM Transactions on Audio, Speech, and Language Processing},
}
Related Skills
node-connect
330.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
81.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
330.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
81.3kCommit, push, and open a PR
