How to create AI music with Meta’s MusicGen

Meta has released the code for MusicGen, another AI music generator that can transform textual descriptions into musical melodies. The demo can be found online and a browser is all you need to try it out. The results are not bad but, above all, they demonstrate how far AI music models have progressed.



Here’s what you need to know about MusicGen and how to generate music.


What is MusicGen?

In June 2023, Meta released its AI music generation model called MusicGen. It’s not the first company to tackle the complex problem of synthesizing raw music from a simple text description; so far, you can create music with OpenAI’s Jukebox or generate song snippets with MusicLM.

But it’s the first company to open source the code, allowing you to run the software locally on your computer if you have a GPU with as little as 16GB of memory, though we’ve managed to get it to run with just 11GB.

Don’t worry if you don’t have the hardware, because you can try the MusicGen web app for free using a browser. From the online demo, you can expect it to take just over a minute to generate an audio snippet that’s about 12 seconds long.

How does MusicGen sound?

According to Meta, MusicGen can produce high quality music samples, although we found that the researchers involved defined high quality as 32kHz. This lies somewhere between the requirements of speech synthesis (16kHz) and the standard for digital music (44.1kHz).

In reality, the audio doesn’t meet the minimum quality standards you may be used to hearing on the radio or on streaming platforms. However, compared to other AI music generators, and considering where the technology is at the time of writing, the audio quality is quite good with low noise in the file.

To what extent is the music aligned with the instructions? You can quickly get the idea by listening to the examples we’ve generated below. In general, it manages to adhere to popular musical genres while maintaining a more coherent musical structure than its predecessors.

How to generate music using MusicGen

MusicGen is easy to use and requires no registration. The interface is simple too, making it easy to try out for fun.

Here’s how to generate music with MusicGen:

  1. Open the MusicGen web app.
    Screenshot of the MusicGen web interface

  2. In the text box titled Describe your music, enter your prompt. You can try something simple like “Irish folk tune” or make it more detailed by including instrument, tempo, genre, or emotion.
  3. press the create button to start the process. After a minute or two, an audio player will appear in the Generated Music module on the right.
  4. Hover over the form to show the player controls and listen to the file, or hit the download icon in the top right corner to save the file to your computer. Note that it is only available for download as an .mp4 file.
  5. If you want to try conditioning the results using an existing tune, you can upload a recording into the form next to the text box. Alternatively, you can select microphone to record a melody using the microphone.

Conditioning on a melody will use both the text description and the melody you provide as a reference. This is a useful tool for modeling the results you get from MusicGen.

What are the restrictions on using MusicGen Audio?

The code for MusicGen is distributed free under the MIT license with few restrictions. As for audio generated using the template, it’s unclear if there are any legal guidelines. Instead, you might want to heed Meta’s warning about using MusicGen:

“The model should not be used to intentionally create or disseminate music that creates hostile or alienating environments for people. This includes generating music that people would predictably find disturbing, distressing, or offensive; or content that propagates historical or current stereotypes” .

Meta further explains that MusicGen is for researchers looking to explore AI music generation and not for “downstream uses,” which we assume means tasks like AI music upload and distribution to streaming platforms.

The ethical pros and cons mirror the AI ​​artistic generation. Gaining consent to use the data to train AI models, plus the hassle of compensating/crediting artists when appropriate, are all reasons why Meta plays it safe.

In short, exploring the model for fun is unlikely to do any harm, but it could be a thornier issue when it comes to using audio for commercial music. Many people wonder what the future of pop music will look like with artificial intelligence.

Adding another music generation model to what’s out there, Meta has released MusicGen, an open source AI model that can generate raw music from a simple text description. If you’re curious to try out the technology, you can try the demo using just a web browser.

#create #music #Metas #MusicGen
Image Source : www.makeuseof.com

Leave a Comment