Giter Club home page Giter Club logo

jazzml's Introduction

JazzML: Computational Jazz Improvisation

Originally inspired by Gillick et al. (2010): "Machine Learning of Jazz Grammars" http://www.mitpressjournals.org/doi/pdf/10.1162/COMJ_a_00006

UPDATE: See branch "research" for the latest working demo of the project. When executed correctly (download all files, run "$ python pipe.py"), assuming all libraries are installed, it will generate guitar improvisation and play it against the prerecorded accompaniment.

Computer jazz improvisation powered by machine learning, specifically trigram modeling, K-Means clustering, and chord inference with SVMs.

Needs to be better modularized.

Dependencies:

  • NumPy
  • SciPy
  • Pandas
  • Scikit-Learn
  • Matplotlib

In addition, you'll need a couple of specialized music libraries for Python:


If you just want to read about my work (without running any code), please use the nbviewer for iPython notebooks 6a and 6b, which document the full process (except for parsing the raw MIDI data). Here are the links to my work:

Go into the directory: http://nbviewer.ipython.org/github/evancchow/jazzml/tree/master/oscar/oscar2/

In that directory, take a look at:
Notebook 1, getting the notes and generating the n-grams: 6a. The N-Gram Pipeline Part I.
Notebook 2, all the advanced clustering/classification for the ngrams: 6b. The N-Gram Pipeline, Part II.
Notebook 3, creating and training the SVM needed for (6b): 7. Predictive Chord Modeling with Bitwise Note Vectors.

For viewing those notebooks, if you get a 400 error on the nbviewer, refresh the page once or twice. Working on this error.

Check out the subdirectory "./presentationfiles" if you'd like to see some pictures of generated vs. original music.

I worked mainly in the subdirectory "./oscar/oscar2", so all of my main code is over there (although it's in iPython files, so you'll have to either get iPython or view the ipython files with http://nbviewer.ipython.org/.


If you're new here: Included is a sample MIDI file (Oscar-Peterson-2.mid) for analysis and generation. For a quick demo, go to the subdirectory "./oscar/oscar2" and run things in this order (assuming you have the dependencies):

First, run the script oscar2.py as:

$ python oscar2.py > oscar2chords.txt (or $ python oscar2.py > oscar2notes.txt based on stdin)

This should give you two data files which represent the chords and the notes encoded in the original MIDI file: oscar2chords.txt, and oscar2notes.txt.

Next, to generate new notes with the N-Gram model, run iPython notebook 6a: The N-Gram Pipeline, Part I which writes out the n-grams to the file oscar2ngrams.txt.

Next, to generate the chord classifier (SVM) with chord notes, first run iPython notebook 5: Extract Chords to process the raw data in oscar2chords.txt, clean it up, and write it out to oscar2chords_extract.txt. Then run iPython notebook 7: Predictive Chord Modeling with Bitwise Note Vectors, which reads in that just-created file, trains an SVM to return those chords based on consonant pentatonic notes (semirandomly generated), and cPickles that SVM to disk.

Finally, for chord accompaniment and dynamic playback, run notebook 6b: The N-Gram Pipeline, Part II.

jazzml's People

Contributors

evancchow 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.