Skip to content

neomoha/lyrics_grid

Repository files navigation

LyricsGrid

Source code for LyricsGrid, a hack developed at the Paris Music Hack Day 2014

The hack allows you to visualize and interact with a song using the content of its lyrics.

For each line of the lyrics, the most salient word is selected (using Natural Language Processing techniques) and used as a tag to query Flickr for an image.

The resulting images are then visualized as an NxN grid.

The user can move his/her mouse over the images, which will display the corresponding lyrics line, and play the audio snippet that corresponds to that line, thanks to the synchronized lyrics provided by MusixMatch API.

More info here

Install Dependencies

(preferably in a virtualenv)

Run: 'pip install -r requirements'

You must also install ffmpeg.

Configurations

You need an API key for both Flickr and MusixMatch.

Modify the content of config.py accordingly.

The Stanford NLP tagger is the default Part-of-Speech tagger. For ease of use, it is also included in this repository.

How to deploy the hack (backend)

Run in this order:

  • python get_lyrics.py ARTIST_NAME SONG_TITLE PATH_TO_AUDIO.mp3
  • python split_audio.py PATH_TO_AUDIO.mp3 PATH_TO_LYRICS.json
  • python get_images.py PATH_TO_LYRICS.json

All the above scripts have a help text (run for example 'python get_lyrics.py -h' to see the help text)

For ease of use, this repository includes the synced lyrics and images of 5 songs. The audio files though cannot be shared because of copyright issues.

How to deploy the hack (frontend)

An easy way to deploy the frontend part of the hack using Linux or Mac OS X from the command line:

  • cd web/
  • python -m SimpleHTTPServer 8080

Then go to your browser and type http://0.0.0.0:8080

About

This is the code for the hack LyricsGrid developed at the Music Hack Day Paris 2014

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors