Music is one of my greatest passions, and because of that I love to support independent or less popular artists. I go out of my way to find unique or interesting groups that explore themes and sounds that aren’t well-represented within mainstream music. I also don’t have a single particular taste in music, so my favorite artists often have a large range of tone, mood, and content. For this assignment, I’ll be performing a sentiment analysis of the lyrics from some of my favorite artists: San Fermin and Streetlight Manifesto.
I’ll be able to scrape the lyrics, release year, album, and name from nearly every song in their discographies from AZLyrics.com. With this data, I can analyze the sentiment of both artists using the Bing lexicon, compare how they changed over time, and compare their most relevant sentiments.
San Fermin
San Fermin is Brooklyn-based pianist, composer, lyricist, and performer Ellis Ludwig-Leone. The group is known for their poetic and layered approach to storytelling coupled with Ludwig-Leone’s sweeping orchestral chamber compositions.
The first visualization shows the percentage of each NRC sentiment that is represented in San Fermin’s lyrics. Most lyrics used by San Fermin have positive connotations, followed very close by negative. Interestingly, sadness and joy are the next largest groups despite also being contradictory. We can also see that “love” is the most sung lyric, which adds greatly to the positivity score, despite there being so many more negative words.
Streetlight Manifesto
Streetlight Manifest is a post-third-wave ska-punk band (that’s a mouthful) known for their large brass ensemble and blending of ska/reggae sensibility with post-hardcore punk sounds and politics. Using the same analysis as before, we can compare the distribution of their lyrical sentiments and most used words.
Compares to San Fermin, Streetlight Manifesto’s lyrics are much more negative, with sadness and fear being the next largest categories. “Love” is also Streetlight’s most frequent positive lyric (“whoa” notwithstanding since it’s a common ska construction for maintaining rhythm).
Comparison Over Time
Using the Bing lexicon, we can plot the gross valence score for each year (which is typically a single album/release) for each artist to see how they have become more or less positive over time.
According to the graphs, both artists have become decreasingly negative in their later years.
Source Code
---title: "BAIS-462 Assignment 7"toc: true # Generates an automatic table of contents.format: html: html-math-method: katex # Defines the pretty math renderer. code-tools: TRUE # Allow the code tools option showing in the output. embed-resources: TRUE # Embeds all components into a single HTML file. execute: warning: FALSE # Prevent all warnings from displaying in the output. message: FALSE # Prevent all messages from displaying in the output. echo: FALSE # Prevent all code from displaying in the output.---## Sentiment Analysis of Two ArtistsMusic is one of my greatest passions, and because of that I love to support independent or less popular artists. I go out of my way to find unique or interesting groups that explore themes and sounds that aren't well-represented within mainstream music. I also don't have a single particular taste in music, so my favorite artists often have a large range of tone, mood, and content. For this assignment, I'll be performing a sentiment analysis of the lyrics from some of my favorite artists: San Fermin and Streetlight Manifesto.I'll be able to scrape the lyrics, release year, album, and name from nearly every song in their discographies from AZLyrics.com. With this data, I can analyze the sentiment of both artists using the Bing lexicon, compare how they changed over time, and compare their most relevant sentiments.```{r}#| label: setup#| include: false# loading packageslibrary(tidyverse)library(songscraper)library(lubridate)library(tidytext)library(textdata)library(httr)library(readr)bing <-get_sentiments("bing")nrc <-read_csv("nrc.csv")all_lyrics <-read_csv("lyrics.csv")```## San FerminSan Fermin is Brooklyn-based pianist, composer, lyricist, and performer Ellis Ludwig-Leone. The group is known for their poetic and layered approach to storytelling coupled with Ludwig-Leone's sweeping orchestral chamber compositions.```{r}all_lyrics$year <-year(as.Date(paste(all_lyrics$year, "01", "01", sep ="-")))san_fermin <- all_lyrics[119:178,]san_fermin$year <-year(as.Date(paste(san_fermin$year, "01", "01", sep ="-")))tidy_fermin <- san_fermin %>%unnest_tokens(word,lyrics) %>%anti_join(stop_words)fermin_counts <- tidy_fermin %>%group_by(word) %>%summarise(n=n()) %>%inner_join(nrc)fermin_bing <- tidy_fermin %>%group_by(word) %>%summarise(n=n()) %>%inner_join(bing)fermin_bing$artist <-"San Fermin"fermin_counts %>%ggplot(aes("", n, fill = sentiment)) +geom_bar(stat ="identity", width =1) +coord_polar("y", start =0) +scale_fill_brewer(palette="Set1") +labs(title ="Percentage of Total Lyrics in Each Sentiment") +theme_void()fermin_bing %>%filter(n >10) %>%mutate(n =ifelse(sentiment =="negative", -n, n)) %>%mutate(word =reorder(word, n)) %>%ggplot(aes(word, n, fill = sentiment)) +geom_col() +coord_flip() +scale_fill_brewer(palette="Set1") +labs(title ="SF Lyrics Sentiment Scores by Word",subtitle ="Scorable words appearing at least 10 times",x ="Word",y ="Contribution to sentiment")```The first visualization shows the percentage of each NRC sentiment that is represented in San Fermin's lyrics. Most lyrics used by San Fermin have positive connotations, followed very close by negative. Interestingly, sadness and joy are the next largest groups despite also being contradictory. We can also see that "love" is the most sung lyric, which adds greatly to the positivity score, despite there being so many more negative words.## Streetlight ManifestoStreetlight Manifest is a post-third-wave ska-punk band (that's a mouthful) known for their large brass ensemble and blending of ska/reggae sensibility with post-hardcore punk sounds and politics. Using the same analysis as before, we can compare the distribution of their lyrical sentiments and most used words. ```{r}smanifesto <- all_lyrics[1:56,]smanifesto$year <-year(as.Date(paste(smanifesto$year, "01", "01", sep ="-")))tidy_smanifesto <- smanifesto %>%unnest_tokens(word,lyrics) %>%anti_join(stop_words)smanifesto_counts <- tidy_smanifesto %>%group_by(word) %>%summarise(n=n()) %>%inner_join(nrc)smanifesto_bing <- tidy_smanifesto %>%group_by(word) %>%summarise(n=n()) %>%inner_join(bing)smanifesto_bing$artist <-"Streetlight Manifesto"smanifesto_counts %>%ggplot(aes("", n, fill = sentiment)) +geom_bar(stat ="identity", width =1) +coord_polar("y", start =0) +scale_fill_brewer(palette="Set1") +labs(title ="Percentage of Total Lyrics in Each Sentiment") +theme_void()smanifesto_bing %>%filter(n >10) %>%mutate(n =ifelse(sentiment =="negative", -n, n)) %>%mutate(word =reorder(word, n)) %>%ggplot(aes(word, n, fill = sentiment)) +geom_col() +coord_flip() +scale_fill_brewer(palette="Set1") +labs(title ="SF Lyrics Sentiment Scores by Word",subtitle ="Scorable words appearing at least 10 times",x ="Word",y ="Contribution to sentiment")```Compares to San Fermin, Streetlight Manifesto's lyrics are much more negative, with sadness and fear being the next largest categories. "Love" is also Streetlight's most frequent positive lyric ("whoa" notwithstanding since it's a common ska construction for maintaining rhythm).## Comparison Over TimeUsing the Bing lexicon, we can plot the gross valence score for each year (which is typically a single album/release) for each artist to see how they have become more or less positive over time.```{r}tidy_fermin$artist <-"San Fermin"tidy_smanifesto$artist <-"Streetlight Manifesto"both <-bind_rows(tidy_fermin,tidy_smanifesto)both %>%filter(!word =='whoa') %>%inner_join(bing) %>%group_by(artist, year, sentiment) %>%summarize(n =n()) %>%spread(sentiment, n, fill=0) %>%mutate(sentiment = positive - negative) %>%ggplot(aes(year, sentiment, fill = artist)) +geom_col(show.legend =FALSE) +scale_fill_brewer(palette="Set1") +facet_wrap(~artist, ncol =2, scales ="free_x") +labs(title ="Chronological Valence Analysis",subtitle ="for the San Fermin and Streetlight Manifesto",x ="Year",y ="Valence")```According to the graphs, both artists have become decreasingly negative in their later years.