find max and min midi