Coder Social home page Coder Social logo

marysalvana / music_gen_deep_learning Goto Github PK

View Code? Open in Web Editor NEW

This project forked from simeonedef/music_gen_deep_learning

0.0 1.0 0.0 39.67 MB

Music Generation using Deep Learning in Python with Tensorflow & Keras

License: MIT License

Python 100.00%

music_gen_deep_learning's Introduction

Music Generation Using Deep Learning

Sequence generation using LSTM
This was developped as part of my bachelor thesis at The University of Manchester

@simeonedef License MIT Python 3.6 Release date: june 2019

Requirements

  • Python 3.6
  • Tensorflow==1.12.0
  • Keras==2.2.4
  • H5py==2.9.0
  • Music21
  • PyGame and PyGame Menu (if you want to use generate_GUI.py)

More information in the requirements.txt file

Setting up the project

To install all the required packaged simply run from the project's root directory:

pip install -r requirements.txt

See next steps to run the model and generate some music!

Usage example

Training the model

You need to first train the model which you can do by running one of the training scripts like so:

python train_single.py

if you to have only a single class as output, which means only one note playing at a time; otherwise:

python train_multiclass.py

if you want to take into account multiple notes being played at once.

Both training scripts will use every midi file in ./midi to train the network. Currently the directory contains all the pieces from Bach's Well-Tempered Clavier II as well as some additional files that you can decide to use if you enable their usage in the train_single.py file.

Generating music

Once you have trained the network, you will have a set of weights which you can use instead of the weights.hdf5 file that comes in the repository. You can then generate using the trained network using generate.py like so:

python generate.py

The output will be test_output.mid. There is already an included midi file as an example of what the network can generate.

Additionally there is a GUI that you can use that will generate and play the music provided you have installed PyGame and PyGameMenu which you can run like so:

python generate_GUI.py

Going forward

Below is a list of a few more things I would like to implement in this project:

  • finishing up train_output.py and getting a set of weights to generate music with multiple notes playing at once (in another private repo)
  • making multiple set of weights for different genres of music
  • implementing an option to generate fully random music
  • turning it into a web app to be accessible from everywhere Click here !

music_gen_deep_learning's People

Contributors

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