Co-Compose Music with Jukebox AI: A Step-by-Step Guide

Co-Compose Music with Jukebox AI: A Step-by-Step Guide

Table of Contents

  1. Introduction
  2. Setting up Google Colab
  3. Co-composing with Jukebox AI
  4. Creating a project directory
  5. Setting up the co-Compose notebook
  6. Choosing a seed file
  7. Adding lyrics
  8. Setting up the project
  9. Sampling temperature
  10. Upsampling the final product

Co-Composing Music with Jukebox AI

Are You ready to co-compose music with Jukebox AI? In this episode, we'll Show you how to generate several alternatives for the next several seconds of a song, which you will listen to and decide which one to proceed from. With this approach, you and the AI work together to make something, hence the name co-composing. It truly is a partnership between you and the AI. The musicality of the result will depend on your seed, a few parameters you set, the choices you make for which alternatives to follow, and luck.

Setting up Google Colab

Before we proceed, make sure you have registered for a paid tier of Google Colab, have a Google Drive created, and done what's needed to get your Google Drive to be accessible from your computer. Go to github.com/lehenbauer/colab and navigate to k_co_compose_7_tiny_clipper.ipynb, and hit "Open in Colab." Watch for newer stuff as the notebook is regularly being tweaked and evolved. Hit "File" in the pulldown menu on the Colab webpage and hit "Save a copy in Drive" to save a copy in your Google Drive.

Co-composing with Jukebox AI

Now we'll prepare for co-composing by setting up the Colab notebook. Don't click the little play icons on anything just yet. It probably wouldn't hurt to Read through the notebook. You need to Create a project directory for the co-compose. I recommend at least a two-layer structure so that you don't clutter up your G-drive. So I have a co_compose3 folder and, within that, I create a new folder for the project. Create these new folders on your G-drive and then enter the names in the PROJECT_DIRECTORY part of the co-compose notebook, separated by a slash.

Creating a project directory

Presumably, you've already got a seed file to start the AI off musically. If not, go make one, perhaps referring to our episode about how to make seed files. Paste or drag your seed file into your project folder. It must be in WAV format, that's W,A V, mono, at a sampling rate of 44.1 KHz. Next, lyrics. If you have lyrics, put them in a file your project folder. The lyrics may or may not be used, depending a lot on the choices you make at the decision points, but if it does start singing and you keep going and you don't have any lyrics, it'll sing gibberish lyrics, which kinda works but kinda doesn't.

Setting up the co-compose notebook

Next scroll down to "Setup Project". Where it says WAV, enter the name of your seed file, but leave off the ".wav" extension. LYRICS_FILE - Enter the name of your lyrics file, including any extension on this one, such as ".txt". Next, artist. The list of artists is linked in the above cell. You can attempt to help guide the AI model to generate something informed by the genre or style of the chosen artist. You can also leave this blank. Then, Genre. Pick from zero to four of the genre keywords from the list linked for genre in the cell above. If you have more than one, separate them by a space. PROMPT LENGTH - Enter the number of seconds of the seed file that Jukebox should listen to. INITIAL SONG LENGTH - Enter the number of seconds you want to generate on the initial run, that is, making the first set of co-compose options. I recommend four seconds. Longer intervals will be less work for you but will allow the AI to Wander a lot more before you begin to direct it. TOTAL_SONG_LENGTH - How many seconds do you want your song to run for? Two minutes of four-second segments means you'll go through this process 30 times. It'll take hours. The AI will bring the song to an end when it reaches the total song length you set, sometimes sooner or even much sooner. I find 60 seconds, when experimenting, strikes a good balance between being long enough to develop some ideas but short enough that it doesn't feel like it's taking forever. If I'm more seriously going for something, I'll choose 120 or even 160. 160 seconds makes for a long night.

Sampling temperature

"Sampling Temperature" - Temperature controls the randomness of the model's output. A higher temperature can result in more Novel and varied output, possibly at the expense of musical coherence, while a lower temperature can result in more consistent musical structures, potentially at the risk of creating repetitive or less innovative compositions. User experience suggests a range from about 0.95 to 0.99 tends to produce musically pleasing results, balancing creativity and coherence. "NOTE" gets added to all the filenames. I just leave it blank.

Upsampling the final product

All along the way, the co-compose notebook has been writing files into your project directory on your Google Drive. Once it's done, among other things, there will be a folder named level_0 and within that, a file named item_0.wav which is the Colab notebook's final product. Let's go listen to this one.

Conclusion

Like most things, with practice and experimentation, you’ll improve. It’s vital to ignore the frustration and keep pushing when your experience and understanding is limited. Get to work and start co-composing!

Highlights

  • Co-composing music with Jukebox AI
  • Setting up Google Colab
  • Creating a project directory
  • Choosing a seed file
  • Adding lyrics
  • Sampling temperature
  • Upsampling the final product

FAQ

Q: What is Jukebox AI? A: Jukebox AI is an AI-powered music generator that allows you to co-compose music with the AI.

Q: What is Google Colab? A: Google Colab is a cloud-based platform that allows you to run Python code in a Jupyter notebook environment.

Q: What is a seed file? A: A seed file is a short audio clip that serves as the starting point for the AI to generate music.

Q: What is upsampling? A: Upsampling is the process of increasing the sampling rate of an audio file to improve its quality.

Q: Can I use Jukebox AI for commercial purposes? A: Yes, you can use Jukebox AI for commercial purposes, but you need to obtain a license from OpenAI.

Find AI tools in Toolify

Join TOOLIFY to find the ai tools

Get started

Sign Up
App rating
4.9
AI Tools
20k+
Trusted Users
5000+
No complicated
No difficulty
Free forever
Browse More Content