Coder Social home page Coder Social logo

nncompose's Introduction

NNCompose - The Neural Net Composer

Warning: This project is still in major development and is not intended for personal use yet.

The idea behind this is that a MIDI file stores all of the information behind a song. If one can convert a MIDI file from a binary format, to a human-readable format, all of the structure of the song (note, timing, velocity, etc) is open to the world. With this information, and a clever setup for a neural network to 'learn' about a song, one should be able to generate new music based on the music used to train the network. A more detailed write-up about how this accomplished is coming soon. An example of how the neural net can learn a song is shown below. This maps the first 100 notes in the song with the actual note in red and the predicted note in blue. This is during an early training iteration, so it has not yet learned the minute details and is instead mapping along with the overall structure of the song.

Song Map

The Tools

Keras is the main library for building out the neural network and training it. To convert the MIDI files to a useful format, the program relies on the "midi2csv" program that works in UNIX environments: midicsv. The rest is all written in Python and relies on numpy and pandas for formatting the data and accessing things as necessary for training and predictions.

Example

The most successful iteration of the project so far trained on 6 of Bach's Cantate's for solo guitar. It also incorporates the ability to play chords and rests. It's quite large as I just generated 15+ minutes to see how consistent the algorithm was - but also could be quite interesting. MP3 Bach Example

To Do

  • Comment code
  • Add installation instructions
  • Add direct use modules with structure python train_midi_model.py output_model_name song_list.txt and python generate_music.py input_model_name output.mp3
  • Add usage instructions
  • Add better error handling

nncompose's People

Contributors

zwmiller avatar

Stargazers

 avatar  avatar Kyle Tolle avatar

Watchers

James Cloos avatar  avatar

Forkers

morning-ye

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.