finding patterns in midi files