This project is an educational experiment that explores the use of large language models (LLMs) to generate new songs based on existing lyrics. The pipeline processes real songs, enriches them with thematic and emotional metadata, and generates new lyrics with the help of an LLM.
- Uses Spotify's artist's top tracks API to retrieve song titles.
- Then scrapes lyrics from
letras.comusing those titles. - Audio features are not used due to API deprecation.
- The current version works with 10 songs from Jorge Drexler.
Each song is processed to extract:
- Thematic tags (e.g.,
"Love","Transformation") - Mood classification (e.g.,
"romantic") - Structural metrics (lines, paragraphs)
- The user defines desired attributes.
- The system selects similar songs.
- A new song is generated using the LLM.
01-get_connection.py: handles secrets (excluded from Git)02-process_songs.py: scrapes and prepares raw lyrics03-main.py: UI built with Streamlit for interactive generation- It currently allows the user to input desired song features (tag, mood, and length) and generates a new song based on similar ones.
llm_helper.py: prompt engineering and LLM helperssong_generator.py: generates the new lyricsfew_shot.py: few-shot examples for promptingraw_songs.json: input lyricsprocessed_songs.json: enriched song data
- Only supports one fixed artist.
- No audio features are used due to deprecated Spotify API.
- Allow user to choose artist (from 10 preselected ones).
- Let the user define how many songs to process.
- Add semantic similarity filtering (clustering, vector DBs).
- This is a non-commercial educational project.
- All rights for the lyrics belong to their authors and publishers.
- Lyrics and data were obtained from
https://www.letras.comandSpotify. - No redistribution or commercial use of derived works is intended.
