Giter VIP home page Giter VIP logo

ai-music's Introduction

AI Music Generation

This project focuses on using deep learning techniques to generate music with the help of artificial intelligence.

Table of Contents

presentation

PPTX Presentation

Introduction

The goal of this project is to train a deep learning model using LSTM (Long Short-Term Memory) to generate music. The model is trained on a dataset of MIDI files obtained from the Lakh MIDI Dataset. The generated music can be played, paused, and stopped using a GUI built with tkinter and pygame libraries.

Dataset

The dataset used for training is the Lakh MIDI Dataset, which contains a large collection of MIDI files from various genres. You can download the dataset from the provided link and extract the MIDI files for further processing.

Data Preprocessing

To prepare the MIDI files for training, the project involves the following steps:

  1. Extract the MIDI files from each folder and remove the folder structure.
  2. Rename the MIDI files for easier identification.
  3. Use the pretty_midi library to extract the notes and velocities from each MIDI file.
  4. Convert the extracted notes and velocities into NumPy arrays.
  5. Normalize the arrays to bring the values within a specific range.
  6. Combine the normalized notes and velocities arrays into a single array, which will serve as the input data for the model.

Model Training

The deep learning model is built using TensorFlow and consists of an LSTM layer followed by two dense layers. The model is trained using the input and target data, which are split into training and validation sets. The training progress and loss are monitored and visualized to evaluate the model's performance.

Inference and Music Generation

Once the model is trained, it can be used to generate new music. The model takes a sequence of input data as an initial seed and predicts the next notes and velocities in the sequence. This process can be repeated iteratively to generate longer music compositions. The generated music is then converted to MIDI format using the music21 library.

GUI Integration

A graphical user interface (GUI) is implemented using the tkinter library, allowing users to interact with the generated music. The GUI provides controls to play, pause, and stop the music. The pygame library is used to handle audio playback.

Contributing

Contributions to this project are welcome. If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.

Acknowledgements

You can add reference to the following paper if need to use it somewhere:

Colin Raffel. "Learning-Based Methods for Comparing Sequences, with Applications to Audio-to-MIDI Alignment and Matching". PhD Thesis, 2016.

ai-music's People

Contributors

rich627 avatar

Stargazers

 avatar smithart 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.