• Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
Sunday, January 11, 2026
newsaiworld
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us
No Result
View All Result
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us
No Result
View All Result
Morning News
No Result
View All Result
Home Machine Learning

Music, Lyrics, and Agentic AI: Constructing a Sensible Tune Explainer utilizing Python and OpenAI

Admin by Admin
November 15, 2025
in Machine Learning
0
Evelina siuksteryte scaled 1.jpg
0
SHARES
2
VIEWS
Share on FacebookShare on Twitter

READ ALSO

Past the Flat Desk: Constructing an Enterprise-Grade Monetary Mannequin in Energy BI

How LLMs Deal with Infinite Context With Finite Reminiscence


is rap.

Rap music made me cry, sing, and dance, and it is usually how I discovered the English language. I nonetheless bear in mind the primary time I sat down and tried to know Biggie and Tupac. I bear in mind studying about Brooklyn, about California, the slang, the struggles, and all the opposite highly effective messages behind these songs.

Rap music is the very best instance of how lyrics alone could make music a bit of artwork. Among the finest hip-hop songs are actually a pattern, some drums, and an individual speaking poetry on a 4/4 tempo.

And whereas for somebody studying the lyrics won’t even be needed, as they know the language, for non-English audio system like myself, instruments like Genius made life extremely simpler. Genius is an internet lyrics music collector: should you’re in search of the lyrics of a track, Genius is your man. Due to Genius, even when I didn’t perceive what Biggie was saying, I might sit down and skim the lyrics, then Google them and translate them. Not solely that: when a rapper (or a singer generally) makes a selected reference that’s too laborious to know, Genius will make clear that for you thru some side-bar snippets.

Picture from Genius [link]

However how does Genius do this? How do they produce such insightful, up-to-date, helpful snippets?

Properly, in 2009, when Genius was born, I might say they’d primarily produce these sorts of snippets manually: customers would simply add their remark, possibly some moderator might evaluate a few of them, and that’s it, closed deal.

Nonetheless, right now, with the highly effective AI applied sciences that we’ve, the pipeline will be made a lot smoother and environment friendly. Whereas I don’t imagine that an agentic AI would be capable of do the job of a music knowledgeable (for therefore many causes), I imagine that an individual with such area data might be helped by the agentic AI, which would offer them with the suitable instruments to create the snippets.

And that is what we’re doing right now. 🙂

We’ll use Streamlit, Python, and OpenAI to construct a brilliant easy net app that, given a track’s lyrics, supplies clarification to what the piece of textual content means. Extra particularly, we’re going to enable the person to ask questions concerning the piece of textual content, making the Genius thought extra “interactive”. We’re additionally going to offer our AI Agent the Internet Search outcomes to permit the LLM to have a look at different songs and assets when crafting the reply.

To spice issues up (and for copyright functions lol), we’re going to additionally create our personal songs, utilizing one other AI agent.

Thrilling! Let’s get began! 🚀

In case you are within the closing results of this experiment, skip to the third part. If you wish to craft the magic with me, begin from subsequent part. No judgments. 🙂

1. System Design

Let’s first design our system. That is the way it seems to be:

Picture made by creator

Extra particularly:

  1. The Person has the flexibility to create the track from scratch utilizing an AI Agent. That’s optionally available; a batch of songs has already been generated and can be utilized as a substitute.
  2. The Person can choose an element of the textual content and ask a query.
  3. The AI Agent can generate the response in a “Genius-like” model.

The AI Agent can also be outfitted with:

a. The “Inner Tune Data“, which consists of the extracted options/metadata of the track (e.g., vibe, title, theme, and so on…).
b. The Internet Search Instrument, which permits the agent to surf the net to search for songs and add context to the query

This design has good modularity, which means it’s simple so as to add bits and items to extend the complexity of the system. For instance, if you wish to make the track technology extra refined, you’ll be able to simply tweak the Tune Technology Agent with out going loopy over the opposite elements of the code.

Let’s construct this piece by piece. 🧱

2. Code

2.1 Setup

The entire code will be discovered on this Github folder

The construction of our work will probably be as follows:

  1. A lyrics generator, which is generate_madeup_lyrics.py
  2. The lyrics reply, which is qa.py
  3. The net app itself (the file we are going to run by way of Streamlit), which is lyricsgpt_app.py
  4. A bunch of helpers (reminiscent of utils.py, constants.py, config.py, and so on…)

The information will probably be saved in a information folder as nicely.

Picture made by creator

I don’t wish to bore you with all of the tiny particulars, so I’ll solely describe the principle parts of this construction. Let’s begin with the core: the Streamlit app.

2.2 Streamlit App

Please notice: you will have to have a OpenAI API key prepared, for each the Streamlit app and no matter requires the LLM technology. Exterior of the Streamlit app, the simplest manner is to set it utilizing OS: os.getenv(“OPENAI_API_KEY”) = “api_key”. Throughout the app, you can be prompted to copy-paste it. Don’t fear, it’s all native.

The entire thing runs with the next command:

streamlit run lyricsgpt_app.py

The place lyricsgpt_app.py is the next block of code:

That is fairly lengthy, however fairly simple: each line represents a bit of the net app:

  1. The title of the net app
  2. The track selector, which permits the person to pick out the lyrics from the info folder (extra about this later)
  3. The field for the block of textual content, the place the person can copy and paste the a part of the lyrics of curiosity
  4. The query field, the place the person can ask a query concerning the a part of the lyrics of curiosity chosen above
  5. The reply field, the place the LLM can reply the query.

However that is “solely” the executor; the soiled work is finished by the lyricsgpt module and its objects/capabilities. Let’s see a number of!

2.3 Lyrics Generator

This half is optionally available and never included within the net app, which focuses on the Genius-like Lyrics Explainer. Be at liberty to skip this in case you are desirous about that. However I’ve to say it: this half is fairly cool.

For the lyrics technology, the sport is straightforward:

  • You give me a title, vibe, theme, and a few hidden message in a twist.
  • I provide the lyrics.

For instance:

Produces:

Verse 1
Beneath town lights, whispers danced alongside the skyline, we have been shining by way of the evening, like diamonds in a midnight sky. However love was only a high-rise dream, constructed on fragile seams, now I’m pulling off the freeway, leaving echoes in between.

Refrain
And it’s all glitter within the rearview, fading into shades of blue, each giggle and each tear, drifting out of view. Because the highway unrolls forward, I let the recollections stew, it’s simply glitter within the rearview, letting go of me and also you.

[Some more LLM Generated Text]

Outro
So I drive into the silence, the place the previous can’t misconstrue, leaving glitter within the rearview, and the shards of me and also you. It’s simply glitter within the rearview, a love story gone too quickly.

Fairly cool, proper? The code to do this is the next:

You possibly can play with it by modifying SONG_PROMPTS, which seems to be like this:

Each time you generate a track, it is going to go right into a JSON file. By default, that’s information/generated_lyrics.json. You don’t should essentially generate a track; there are already some examples I made in there.

2.4 Lyrics Explainer

The good factor about this entire Agentic period is the period of time you save to construct these things. The entire Query-Answering logic, plus the flexibility of the AI to make use of on-line net search, is on this block of code:

This does all of it: reply the query, reads the lyrics metadata, and integrates data on-line if prompted/wanted.

I didn’t wish to get too fancy, however you’ll be able to truly equip the agent with the web_search instrument. On this case, I’m parsing the data straight; should you give the LLM the instrument, it may possibly resolve when and if search on-line.

Okay, however does this work? How do the outcomes seem like? Let’s discover out!

3. The magic!

That is an instance of the net app.

  1. You copy-paste your OpenAI API key, and you choose a track. Say “Glitter within the Rearview”.
Picture made by creator

2. Choose the a part of curiosity. For instance, let’s say I’m an Italian man (which I’m lol), and I take advantage of meters, so I don’t know the way far a mile is. I might additionally wish to know if there’s a reference to one thing particular when the singer says 13 miles (“13 miles to freedom” is the primary sentence within the bridge)

3. See the magic!

Picture made by creator

Let’s attempt one thing more durable. Right here, I pasted the entire second verse, and I requested the AI to offer me which singer would write one thing like this.

The AI factors out Taylor Swift and Adele. Particularly the Taylor Swift reference is extraordinarily correct, because the songs about breakups and love tales are her biggest hits. She additionally on her recognition and the way her life is affected by it in songs like “I do know locations”:

Lights flash and we’ll run for the fences, Allow them to say what they need, we received’t hear it

Taylor Swift – I do know locations

I’ll admit I needed to Google that.

4. Some considering…

Now, that is removed from good: it’s a plug-and-play weekend venture, lower than an MVP. Nonetheless, it supplies three widespread takeaways:

  1. When supplied with the suitable instruments and metadata, the LLM actually shines and supplies insightful data (just like the Taylor Swift suggestion)
  2. Constructing an LLM wrapper is manner simpler than it was even 5 months in the past. The way in which this expertise is evolving permits you to be extra productive than ever.
  3. Agentic AI can actually be utilized all over the place. Quite than getting scared about it, it’s finest to embrace it and see what we are able to do with it.

5. Conclusions

Thanks for spending time with me; it means lots ❤️. Right here’s what we’ve performed collectively:

  • Designed a Genius-inspired system powered by Agentic AI that may clarify track lyrics interactively.
  • Developed the backend parts in Python and Streamlit, from the lyrics generator to the Q&A engine.
  • Constructed the AI agent with inside track data and an internet search instrument for contextual solutions.
  • Constructed an app that may interpret lyrics intelligently.
  • Had some enjoyable whereas doing that, I hope. 🙂

I wish to shut with my 2 cents. On my day by day commute, I hearken to podcasts (often interviews) of artists who make music, and so they clarify the songs, the references, and the lyrics. If somebody replaces these musicians with an AI, I’m going to RIOT. Not (solely) as a result of I just like the folks themselves, however as a result of I imagine that they are going to clarify issues with a ardour, a depth, and an empathy that LLMs usually are not in a position to present (and I believe they by no means will).

Nonetheless, if we offer music critics with these sorts of AI instruments, their work turns into a lot simpler, and so they can 10x their productiveness.

7. Earlier than you head out!

Thanks once more to your time. It means lots ❤️

My identify is Piero Paialunga, and I’m this man right here:

Picture made by creator

I’m initially from Italy, maintain a Ph.D. from the College of Cincinnati, and work as a Knowledge Scientist at The Commerce Desk in New York Metropolis. I write about AI, Machine Studying, and the evolving function of knowledge scientists each right here on TDS and on LinkedIn. Should you preferred the article and wish to know extra about machine studying and comply with my research, you’ll be able to:

A. Comply with me on Linkedin, the place I publish all my tales
B. Comply with me on GitHub, the place you’ll be able to see all my code
C. For questions, you’ll be able to ship me an electronic mail at piero.paialunga@hotmail

Tags: AgenticBuildingExplainerLyricsMusicOpenAiPythonSmartsong

Related Posts

Data modeling img 1.jpg
Machine Learning

Past the Flat Desk: Constructing an Enterprise-Grade Monetary Mannequin in Energy BI

January 11, 2026
Wmremove transformed 1 scaled 1 1024x565.png
Machine Learning

How LLMs Deal with Infinite Context With Finite Reminiscence

January 9, 2026
68fc7635 c1f8 40b8 8840 35a1621c7e1c.jpeg
Machine Learning

Past Prompting: The Energy of Context Engineering

January 8, 2026
Mlm visualizing foundations ml supervised learning feature b.png
Machine Learning

Supervised Studying: The Basis of Predictive Modeling

January 8, 2026
24363c63 ace9 44a6 b680 58385f0b25e6.jpeg
Machine Learning

Measuring What Issues with NeMo Agent Toolkit

January 7, 2026
Harris scaled 1.jpg
Machine Learning

Function Detection, Half 3: Harris Nook Detection

January 5, 2026
Next Post
A196f9fd e45c 4eb6 98ea 39bae8885417 800x420.jpg

BlackRock's IBIT offloads $463M in Bitcoin, largest outflow on document

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

POPULAR NEWS

Chainlink Link And Cardano Ada Dominate The Crypto Coin Development Chart.jpg

Chainlink’s Run to $20 Beneficial properties Steam Amid LINK Taking the Helm because the High Creating DeFi Challenge ⋆ ZyCrypto

May 17, 2025
Image 100 1024x683.png

Easy methods to Use LLMs for Highly effective Computerized Evaluations

August 13, 2025
Gemini 2.0 Fash Vs Gpt 4o.webp.webp

Gemini 2.0 Flash vs GPT 4o: Which is Higher?

January 19, 2025
Blog.png

XMN is accessible for buying and selling!

October 10, 2025
0 3.png

College endowments be a part of crypto rush, boosting meme cash like Meme Index

February 10, 2025

EDITOR'S PICK

764d99bf 2466 43d1 a5b1 48811eccc415 800x420.jpg

NBA High Shot kicks off 2025-26 season with star partnerships, participant autographs, and blockchain enhancements

October 21, 2025
1qv7ftzi8rjyor4kztokpbw.png

LangChain’s Father or mother Doc Retriever — Revisited | by Omri Eliyahu Levy

November 22, 2024
Pods Defi Crypto Ninjas Eth.jpg

DeFi protocol Pods raises $5.6M to help its structured crypto merchandise dApp – CryptoNinjas

November 5, 2024
1uhpj4hkgfj0q5wxtqdb3ug.jpeg

Open the Synthetic Mind: Sparse Autoencoders for LLM Inspection | by Salvatore Raieli | Nov, 2024

November 16, 2024

About Us

Welcome to News AI World, your go-to source for the latest in artificial intelligence news and developments. Our mission is to deliver comprehensive and insightful coverage of the rapidly evolving AI landscape, keeping you informed about breakthroughs, trends, and the transformative impact of AI technologies across industries.

Categories

  • Artificial Intelligence
  • ChatGPT
  • Crypto Coins
  • Data Science
  • Machine Learning

Recent Posts

  • AI insiders search to poison the info that feeds them • The Register
  • Bitcoin Whales Hit The Promote Button, $135K Goal Now Trending
  • 10 Most Common GitHub Repositories for Studying AI
  • Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy

© 2024 Newsaiworld.com. All rights reserved.

No Result
View All Result
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us

© 2024 Newsaiworld.com. All rights reserved.

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?