It has been asserted previously by the author that optimal control theory can be a valuable framework for theoretical studies about the shape that a wind instrument should have in order to satisfy some optimization criterion, inside a fairly general class. The purpose of the present work is to develop this new approach with a look at a specific criterion to be optimized. In this setting, the Webster horn equation is regarded as a controlled dynamical equation in the space variable. Pressure is the state, the control being made of two parts : one variable part, the inside diameter of the duct and one constant part, the weights of the elementary time-harmonic components of the velocity potential. Then one looks for a control that optimizes a criterion related to the definition of an oscillation regime as the cooperation of several natural modes of vibration with the excitation, the playing frequency being the one that maximizes the total generation of energy, as exposed by A.H. Benade, ...