Code Monkey home page Code Monkey logo

bandori-valence's Introduction

Bandori Valence

Overview

Visualizes the emotional valence of original BanG Dream songs, which is provided by Spotify.

Spotify defines valence as a measure of "musical positiveness", with higher-value songs sounding more positive (happy or cheery) and lower-value songs sounding more negative (depressed or angry).

The data was collected using a Python script (found in python/song-grabber.py), and deposited into the data directory for use by the website.

Getting and Updating Spotify Data

python/song-grabber.py requires a file called credentials.json to work, which should have a Spotify client_id and client_secret.

Usage

  1. Make a Spotify Developer account and create a client ID/secret
  2. Create credentials.json inside the python directory
  3. Run pip install -r python/requirements.txt in the root directory
  4. Run python python/song-grabber.py <ARGUMENT> in the root directory

The argument for the script defines the action to do; it may require additional values to be passed as well. Run python python/song-grabber.py -h for details.

If for some reason the script has to be run from the python directory rather than the root directory, the use of a context manager to call main() has to be removed from the bottom of the script.

Example Arguments

  • --dump-band-songs to dump all songs, using band playlists (see python/constants.py for playlist IDs)
  • --get-albums popipa to print all albums by Poppin'Party (see python/constants.py for valid names/abbreviations)
  • --put-album-songs 3RKqfMngxktugTGzWQ5Be7 2etZzaMSi3pY0SISeNziWA to add songs from albums by album ID to existing dump

Manual Data Cleaning

The script was used to generate two files: band-songs.json and song-names.json. Both currently live in the data directory, and required a few manual changes to be usable.

Manual changes made to band-songs.json:

  • Removed all instrumental, acoustic, and short versions of songs
  • Renamed ぽっぴん'しゃっふる to ぽっぴん しゃっふる because JS seems to escape the single apostrophe in translations.json by replacing it with a single right quotation (' vs )
  • Renamed remastered versions of Roselia songs to non-remastered name, and removed non-remastered versions

Manual changes made to song-names.json:

  • Removed all instrumental, acoustic, and short versions of songs, as above
  • Renamed ぽっぴん'しゃっふる to ぽっぴん しゃっふる, as above
  • Removed remastered versions
  • Removed character songs and songs from temporary or minor bands (e.g. The Third, Glitter*Green)
  • Sorted songs to match actual album and single release dates (songs released in same single/album are in same order as single/album)

It was important to note that Japanese song names on Spotify use the English exclamation marks rather than Japanese ones (which are wider characters), but Japanese tildes (known as the wave dash: ) rather than English tildes.

bandori-valence's People

Contributors

dependabot[bot] avatar supreme-chocomint avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.