Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -118,22 +118,54 @@ NOTE_TO_MIDI = {'C': 60, 'Cs': 61, 'Db': 61, 'D': 62, 'Ds': 63, 'Eb': 63, 'E': 6
|
|
| 118 |
MIDI_TO_NOTE = {60: 'C', 61: 'Db', 62: 'D', 63: 'Eb', 64: 'E', 65: 'F', 66: 'Gb', 67: 'G', 68: 'Ab', 69: 'A', 70: 'Bb', 71: 'B'}
|
| 119 |
# 1. Expanded Dictionary with 7ths, 9ths, and extended chords
|
| 120 |
CHORD_INTERVALS = {
|
| 121 |
-
|
| 122 |
-
'
|
| 123 |
-
'
|
| 124 |
-
'
|
| 125 |
-
'
|
| 126 |
-
'
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
'
|
| 130 |
-
'
|
| 131 |
-
'
|
| 132 |
-
'
|
| 133 |
-
'
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
}
|
| 138 |
|
| 139 |
# Pre-sort keys by length (longest first) to prevent the "greedy" bug
|
|
|
|
| 118 |
MIDI_TO_NOTE = {60: 'C', 61: 'Db', 62: 'D', 63: 'Eb', 64: 'E', 65: 'F', 66: 'Gb', 67: 'G', 68: 'Ab', 69: 'A', 70: 'Bb', 71: 'B'}
|
| 119 |
# 1. Expanded Dictionary with 7ths, 9ths, and extended chords
|
| 120 |
CHORD_INTERVALS = {
|
| 121 |
+
# --- 13ths ---
|
| 122 |
+
'maj13': [0, 4, 7, 11, 14, 21], # Root, 3rd, 5th, Maj7, 9th, 13th
|
| 123 |
+
'min13': [0, 3, 7, 10, 14, 21],
|
| 124 |
+
'13': [0, 4, 7, 10, 14, 21], # Dominant 13
|
| 125 |
+
'add13': [0, 4, 7, 21],
|
| 126 |
+
'madd13': [0, 3, 7, 21],
|
| 127 |
+
|
| 128 |
+
# --- 11ths ---
|
| 129 |
+
'maj11': [0, 4, 7, 11, 14, 17], # Root, 3rd, 5th, Maj7, 9th, 11th
|
| 130 |
+
'min11': [0, 3, 7, 10, 14, 17],
|
| 131 |
+
'11': [0, 4, 7, 10, 14, 17], # Dominant 11
|
| 132 |
+
'7#11': [0, 4, 7, 10, 18], # Lydian Dominant flavor
|
| 133 |
+
'm711': [0, 3, 7, 10, 17], # Min7 add 11
|
| 134 |
+
|
| 135 |
+
# --- 9ths ---
|
| 136 |
+
'maj9': [0, 4, 7, 11, 14],
|
| 137 |
+
'min9': [0, 3, 7, 10, 14],
|
| 138 |
+
'9': [0, 4, 7, 10, 14], # Dominant 9
|
| 139 |
+
'add9': [0, 4, 7, 14],
|
| 140 |
+
'madd9': [0, 3, 7, 14],
|
| 141 |
+
'7b9': [0, 4, 7, 10, 13], # Altered Dominant (flat 9)
|
| 142 |
+
'7#9': [0, 4, 7, 10, 15], # The "Hendrix" Chord (sharp 9)
|
| 143 |
+
|
| 144 |
+
# --- 7ths ---
|
| 145 |
+
'maj7': [0, 4, 7, 11],
|
| 146 |
+
'min7': [0, 3, 7, 10],
|
| 147 |
+
'7': [0, 4, 7, 10], # Dominant 7
|
| 148 |
+
'dim7': [0, 3, 6, 9], # Fully diminished 7th
|
| 149 |
+
'm7b5': [0, 3, 6, 10], # Half-diminished 7th
|
| 150 |
+
'aug7': [0, 4, 8, 10], # Augmented 7th
|
| 151 |
+
'mmaj7': [0, 3, 7, 11], # Minor-Major 7th (James Bond chord)
|
| 152 |
+
'7sus4': [0, 5, 7, 10], # Dominant 7 suspended 4th
|
| 153 |
+
|
| 154 |
+
# --- 6ths ---
|
| 155 |
+
'6': [0, 4, 7, 9], # Major 6th
|
| 156 |
+
'm6': [0, 3, 7, 9], # Minor 6th
|
| 157 |
+
|
| 158 |
+
# --- Sus & Altered Triads ---
|
| 159 |
+
'sus4': [0, 5, 7], # Suspended 4th (replaces 3rd)
|
| 160 |
+
'sus2': [0, 2, 7], # Suspended 2nd (replaces 3rd)
|
| 161 |
+
'aug': [0, 4, 8], # Augmented triad
|
| 162 |
+
'dim': [0, 3, 6], # Diminished triad
|
| 163 |
+
|
| 164 |
+
# --- Standard Triads & Power Chords ---
|
| 165 |
+
'maj': [0, 4, 7],
|
| 166 |
+
'min': [0, 3, 7],
|
| 167 |
+
'no3d': [0, 7], # Power chord (from your dataset)
|
| 168 |
+
'5': [0, 7] # Standard power chord notation
|
| 169 |
}
|
| 170 |
|
| 171 |
# Pre-sort keys by length (longest first) to prevent the "greedy" bug
|