贾

PROJECT — 2026

Melody Harmonizer

A neural network that harmonizes a melody — one chord per note — with a live demo that plays it back as MIDI and audio.

A BiLSTM sequence-labeling model predicts a chord for every melody note, trained on the Nottingham folk dataset. The chord vocabulary is transposition-closed (121 chords), the data is augmented across all 12 keys, and train/test splits are made by song so transposed copies never leak across.

Benchmarked against a size-matched Transformer encoder over three seeds, the BiLSTM led on every metric: 66.8% exact and 76.8% key-aware functional accuracy on a held-out test set, against a 25% baseline.

Raw per-note predictions change chords too often, so a learned chord-transition Viterbi decoder smooths them, bringing the chord-change rate from 8% over ground truth to within 5%. It runs as a Gradio app on Hugging Face Spaces with MIDI and audio output.

Python · PyTorch · music21 · Gradio