Unleash Your Inner Composer with NotaGen: The AI Music Generation Revolution
Want to create beautiful, original classical music effortlessly? NotaGen is here to make that dream a reality. This innovative symbolic music generation model, powered by advanced Large Language Models (LLMs), lets you compose high-quality sheet music with unprecedented ease.
Dive into the World of AI Music Composition
NotaGen isn't just another music generator; it's a carefully crafted system built on a three-stage training paradigm:
- Massive Pre-training: Trained on 1.6 million pieces to understand the nuances of music.
- Targeted Fine-tuning: Honed on approximately 9,000 classical compositions using specific prompts.
- Intelligent Reinforcement Learning: Optimized using a novel CLaMP-DPO method, requiring no human input.
Why Choose NotaGen for Symbolic Music Generation?
With NotaGen, musical inspiration is always at your fingertips.
- Effortless Composition: Simply provide a "period-composer-instrumentation" prompt and let NotaGen do the rest.
- High-Quality Output: Expect professional-grade sheet music ready for performance or further refinement.
- Customizable Styles: Fine-tune the model to match specific composer styles or musical periods.
Experience NotaGen in Action: Demo Options
Ready to hear what NotaGen can create? Explore these demo options:
- Online Gradio Demo: Generate music directly from your browser, preview audio and scores, and download your creations.
- Local Gradio Demo: Run NotaGen-X locally with a compatible GPU (8GB memory recommended).
- Online Colab Notebook: Thanks to community contributions, try NotaGen on Google Colab with a public Gradio link.
- ComfyUI Node: A ComfyUI node is available for automatically converting generated ABC notation to various formats including XML, MP3, and PNG.
NotaGen-X: The Enhanced Version
Inspired by Deepseek-R1, NotaGen-X takes music generation to the next level with refined training procedures:
- Post-Training Refinement: A classical-style subset further refines the model.
- Improved Instrument Range: Removing key augmentation results in more realistic compositions
- Iterative Optimization: Multiple rounds of post-training, fine-tuning, and reinforcement learning for superior results.
Tailor NotaGen-X to Your Specific Style
Want to add a new composer style to NotaGen-X? Comprehensive instructions are available.
Get Started with Symbolic Music Generation: A Step-by-Step Guide
Ready to train your own NotaGen model? Here's a simplified approach:
1. Environment Setup:
- Create a conda environment:
conda create --name notagen python=3.10
- Activate the environment:
conda activate notagen
- Install dependencies:
conda install pytorch==2.3.0 pytorch-cuda=11.8 -c pytorch -c nvidia; pip install accelerate optimum; pip install -r requirements.txt
2. Pre-training:
- Prepare your data using the instructions in
data/README.md
. - Configure the parameters in
pretrain/config.py
. - Launch pre-training:
cd pretrain/; accelerate launch --multi_gpu --mixed_precision fp16 train-gen.py
3. Fine-tuning:
- Modify
DATA_TRAIN_INDEX_PATH
andDATA_EVAL_INDEX_PATH
infinetune/config.py
. - Download pre-trained weights and adjust the
PRETRAINED_PATH
. - Set an
EXP_TAG
for model identification. - Execute fine-tuning:
cd finetune/; CUDA_VISIBLE_DEVICES=0 python train-gen.py
4. Reinforcement Learning (CLaMP-DPO):
- Set up CLaMP 2 by downloading model weights.
- Extract ground truth features using
clamp2/extract_clamp2.py
. - Run inference using
inference/inference.py
. - Extract generated data features again with
clamp2/extract_clamp2.py
. - Construct preference data using
RL/data.py
. - Train with DPO in
RL/train.py
.
About CLaMP-DPO
CLaMP-DPO enhances the model through an iterative process. During each cycle, inference occurs first, followed by feature extraction and the construction of preference data. Subsequently, DPO training is executed which generates improved musical compositions.
NotaGen: Empowering the Future of Music Composition
NotaGen empowers musicians, composers, and researchers to explore new frontiers in music creation. With its powerful AI capabilities and flexible training options, NotaGen is poised to revolutionize the world of symbolic music generation. Start creating your own symphonies today!