Unify midi update state into one function that gets called periodically