We should definerly include rhythm. But remove ones with similar ratios. So we get just the melody and that's it. You can always speed up or slow down. Then consider the different enumerations.of these melodies. So now a melody can have an enumeration or label like c23b58 and c23b59 etc. Then we can analyze the structures and relations amongst these melodies. And one would hope, find categories and maybe determine a measure for goodness of the melody.