← All posts
Generative AIJun 12, 2023·5 min read

MusicGen Unleashed: The AI Revolution in Music Creation that Everyone’s Talking About

By Shameer Thaha

A New Symphony: The Era of AI-Powered Music Creation

Welcome to the era of AI-powered music creation, a time where the power to create captivating songs extends beyond the echelons of trained musicians to anyone with a vision and a revolutionary tool named MusicGen. My personal journey with MusicGen took me on a fascinating voyage into the world of jazz, an experience that was nothing short of magical.

MusicGen is the brainchild of the Audiocraft team at Meta AI. It leverages advanced machine-learning techniques to convert simple textual prompts into intricate and captivating songs, acting as a conduit for the creative vision of its users. The ingenuity behind this technology is impressive, employing a single-stage auto-regressive Transformer model trained with a 32kHz EnCodec tokenizer and four 50 Hz codebooks. The model is available in three sizes: 300M, 1.5B, and 3.3B parameters.

The Conductor Behind the Music

In machine learning, a Transformer model uses self-attention mechanisms to better understand the context of the input data. The term “auto-regressive” refers to how the model makes predictions: it uses previous output as input for future predictions. Imagine a conductor guiding an orchestra, where each note depends on the notes that came before it. It’s a sequential process, with each step building on the last, allowing the model to generate complex and coherent compositions.

Harmonizing with AI

MusicGen is an open-source text and music model, with the code publicly available on GitHub. As a jazz aficionado, I began my journey by feeding MusicGen a simple instruction: “An upbeat jazz composition in the key of C, featuring a soft piano melody intertwined with the mellow tones of a saxophone with bass”. To my delight, MusicGen composed a beautiful piece that was rich in tone, depth, and complexity. Listening to my very own jazz composition was an exhilarating experience.

Running MusicGen is straightforward: Google Colab offers excellent performance and minimal setup, Hugging Face spaces offer unlimited output, and for those with capable GPUs, running it locally offers unlimited flexibility.

Limitations and Room for Improvement

While MusicGen opens up a world of possibilities, it does have its limitations. Currently, it does not support vocals or sound effects, and it has a maximum duration limit of 30 seconds for audio clips. It also requires a GPU with 16GB of RAM. Beyond jazz, I found it could produce a variety of genres — from techno beats to reggaeton — by simply adjusting the textual prompt.

If you’re not musically inclined, a simple hack: use an LLM to generate detailed music descriptions, then feed those to MusicGen. I used this method and was pleasantly surprised by the quality.

Looking Ahead

The future of MusicGen looks promising, particularly with the prospect of custom models on the horizon. By making music creation accessible to all, it unlocks a wealth of creativity and gives birth to a new era of AI-driven music innovation. Despite its current limitations, MusicGen is a ground-breaking tool that has the potential to democratize music creation. It’s an exciting time to be a part of this AI-driven revolution in music.

Enjoyed this? Let’s talk about what it means for your business.

Book a call

Originally published on shameerthaha.com.