Skip to content

shaopengw/Awesome-Music-Generation

Repository files navigation

Awesome-Music-Generation

banner

Welcome to MG2!

Try our demo first!

  →     ←   Click here!

  →     ←   Click here!

  →     ←   Click here!
This repository contains the implementation of the music generation model MG2, the first novel approach using melody to guide the music generation that, despite a pretty simple method and extremely limited resources, achieves excellent performance.

Anyone can use this model to generate personalized background music for their short videos on platforms like TikTok, YouTube Shorts, and Meta Reels. Additionally, it is very cost-effective to fine-tune the model with your own private music dataset.

Video

You can watch the introduction video on

  →     ←   Click here!

  →     ←   Click here!

Online Service

Now you can try music generation with your own prompt on our

  →     ←   Click here!

Tips: To generate high-quality music using MG2, you would want to craft detailed and descriptive prompts that provide rich context and specific musical elements.

Quick Start

To get started with MG2, follow the steps below:

Step 1: Clone the repository

git clone https://github.com/shaopengw/Awesome-Music-Generation.git
cd Awesome-Music-Generation

Step 2: Set up the Conda environment

# Create and activate the environment from the provided environment file
conda env create -f environment.yml
conda activate MMGen_quickstart

Step 3: Download checkpoints from huggingface

# Ensure that the checkpoints are stored in the following directory structure
Awesome-Music-Generation/
└── data/
    └── checkpoints/

Step 4: Modify the PYTHONPATH environment variables in the quick_start.sh script

# Update the paths to reflect your local environment setup
# Replace:
export PYTHONPATH=/mnt/sda/quick_start_demonstration/Awesome-Music-Generation:$PYTHONPATH
export PYTHONPATH=/mnt/sda/quick_start_demonstration/Awesome-Music-Generation/data:$PYTHONPATH
# With:
export PYTHONPATH=/your/local/path/Awesome-Music-Generation:$PYTHONPATH
export PYTHONPATH=/your/local/path/Awesome-Music-Generation/data:$PYTHONPATH

Step 5: Assign execution permissions for the script

chmod +x quick_start.sh

Step 6: Execute the quick start script

bash quick_start.sh

Allow the script to run for several minutes. Upon completion, the results will be available in the following directory:

Awesome-Music-Generation/log/latent_diffusion/quick_start/quick_start

Todo List

  • Demo website
  • Huggingface checkpoints
  • Quick start (Inference)
  • Training Datasets
  • Training/fine-tuning code
  • Online free generation service
  • Checkpoints on larger datasets

Feel free to explore the repository and contribute!


Acknowledgement

We sincerely acknowledge the developers of the following open-source code bases. These resources are invaluable sparks that ignite innovation and progress in the real world 🎆!

The research is supported by the Key Technologies Research and Development Program under Grant No. 2020YFC0832702, and National Natural Science Foundation of China under Grant Nos. 71910107002, 62376227, 61906159, 62302400, 62176014, and Sichuan Science and Technology Program under Grant No. 2023NSFSC0032, 2023NSFSC0114, and Guanghua Talent Project of Southwestern University of Finance and Economics.

Citation

@article{wei2024melodyneedmusicgeneration,
      title={Melody Is All You Need For Music Generation}, 
      author={Shaopeng Wei and Manzhen Wei and Haoyu Wang and Yu Zhao and Gang Kou},
      year={2024},
      eprint={2409.20196},
      archivePrefix={arXiv},
      primaryClass={cs.SD},
      url={https://arxiv.org/abs/2409.20196}, 
}