Skip to content

Repository files navigation

🎵 AI Music Generator

An AI-powered music generation application that uses MIDI data and an LSTM/RNN neural network to learn musical patterns and generate new music sequences.

✨ Features

  • 🎼 MIDI dataset support
  • 📚 MIDI note and chord preprocessing
  • 🧠 LSTM/RNN-based music generation
  • 🔥 Neural network model training
  • 🎵 Generation of new music sequences
  • 💾 Generated MIDI file download
  • 📊 Training progress and model status
  • 🎹 Classical music generation support
  • 🖥️ Modern and responsive user interface

🧠 How It Works

The application follows an AI music-generation pipeline:

MIDI Files
    ↓
MIDI Preprocessing
    ↓
Note & Chord Sequences
    ↓
Numerical Encoding
    ↓
Training Sequences
    ↓
LSTM/RNN Model
    ↓
Music Generation
    ↓
Generated Note Sequence
    ↓
MIDI File
    ↓
Download / Playback

📸 Screenshots

🎵 AI Music Generator

AI Music Generator

🧠 Model Training

Model Training

🎶 Generated Music

Generated Music

🛠️ Technologies Used

  • Python
  • TensorFlow / Keras
  • LSTM / RNN
  • music21
  • NumPy
  • MIDI
  • HTML
  • CSS
  • JavaScript

⚙️ Installation

Clone the repository:

git clone https://github.com/Faisal20076/CodeAlpha_AIMusicGenerator.git

Navigate to the project directory:

cd CodeAlpha_AIMusicGenerator

Create a Python virtual environment:

python -m venv venv

Activate the virtual environment on Windows:

venv\Scripts\activate

Install the required dependencies:

pip install -r requirements.txt

▶️ Running the Application

Start the application using the project's Python entry point.

For example:

python app.py

Then open the local URL shown in the terminal.

🎼 MIDI Dataset

MIDI files are used as the training data for the music-generation model.

The application processes MIDI files and extracts musical information such as notes and chords before converting them into sequences suitable for neural-network training.

Additional MIDI files can be added to the project's MIDI dataset directory.

🧠 Model Training

The application uses an LSTM/RNN neural network to learn patterns from the processed MIDI sequences.

The training process includes:

  1. Loading MIDI data
  2. Preprocessing musical notes
  3. Creating training sequences
  4. Encoding musical events
  5. Training the LSTM/RNN model
  6. Monitoring training progress
  7. Preparing the trained model for music generation

🎶 Music Generation

After the model has been trained, it generates a new sequence of musical notes based on the patterns learned from the MIDI dataset.

The generated sequence is converted back into a MIDI file that can be downloaded and played using a MIDI-compatible player.

📁 Project Structure

CodeAlpha_AIMusicGenerator/
│
├── data/
│   └── midi/
│
├── generated/
│
├── model/
│
├── preprocessing/
│
├── generation/
│
├── screenshots/
│   ├── music-generator.png
│   ├── model-training.png
│   └── generated-music.png
│
├── app.py
├── requirements.txt
└── README.md

The exact folder structure may vary depending on the generated project implementation.

🎯 Project Objective

The objective of this project is to demonstrate how deep learning can be applied to music generation by learning patterns from MIDI-based musical data and generating new musical sequences.

👨‍💻 Author

Faisal K

GitHub:
https://github.com/Faisal20076

About

AI-powered music generation application using LSTM/RNN and MIDI data, with training, music generation, and MIDI download functionality.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages