basic implementation of a midi parser in c++