Update midi code to C++
Update midi code to C++