Git Product home page Git Product logo

musicvizml's Introduction

MusicML / Viz

This project created a foundation for future work by WPI students in music information retrieval and machine learning. A Python system was first constructed to extract variable-length features from audio files. The problem of determining song structure was then approached with both supervised and unsupervised learning algorithms.

Mostly though, this is notable just producing some nice-looking visualizations of songs as a by-product of running K-means under certain conditions (here is "One" by Metallica):

Monster scatterplot

Installation

Optionally use virtualenv, and install requirements:

$ pip install requirements.txt

Usage

Demo, which loads up the song "One" and produces a visualization similar to the below:

$ python musicml.py -g

Full usage:

$ python musicml.py [-h] [-l] [-s {0,1,2,3,4,5,6,7,8,9,10,11}] [-a N_ART_GRAPHS]
                    [-p] [-g] [-c] [-e]

optional arguments:
  -h, --help            show this help message and exit
  -l, --is_all_songs    Run test on all songs.
  -s {0,1,2,3,4,5,6,7,8,9,10,11}, --song_index {0,1,2,3,4,5,6,7,8,9,10,11}
                        Index of the song in song_library.
  -a N_ART_GRAPHS, --n_art_graphs N_ART_GRAPHS
                        Number of output graphs.
  -p, --is_plot_data    Plot the raw data.
  -g, --is_not_graph    Do not graph output.
  -c, --is_cluster      Run clustering.
  -e, --is_elbow        Run elbow method for KMeans clustering.

Using your own song

  • Put your input .wav file in the /input folder (Warning: providing songs with COMPLETELY blank sections will mess with the numerical libraries)
  • Create a new instance of Song in library.py following the convention - the songs and verses are sets up tuples representing the start and end (in seconds) of a song verse or chorus.
  • Add a reference to your at index 0 in analyze.py's Analyst.song_library list
  • Run demo (defaults to picking the first song in the song_library)

Future Work

  • Refactor to run in a Jupyter notebook
  • Segment song and smooth to isolate Verse, Chorus sections (i.e. that way you don't have to manually specify choruses and verses in the configs)
  • Run anomaly detection before K-means to reduce outlier effects

The End Result

Workflow

The Processed Data

Monster scatterplot

Supervised Learning

K-nearest neighbor (K=5)

Monster scatterplot

Unsupervised Learning

K-means clustering algorithm:

K-means on Monster

musicvizml's People

Contributors

nsbradford avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

thomas-bradford

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.