A cool generative AI playlist project

Many of you know I use a Synology NAS because I like how I can attribute a track date to all tracks in my all-local collection (now just shy of 50,000 tracks.)

For a long time, I have had an “80s Greatest” playlist of 1,675 tracks (120 hours) that was manually curated over about 15-20 years of manual work.

I’ve wanted to create an equivalent “70s Greatest” playlist, but it’s been daunting.

Recently, I decided to use some generative AI magic to assist, and I got the whole thing done in just under a week, in my spare time. I used two paid offerings for this; the first is a $20/month subscription to ChatGPT, which enables me to take advantage of GPT 4, and the other is a Google Sheets extension that I describe below.

Here’s what I did:

  1. I created 10 smart playlists in Audio Station…one for each decade of the 1970s. The parameters:

    Match ALL of the following rules:

    • Year is {year for each, from 1970-1979}
    • File path does not contain “/Classical”
    • Genre is not Christmas
    • Genre is not Sound Effects

    I created non-smart .m3u-based playlists for each of these, then brought them together into one .m3u playlist, in year order.

  2. Then I did a force rescan in Roon, which imported the .m3u playlist into Roon.

  3. I then turned right around and exported it to Excel in the usual way so that I had all of Roon’s extra metadata columns that comes from an export.

  4. In Excel, I added a column for “Year” and added the year for each track (the tracks were all still in year order, so I was able to refer to the individual playlists created in step 1 to see where the year boundaries were…took a little bit of work but not too much. We’re only talking about 10 copy/shift-select/paste operations, here…

  5. Then, wherever the “Album Artist” was “Various Artists”, I rewrote that column to refer to the “Track Artist” field.

  6. Then the magic part. I imported the Excel spreadsheet into Google Sheets, where I use an extension called “GPT for Sheets and Docs” (https://workspace.google.com/marketplace/app/gpt_for_sheets_and_docs/677318054654).

    I added a few columns there, with the following formulas:

    a) A column called “Prompt” with the following formula:

    =CONCATENATE("Yes or no: Was the ",{YEAR CELL REF}," song '",{SONG CELL REF},"' by ",{ALBUM ARTIST CELL REF}," a hit on the charts?")

    This creates a result that looks like:

    Yes or no: Was the 1978 song 'Come Together' by Aerosmith a hit on the charts?

    b) A column called “GPT” with the following formula:

    =GPT({PROMPT CELL REF})

    This is the most essential function that is provided by “GPT for Sheets” - and it, in almost all cases, produces a straightforward “Yes.” or “No.” answer in each cell.

    c) A column called “Text” with the following formula:

    =TO_TEXT({GPT CELL REF})

    This converts the Yes/No result from b) to text, which ensures that the textual result remains when you download it to your local computer to use in Excel, which doesn’t recognize the “GPT” function.

  7. Then, let GPT for Sheets to do its stuff.

    In my configuration, I did not use Safe Mode (it’s too slow), but I did enable the cache. I chose the “OpenAI gpt-4-turbo option” and I connected the extension to my OpenAI account through an API key (the instructions for the GPT for Sheets extension guide you through this quite nicely.) I left Creativity and Max Tokens at their default settings, and didn’t employ any “Advanced” settings.

    After it works for a while, you may need to use the “Retry Errors” function until you get a solid Yes or No answer to each of your prompts.

    I started with 8,604 songs and the total bill for the GPT for Sheets usage was about $17. My Open AI bill was only 11¢!

  8. When it’s done, download it to your computer, and then use Excel to browse through the content and make adjustments as you see fit, because the results are not perfect. You can even ask ChatGPT or Copilot one-off questions about artists and their hits to make your reasearch easier.

    I wound up moving my “Yes/No” column over between the Title and Track Artist columns, and then I used Excel’s conditional formatting to colorize the song titles with red (No) or green (Yes) to help me visualize things.

  9. After I was done, I wound up with 1,938 tracks that qualified as “70s Greatest,” totaling 130 hours.

    To make your .m3u playlist, you simply filter your spreadsheet by the “Yes” answers and copy the “Path” column to a text file. Remove the unnecessary prefixes with a search & replace.

    For example, in my case, I replace this:

    /var/packages/RoonServer/target/roonmnt/music/

    with:

    ../

    …because my playlists folder is at the root of my music collection, and all paths follow from there.

    FYI - The first line of your file should always be “#EXTM3U

  10. From there, re-scan your Roon library, and the playlists is all ready for use in Roon!

I am so happy with this taking multiple orders of magnitude less time than it did for my 80s Greatest playlist.

I hope you can explore some generative AI magic to make playlists in Roon too!

3 Likes

ChatGPT:

“ Make me a playlist of the top ten rock and pop songs for each year, 1970 to 1979. Put the songs in date order. There should be 100 songs—ten for each year. Generate an m3u playlist of the songs.”

Also works great. Adjust numbers to suit. Then you can stuff the playlist into Soundiiz and use whatever service, or put it into your own system if you think you own all the songs.

2 Likes

I am not worthy…

Roon Extension: AI Guest DJ | Open AI for Roon Not sure how this compares

The solution from @DDPS differs from my extension in the fact that it’s focussed on local files only and that it can generate m3u files (which is awesome!). Because of the way it’s setup you can also create larger playlist more easily.

The AI Guest DJ extension works best with a hybrid setup (local + streaming service) and using it for music discovery. It cannot create a m3u because the needed information is not available in the API. The created playlists can be played on selected zones.

I am working on an update to easier navigate previous created playlists (by you and others). But nothing is as easy as having it under the playlist section in Roon (like with this project).

1 Like

This is neat-sounding, but in my case I don’t know how it would be able to reference my local files, as it would not know the paths.

For grins, I decided to do something like this and, as I expected, here was the response:

“Creating an .m3u playlist involves listing the URLs of media files (in this case, songs) that can be streamed or downloaded, usually hosted on a server. However, since I can’t browse the internet or access real-time data, including direct links to media files or streaming content, I’ll help by listing top rock and pop songs from the 1970s that you might include in your playlist. This list will include artist names and song titles, and you can source the actual music files or streaming links from your preferred music service.”

1 Like

I want to add something I noticed - I did a bunch of additional cleanup today. Despite what I thought was an excellent prompt format, the query will answer “yes” to any title track (i.e., sharing the name of the album) on a hit album, even if the track itself was not a hit. Examples: “Court and Spark,” or “Toys in the Attic.” The prompt gets confused, thinking the track is a hit because it shares the same name of an album that was a hit.

Luckily, these were pretty easy to identify and fix.

Has anyone here tried experimenting with AI music apps? I know that a lot of people think that music AI tools are bad and harmful, but for me music AI is really interesting. You can mess around with voices and sounds, not bad at all for creative exploring. I was just wondering did any musicians try it out? So far I found best performances in AudioModify, what are your experiences?

This album was made together with AI.

There is an article about it here: