Relating melody to chords