added formula for rtmidi