This repetition analyzer can search for any song through the genius API and then creates an image from the songs self-similarity matrix
Given a text of length n tokens, it constructs an n x n matrix, where (i, j) is filled in if the ith and jth words are the same (after some normalization).
The output available in a repetition-matrix.ppm
file
Holy Grail (Ft. Justin Timberlake) by Jay-Z
To use this program you must update credentials.txt
to contain your Genius API credentials.
Click here to create Genius Api Credentials
- Make sure you have installed virtualen, or if not then run
pip3 install virtualenv
- Create the python three virtual environment
virtualenv venv
- Start the environment
source venv/bin/activate
- Automatically install all relevant dependencies using the following command
pip install -r requirements.txt
- Make sure you have installed virtualen, or if not then run
pip3 install virtualenv
- Create the python three virtual environment
virtualenv venv
- Start the environment
source venv/bin/activate
- Install the python requests package
pip install requests
- Install numpy (linear algebra package)
pip install numpy
- Install bs4 (Beautiful Soup 4)
pip install bs4
Make sure all downloaded items are for Python 3.x
In the root folder of the program run this command to start the virtual environment
$ source venv/bin/activate
After the virtual environment has started run this command to start the program
$ python matrix.py
Try not to make a spelling mistake when typing the song name
- Shoutout to @genius for being the world's greatest public knowledge project since Wikipedia and making all their information avalible to us through their amazing public API πΆπ
- Shoutout to SongSim for the original analysis idea π
- Shoutout to requests for a great HTTP and OAuth2 tool for humans β¨π°β¨