Added dynamic_to_midi() method.