num_notes = note_group->num_notes;
+ struct { int pitches[1]; const char *name; } octaves[] = {
+ { {0}, "Octave"}
+ };
+
struct { int pitches[2]; const char *name; } intervals[] = {
{ {0, 1}, "Minor 2nd"},
{ {0, 2}, "Major 2nd"},
for (i = 0; i < num_notes; i++) {
notes[i].relative_pitch = notes[i].midi_pitch - bass_pitch;
- while (notes[i].relative_pitch > 12)
+ while (notes[i].relative_pitch >= 12)
notes[i].relative_pitch -= 12;
}
+ for (i = 0; i < ARRAY_SIZE (octaves); i++) {
+ if (_chord_signature_matches (notes, num_notes, octaves[i].pitches, 1))
+ chord_name = octaves[i].name;
+ }
+
for (i = 0; i < ARRAY_SIZE (intervals); i++) {
if (_chord_signature_matches (notes, num_notes, intervals[i].pitches, 2))
chord_name = intervals[i].name;