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.
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.
- πΌ 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
- Python
- TensorFlow
- Keras
- Flask
- Music21
- NumPy
- HTML5
- CSS3
- JavaScript
- FluidSynth
- FFmpeg
- Pydub
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
git clone https://github.com/yourusername/AI-Music-Generation.gitpip install -r requirements.txtDownload FFmpeg and add its bin folder to your system PATH.
Install FluidSynth and download a SoundFont (.sf2) file (e.g., GeneralUser GS).
python preprocess.pypython train.pypython app.pyOpen your browser:
http://127.0.0.1:5000
Now you can:
- Train the model
- Generate AI Music
- Convert MIDI to MP3
- Download MP3
After successful generation, the project creates:
- π΅ generated_music.mid
- π generated_music.wav
- π§ generated_music.mp3
- π€ music_model.keras
- πΎ best_model.keras
- πΌ 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
Zakia Chandio
AI & Machine Learning Developer
Give this repository a β on GitHub.