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.
- 🎼 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
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
- Python
- TensorFlow / Keras
- LSTM / RNN
- music21
- NumPy
- MIDI
- HTML
- CSS
- JavaScript
Clone the repository:
git clone https://github.com/Faisal20076/CodeAlpha_AIMusicGenerator.gitNavigate to the project directory:
cd CodeAlpha_AIMusicGeneratorCreate a Python virtual environment:
python -m venv venvActivate the virtual environment on Windows:
venv\Scripts\activateInstall the required dependencies:
pip install -r requirements.txtStart the application using the project's Python entry point.
For example:
python app.pyThen open the local URL shown in the terminal.
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.
The application uses an LSTM/RNN neural network to learn patterns from the processed MIDI sequences.
The training process includes:
- Loading MIDI data
- Preprocessing musical notes
- Creating training sequences
- Encoding musical events
- Training the LSTM/RNN model
- Monitoring training progress
- Preparing the trained model for 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.
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.
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.
Faisal K
GitHub:
https://github.com/Faisal20076


