Chordlock is an intelligent MIDI chord detection library that provides key-context aware chord analysis. Unlike traditional chord detection systems, Chordlock considers the musical key to provide contextually appropriate chord interpretations.
The same notes can represent different chords depending on the musical context:
# E-C-E-G-D notes
./chordlock -N 52,60,64,67,74 -k C # → C/E [I] in C major
./chordlock -N 52,60,64,67,74 -k Em # → Em7(addâ™6) [i7] in E minor
#include "Chordlock.hpp"
Chordlock detector;
detector.setKeyContext(0, false); // C major
detector.noteOn(60, 80); // C
detector.noteOn(64, 80); // E
detector.noteOn(67, 80); // G
auto result = detector.detectChord();
// result.chordName = "C"
auto degree = detector.analyzeCurrentNotesToDegree(0, false);
// degree = "I"
Chordlock v2.0 provides a clean, organized structure:
src/
- Core C++ engine with key-context analysisbuild/
- CLI binary with Roman numeral analysisweb_app/
- Interactive demo applicationschordlock-mcp/
- AI integration via Model Context Protocoldocs/
- This documentation siteC/E
, F/G
)G7#5b9
, Dm7b5
, C7alt
Get started with the Quick Start Guide or explore the API Reference.