Noise is a well known challenge for hydraulic systems and hydrostatic machines is one of the largest noise contributors in a hydraulic system. The noise from the machine originates from flow pulsations in the discharge and suction ports, as well as pulsations in piston forces and bending moments. To the design a quite hydraulic machine is a difficult task where many different objectives need to be considered. This paper presents a generic method for how optimization based on simulation models could be used to design quieter hydraulic machines. In order to stay competitive on a global market an efficient product development process is essential for all manufacturing industries. By using simulation-s tools in the design process, the product can be analysed before the actual product is manufactured. Furthermore, in order to find an optimal design of the machine with respect to noise, a comprehensive dynamic simulation model is needed. The model contains all important noise contributors. In the paper, the simulation models are used together with a non-gradient optimization method in order to find the best possible design. A vital part when using optimization to support design is always to formulate the objective function. As mentioned above, noise is generated from different sources and all these sources need to be considered when the objective function is formulated. For example a design that minimizes flow pulsations in the suction port will surely perform badly in some other objective. Therefore noise minimization could be looked upon as a typical multi-objective optimization problem. It is also not evident how the different objective should be ranked because the observed noise level is strongly depending on the system in which the machine is to be used. The paper also considers whether the objective function should be formulated in time or frequency domain. Traditionally, simulation of machine performance is conducted in the time domain, but the human ear hears noise in the frequency domain and perceives high and low frequencies differently. Furthermore, transformation from piston forces into emitted noise is much higher at high-frequency content than low-frequency content. This makes it natural to formulate the objective function in frequency domain, which raises the question of how the different harmonic should be ranked. In the paper a number of different approaches to formulate the objective function is presented and evaluated. The objectives considered are flow pulsation in both discharge and suction ports, as well as pulsation in piston forces and bending moments. Furthermore, the objectives are studied in both time and frequency domain. The design application is a variable hydraulic machine of bent axis type with nine pistons, which is operated both as a pump and a motor. However, the methods presented in the paper could be applied to other types of hydraulic machines as well.