Looking for way to add notes

Need to find the average of a bunch of notes. Had plan to add notes by
multiplying their note index times their octave, however this results in
a lot of duplicate note values.