Offset: 0.0s
Space Play/Pause

How to Generate STUDIO-QUALITY Music in Gemini AI with The NEW Gems Feature

Have you ever imagined creating a unique piece of music simply by describing it? Thanks to a powerful new feature in Google Gemini, this is now a reality. By leveraging Google Opal and the …

7 min read

Unlock AI Music Creation: A Guide to Google Gemini’s Lyria 2 Model

Have you ever imagined creating a unique piece of music simply by describing it? Thanks to a powerful new feature in Google Gemini, this is now a reality. By leveraging Google Opal and the advanced Lyria 2 model, you can build custom applications directly within Gemini to generate high-quality, instrumental audio clips. This guide will walk you through how to unlock this capability and start creating your own AI-generated music.

[00:00.000]

[Gemini Music Weaver App Interface]

The journey begins with a simple prompt that instructs Google Gemini to create a minimalist web app. This app, which we’ll call “Music Weaver,” is designed to generate music based on a text description. The core of this functionality is powered by Google’s Lyria 2 model, a sophisticated AI for music generation. The result is a clean, user-friendly interface with a single input field to bring your musical ideas to life.

[00:09.932]

[Audio player interface for generated music]

Before diving into the creation process, let’s listen to a sample of what this tool can produce. The following is a short, approximately 30-second audio clip generated with a prompt for a “lofi with some Christmas beat.” This demonstrates the impressive quality and creativity of the AI music generation capabilities now available.

[00:31.932]

[Original prompt and workflow steps in Gemini]

This entire piece of music was generated directly within the Google Gemini platform. This might seem surprising, as music generation isn’t a standard, built-in feature readily available on the main interface. So, how is this possible?

[00:41.932]

[Google Gemini Tools Menu]

If you explore the standard tools within the Gemini platform, you’ll find options for deep research, video creation with Veo, image generation, and more. However, you won’t find a direct option for creating music. This is where a new, experimental feature comes into play, bridging the gap between Gemini’s interface and Google’s powerful backend models.

[00:52.432]

[Lyria - Google DeepMind’s Music Generation Model]

For some time, Google has had a cutting-edge music generation model called Lyria. Developed by Google DeepMind, Lyria is capable of creating intricate instrumental pieces from text prompts. While the model existed, it had not been directly integrated into the main Gemini user experience—until now. A new system allows users to tap into Lyria’s power through custom-built applications.

[01:08.932]

[Google Opal Experiment Interface with node-based workflow]

The magic happens through Google Opal, an experimental platform that allows you to create custom workflows and mini-apps. Opal uses a visual, node-based editor where you can chain different AI models and processes together. In this case, a custom workflow was created that takes a user’s text input, feeds it into the Lyria 2 model to generate audio, and then creates a simple webpage to play the music.

[01:21.932]

[Accessing the Tools menu in Google Gemini]

To access this powerful feature, you’ll need to use the web version of Google Gemini, as it is not yet available on mobile. Start by navigating to the Gemini web app and opening the sidebar menu.

[01:51.432]

[Gem Manager interface in Google Gemini]

From the sidebar, click on Gems. Gems are AI mini-apps and custom workflows created with Google Labs. You’ll see a gallery of pre-made Gems and an option to build your own. This is where you can start creating your personalized music generator.

[02:15.432]

[Creating a new Gem in Gemini]

Click on “New Gem” to begin. You will be presented with a simple input field where you can describe the AI mini-app or custom workflow you want to build. Instead of manually connecting nodes in Opal, you can simply describe what you want in plain English, and Gemini will construct the workflow for you.

[02:37.432]

[Prompt for creating a music generation web app]

To create the “Music Weaver” app, you’ll need a specific and detailed prompt. This prompt tells Gemini to build a web app using Google Opal that leverages the Lyria 2 model. It specifies the need for a single text input, defines the output as a clean audio player, and ensures the generated audio is piped directly for playback.

Create a minimalist web app in Google Opal that generates music using the Lyria 2 model. The workflow should have a single text input field where users can enter their music description prompt specifying genre, tempo, mood, and instrumentation. Connect this input to the Lyria 2 music generation step which will process the prompt and create up to 30 seconds of high-quality audio. The final output should display only a clean audio player component with play and pause controls, showing the generated music file ready for immediate playback. Remove any intermediate steps or unnecessary UI elements from the final view so users see just the audio player after generation completes. Make sure the workflow connects the text input directly to Lyria 2 generation and then pipes the audio output directly to the player component without additional processing steps.

[02:55.432]

[Gemini generating the app configuration]

After submitting the prompt, Gemini will begin planning and generating the app configuration. It analyzes your request, identifies the necessary steps (Music Description, Generate Music, Create Webpage), and builds the underlying custom workflow in Google Opal.

[03:15.432]

[Completed Music Weaver app interface]

Once the process is complete, your custom “Music Weaver” app is ready. The interface is clean and straightforward, prompting you to “Generate unique audio tracks from your musical descriptions.” All you have to do is click “Start” to begin creating.

[03:37.432]

[Input field for describing desired music]

Now for the fun part. Describe the music you want to create. You can specify genre, mood, tempo, and instrumentation. For this example, a simple prompt like “Lofi with disco” is used to test the model’s creative capabilities.

[03:47.432]

[AI thinking and generating music track]

The app will then process your request, sending the description to the Lyria 2 model. After a few moments of processing, it will generate the audio and build the final music player webpage for you to interact with.

[03:54.932]

[Lyria Music Generation Prompt Guide]

For best results, it’s helpful to understand how to prompt the Lyria model effectively. Google provides a prompt guide that recommends being descriptive and concise. While you can be creative, simple and clear prompts often yield the best outcomes. Focusing on elements like genre, style, mood, instrumentation, and tempo will help guide the AI.

[04:25.432]

[Advanced Editor view in Google Opal]

If you’re an advanced user, you can click “Open Advanced Editor” to view and modify the underlying Google Opal workflow. This visual editor shows the different nodes—Music Description (input), Generate Music Track (processing), and Create Music Player Webpage (output)—and how they connect. Here, you could add more steps, such as generating album art for your music or using different AI models.

[04:51.432]

[Final generated music player with audio playback]

The final result is a simple webpage displaying your music description and an audio player ready for playback. The generated track, a unique blend of lofi and disco, sounds impressively polished and coherent.

[05:26.432]

[Audio playback interface showing limitations]

One current limitation is that the custom audio player generated by this specific prompt doesn’t include a download button. However, this can be addressed by modifying the original prompt to request the use of a standard HTML5 audio player, which typically includes download functionality.

[05:57.432]

[Your Generated Music interface]

In conclusion, the integration of Gems and Google Opal into Google Gemini has opened up a new frontier for creative AI. By building your own mini-apps, you can directly harness the power of specialized models like Lyria 2 to generate music, create art, and design complex workflows with simple text commands.

[06:11.432]

[Editing the workflow steps directly in Gemini]

You can easily reuse and modify your created Gems. Simply navigate back to the Gems section in Gemini to access your saved workflows. You can even make quick changes by using the “Edit these steps” field, allowing for iterative creation without needing to start from scratch. This powerful and flexible system puts advanced AI creation tools at your fingertips.