Creative music generation experiments using LSTM, GRU, and GAN models over MIDI note sequences.
MusiGAN explores symbolic music generation rather than audio synthesis. The repo contains legacy notebooks, a standalone GAN script, serialized note data, trained/output artifacts, and generated MIDI examples from LSTM, GRU, and GAN experiments.
The portfolio-ready framing is intentionally careful:
- This is a creative ML research artifact, not a production music model.
- Evaluation is listening-first, supported by proposed symbolic metrics.
- MIDI provenance matters. Some committed source material is game/anime-derived and should not be treated as a clean redistributable benchmark.
- No new datasets, checkpoints, or generated media are added in this upgrade pass.
| Artifact | Purpose |
|---|---|
Models/CudNN_final.ipynb |
Legacy LSTM/GRU notebook using CuDNN recurrent layers |
Models/GAN_final.ipynb |
Legacy GAN notebook for symbolic sequence generation |
Models/gan_final.py |
Scripted GAN training/generation path |
Data/notes |
Serialized note/chord token stream used by generation code |
Data/Pokemon MIDIs/ |
307 MIDI files observed locally |
Data/Piano MIDIs/ |
92 MIDI files observed locally |
Output midi/GAN midi/ |
Existing GAN-generated MIDI and HDF5 artifacts |
Output midi/GRU midi/ |
Existing GRU-generated MIDI artifacts |
Output midi/LSTM midi/ |
Existing LSTM-generated MIDI artifact |
| docs/REPRODUCIBILITY.md | Legacy environment and rerun notes |
| docs/DATA_PROVENANCE.md | Data source, risk, and licensing notes |
| docs/README_EVAL.md | Listening rubric and proposed symbolic metrics |
| reports/SAMPLE_REPORT.md | Generated-sample tracking template |
Generate novel symbolic music sequences from a corpus of MIDI files, then compare whether LSTM, GRU, or GAN-style approaches produce more usable musical sketches.
This is not an accuracy-maximization project. A useful output is one that has musical continuity, rhythmic coherence, and enough variation to be worth human arrangement.
The project works with MIDI files, which encode note events rather than raw waveforms. The committed corpus includes:
- 307 Pokemon MIDI files.
- 92 piano MIDI files from game and media themes.
- A serialized note stream at
Data/notes.
Important caveat: these files may include copyrighted compositions or derivative transcriptions. Treat them as legacy research inputs for local experimentation, not as a clean public training dataset. See docs/DATA_PROVENANCE.md.
The core pipeline is:
- Parse MIDI files with
music21. - Convert notes/chords/rests into symbolic tokens.
- Encode token sequences as integer windows.
- Train sequence models:
- CuDNNLSTM.
- CuDNNGRU.
- GAN generator/discriminator experiments.
- Convert predicted symbolic sequences back into MIDI with
music21. - Evaluate by listening and by inspecting symbolic structure.
The repo currently contains generated outputs and trained artifacts, but the evaluation is not yet packaged as a formal benchmark.
| Track | Current evidence |
|---|---|
| LSTM | Generated MIDI artifact in Output midi/LSTM midi/ |
| GRU | Generated MIDI artifacts in Output midi/GRU midi/ |
| GAN | Generated MIDI and HDF5 artifacts in Output midi/GAN midi/ |
| Evaluation | Listening rubric and proposed symbolic metrics now documented |
The strongest honest claim is that GAN outputs were the preferred creative direction during exploration, while LSTM/GRU outputs tended to become repetitive. That preference is qualitative until the sample report is filled in with scored listening notes and symbolic metrics.
This is a legacy notebook-first project. The original stack used Python 3,
TensorFlow 1.x/Keras-era APIs, music21, and GPU-oriented CuDNN layers. The
current code is useful for audit and refactoring, but should not be treated as a
one-command modern training pipeline.
See docs/REPRODUCIBILITY.md before rerunning.
A safer public demo should avoid redistributing training MIDI or questionable generated files. The recommended demo shape is:
- Use a small synthetic or clearly licensed MIDI seed.
- Generate a short symbolic continuation.
- Display piano-roll or token-level structure.
- Include listening-rubric scores and symbolic metrics.
- Make provenance and licensing warnings visible.
- Move legacy data/checkpoints into external artifact storage with clear licensing gates.
- Add a pinned legacy environment for exact reruns.
- Refactor
Models/gan_final.pyto remove local absolute paths. - Export a small generated-sample table with listening scores.
- Add symbolic metrics such as pitch-class distribution, repetition rate, interval distribution, note-density, and unique n-gram rate.