Welcome to the world of AI-generated copyright-free music! In this post, I will show you how to use Music Gen, an open-source AI tool developed by the Facebook research team, to create high-quality music from a single line of text or convert existing melodies into different styles. The best part? You can do all of this on your own computer without any expensive equipment. So let’s dive in and start creating some amazing tunes!
Step 1: Prepare Your Computer
Before we begin, make sure you are using a Windows computer with a powerful GPU. While the GitHub page suggests a GPU with at least 16GB of memory, you can actually use it with 4-5GB of VRAM. Don’t worry; I’ll show you how to run it without a GPU later. First, let’s install the necessary tools.
Step 2: Install Required Software
To get started, you’ll need to install the following software:
- Git: Download and install Git for Windows from the provided link.
- Python: Install the latest Python version for Windows and remember to check the “Add Python to Path” option during installation.
- PyTorch: Install PyTorch 20.1 with CUDA support using the provided command in the description. This step is crucial for the tool to work correctly.
# Best to make sure you have torch installed first, in particular before installing xformers. # Don't run this if you already have PyTorch installed. pip install 'torch>=2.0'
Step 3: Clone the Repository
Once all the required software is installed, create a new folder (e.g., “music”) and open the Command Prompt window inside it. Use the provided command to clone the Music Gen repository, creating a new “audio craft” folder inside your directory.
# Then proceed to one of the following pip install -U audiocraft # stable release pip install -U git+https://git@github.com/facebookresearch/audiocraft#egg=audiocraft # bleeding edge pip install -e . # or if you cloned the repo locally
Step 4: Install Dependencies
Still in the Command Prompt, navigate to the “audio craft” folder and use the provided command to download all the requirements needed to run the Music Gen tool.
Step 5: Access the Music Gen Web UI
With all dependencies installed, you’re ready to use the Music Gen web UI. Type “python app.py” in the Command Prompt (or use the provided command) to run the server. Access the local URL generated to access the web UI.
Step 6: Create Your Music
In the Music Gen web UI, you’ll find various options to input text and generate music:
- Choose from four different music models: Melody, Medium, Small, or Large.
- Set the desired duration of the music (up to 30 seconds).
- Adjust parameters like top K, top P, and temperature to control the generation’s quality and randomness.
Step 7: Enjoy Your Copyright-Free Music
Click “Submit” to generate your music. The first time might take a bit longer as it downloads the chosen model. After that, you’ll get your brand new, copyright-free music in a matter of seconds. You can listen to it and download it for your content creation needs.
Bonus Step: Using Music Gen without a GPU
Don’t have a powerful GPU? No worries! You can use a free Google Colab doc provided by Kevin Doodu. Access the link from here and follow the provided steps to run Music Gen in the cloud. It’s just as simple and allows you to generate music without a GPU.
Conclusion
Music Gen is an incredible AI-powered tool that lets you create copyright-free music with ease. Whether you’re a content creator or just a music enthusiast, this open-source gem by the Facebook research team offers endless possibilities for generating high-quality tunes. So unleash your creativity, experiment with different styles, and enjoy your AI-generated masterpieces!
Read more: Create Stunning AI QR Code Art With Using AI