Extracted Midi Parser/Beginning Scale Detector

Double checking before meeting to ensure parser is reading files
correctly, previously, notes where off any where from a whole step to a
step and a half. Used two simple scales of one instrument Midi, and
guitar songs I know to check correctness. Currently trying to decide how
to determine scales, the problem is when detecting, for example, a major
scale in the key of E. the notes are no longer straight, straight,
sharp, straight, straight, straight, sharp, straight.