12/7/2016

Eureka!

Example: The Moon Song

Musical Chords & Keys

  • A chord is 3+ musical notes played at the same time
  • Chord progression
  • Transpose chords to the key of C (normalization)
  • Example:

Dataset: The McGill Billboard Project

  • 990 songs of Billboard chart from 1958 to 1991
  • Containing txt files of chord annotations, csv file of song info
  • Genres of songs obtained by API

EDA: Genre Popularity over Time

EDA: Major Chords of All Genres

Naive Bayes

  • Predict genres using chord frequencies
  • Prediction accuracy: 52%
  • Baseline accuracy: 25% (Enhanced by 107%!)
##           
## pred       Country Folk Hip-hop Jazz Others Pop R&B/Soul Rock
##   Country        9    1       0    0      1   6        9   13
##   Folk           0    0       0    0      0   0        0    0
##   Hip-hop        0    0       0    0      0   0        0    0
##   Jazz           0    0       0    1      0   1        0    0
##   Others         0    0       0    0      0   0        0    0
##   Pop            1    0       0    0      0   9        5    8
##   R&B/Soul       6    0       2    2      0   4       39    5
##   Rock           2    0       0    0      0   7       12   55

Sequence Analysis: N-gram

  • An n-gram is a contiguous sequence of n items from a given sequence of text or speech
  • N = 1 (unigram), 2 (bigram), 3 (trigram), 4 (4-gram), ….
  • Widely used in NLP, DNA sequencing…

Sequence Analysis: Bigram

  • Beat It - Michael Jackson

  • C:min => Bb:maj => C:min => Bj:maj => … …

Chord Diagrams of All Genres

Sequence Analysis: 4-gram

4-Gram using tf-idf: R&B genre

4-Gram using tf-idf: Country genre

Shiny App: MelodySoup

  • Generate a chord progression given a specific genre
  • Recommend next chord based on (n-1)-gram
  • Rank by tf-idf (term frequency - inverse document frequency)
  • Click here!