]> git.cworth.org Git - scherzo/blobdiff - scherzo.c
Fix chord analysis for intervals larger than an octave
[scherzo] / scherzo.c
index 676f5b459001412ad4ce7c4605dbc07e007cba8c..a13196e5b802563f7f8906e7cd42157e5c7ed7c0 100644 (file)
--- a/scherzo.c
+++ b/scherzo.c
@@ -521,6 +521,8 @@ scherzo_analyze_chord (scherzo_t *scherzo)
 
     for (i = 0; i < num_notes; i++) {
        notes[i].relative_pitch = notes[i].midi_pitch - bass_pitch;
+       while (notes[i].relative_pitch > 12)
+           notes[i].relative_pitch -= 12;
     }
 
     for (i = 0; i < ARRAY_SIZE (intervals); i++) {