Replaced getPitch with table lookup