Skip to content

xsatvik/MusicGeneration

Repository files navigation

Music Generation with LSTM

This project uses Long Short-Term Memory (LSTM) neural networks to generate music. The project consists of several key scripts for preprocessing music data, training the LSTM model, and generating new music.

Project Structure

  • preprocess.py: Contains functions and methods for preprocessing the music data.
  • train.py: Contains the code for training the LSTM model.
  • melodygenerator.py: Contains the code for generating new music based on the trained model.

Requirements

  • Python 3.x
  • TensorFlow
  • NumPy
  • Music21

You can install the required packages using:

pip install tensorflow numpy music21

Usage

Preprocessing the Data

To preprocess your music data, run:

python preprocess.py

This script will convert your raw music files into a format suitable for training the LSTM model.

Training the Model

To train the LSTM model, run:

python train.py

This will train the model on the preprocessed music data. Make sure you have enough computational resources as training deep learning models can be resource-intensive.

Generating Music

To generate new music, run:

python melodygenerator.py

This script will use the trained LSTM model to generate new music based on a seed sequence.

Generated Melody after feeding seed Screenshot 2024-07-21 at 5 49 29 PM

Adding Seed Music

You can add your seed music data in the melodygenerator.py script. The seed music is used as the initial input to the LSTM model for generating new music.

Contributing

If you'd like to contribute to this project, please fork the repository and submit a pull request. We welcome contributions in the form of bug fixes, feature additions, and improvements to existing code.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages