A rectangular baler having a bale-forming chamber, a piston that is reciprocatable in the bale-forming chamber for compressing biomass to form bales. The dimensions of part of the interior of the bale-forming chamber are adjustable under the influence of at least one actuator the energization of which is controllable. A controller for controlling the energization of the at least one actuator is adapted for generating a least a first control signal in accordance with a target pressure mode of the baler, a second control signal in accordance with a target force mode of the baler, and a third control signal in accordance with a target weight mode of the baler.