Chord Note Music Database
A robust, fully-populated MySQL chord library for the entire chromatic scale—bilingual (Italian & English)—with export utilities.
Project Overview
The Chord Note Music Database is a meticulously designed MySQL schema that catalogs chord definitions for every note in the chromatic scale—naturals, sharps, flats. Each note lives in its own table and stores chord names and interval lists in both Italian and English.
Authored and maintained by Luca Bocaletto, this project delivers:
- Bilingual chord reference: Italian & English names and intervals.
- All common chord extensions up to the 13th (triads, 6ths, 7ths, 9ths, 11ths, 13ths).
- Production-ready tables with timestamps and unique constraints.
- Zero-friction export utilities to convert your SQL dump into a single JSON file.
Key Features
Uniform Table Schema
All tables (`NoteDO`, `NoteREdiesis`, `NoteSIb`, etc.) share this DDL:
CREATE TABLE NoteXY (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
note_ita VARCHAR(3) NOT NULL COMMENT 'e.g. Do♯',
chord_ita VARCHAR(50) NOT NULL COMMENT 'e.g. Do♯ Maggiore 7',
chord_note_ita VARCHAR(100) NOT NULL COMMENT 'e.g. Do♯-Mi-Sol♯-Si',
note_eng VARCHAR(2) NOT NULL COMMENT 'e.g. C#',
chord_eng VARCHAR(20) NOT NULL COMMENT 'e.g. C#Maj7',
chord_note_eng VARCHAR(100) NOT NULL COMMENT 'e.g. C#-E#-G#-B#',
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY uk_ita(note_ita, chord_ita),
UNIQUE KEY uk_eng(note_eng, chord_eng)
);
Full Data Coverage
- 12 chromatic notes + enharmonic flats/sharps.
- Complete
INSERT
scripts for chords up to the 13th. - Automatic
created_at
/updated_at
fields. - Optional JSON export for web/mobile consumption.
Installation & Usage
- Clone the repository:
git clone https://github.com/bocaletto-luca/Chords-Note-Music.git
- Create & select your database:
CREATE DATABASE ChordNoteMusic; USE ChordNoteMusic;
- Import the schema & data:
mysql -u <user> -p ChordNoteMusic < file.sql
- Test a query:
SELECT * FROM NoteRE WHERE chord_eng LIKE 'D%9%';
Export Utilities
Choose your preferred workflow to convert file.sql
into a single chords.json
:
-
Bash + Python
sql_to_json.sh
(requiresmysql
client &python3
)chmod +x sql_to_json.sh ./sql_to_json.sh # → generates chords.json
-
Pure Python
sql_to_json.py
(no DB server required)# optional: pip install sqlparse python3 sql_to_json.py file.sql [output.json] # → default output.json = chords.json