Controlling the gain and range settings