Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎡 AI Music Generator using LSTM & Deep Learning

An AI-powered music generation system that learns musical patterns from MIDI datasets using an LSTM (Long Short-Term Memory) neural network and generates original music in MIDI, WAV, and MP3 formats.


πŸ“– Overview

AI Music Generator is a Deep Learning project that uses an LSTM neural network to learn musical patterns from MIDI music files. After training on a dataset, the model generates new musical note sequences, converts them into MIDI, WAV, and MP3 formats, and allows users to download the generated music through a modern Flask web application.


✨ Features

  • 🎼 Train an AI model using MIDI datasets
  • 🧠 LSTM-based Deep Learning model
  • 🎹 Extract musical notes using Music21
  • 🎡 Generate original AI music
  • πŸ’Ύ Save generated music as MIDI (.mid)
  • πŸ”Š Convert MIDI to WAV
  • 🎧 Convert WAV to MP3
  • πŸ“₯ Download generated MP3 music
  • 🌐 Modern Flask Web Interface
  • πŸ“Š Interactive AI Music Generator Dashboard
  • 🎨 Responsive User Interface

πŸ›  Technologies Used

  • Python
  • TensorFlow
  • Keras
  • Flask
  • Music21
  • NumPy
  • HTML5
  • CSS3
  • JavaScript
  • FluidSynth
  • FFmpeg
  • Pydub

πŸ“‚ Project Structure

AI-Music-Generation/
β”‚
β”œβ”€β”€ dataset/
β”‚
β”œβ”€β”€ static/
β”‚   β”œβ”€β”€ style.css
β”‚   β”œβ”€β”€ script.js
β”‚   β”œβ”€β”€ generated_music.wav
β”‚   └── generated_music.mp3
β”‚
β”œβ”€β”€ templates/
β”‚   └── index.html
β”‚
β”œβ”€β”€ preprocess.py
β”œβ”€β”€ train.py
β”œβ”€β”€ generate.py
β”œβ”€β”€ midi_to_audio.py
β”œβ”€β”€ app.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
β”œβ”€β”€ notes.pkl
β”œβ”€β”€ music_model.keras
β”œβ”€β”€ best_model.keras
└── generated_music.mid

πŸš€ Installation

Clone Repository

git clone https://github.com/yourusername/AI-Music-Generation.git

Install Dependencies

pip install -r requirements.txt

Install FFmpeg

Download FFmpeg and add its bin folder to your system PATH.

Install FluidSynth

Install FluidSynth and download a SoundFont (.sf2) file (e.g., GeneralUser GS).


▢️ Run the Project

1. Preprocess Dataset

python preprocess.py

2. Train the Model

python train.py

3. Launch the Website

python app.py

Open your browser:

http://127.0.0.1:5000

Now you can:

  • Train the model
  • Generate AI Music
  • Convert MIDI to MP3
  • Download MP3

πŸ“Š Output

After successful generation, the project creates:

  • 🎡 generated_music.mid
  • πŸ”Š generated_music.wav
  • 🎧 generated_music.mp3
  • πŸ€– music_model.keras
  • πŸ’Ύ best_model.keras

πŸš€ Future Improvements

  • 🎼 Multiple instrument support
  • 🎹 Genre-specific music generation
  • 🎧 Built-in music player
  • ☁️ Deploy on Render or Railway
  • πŸ€– Transformer-based music generation
  • 🎡 Real-time AI music generation

πŸ‘©β€πŸ’» Author

Zakia Chandio

AI & Machine Learning Developer


⭐ If you like this project

Give this repository a ⭐ on GitHub.

About

🎡 AI-powered Music Generator using LSTM Deep Learning. Train on MIDI datasets, generate original music, convert MIDI to WAV/MP3 with FluidSynth & FFmpeg, and download music through a modern Flask web application built with Python, TensorFlow, Music21, HTML, CSS, and JavaScript.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages