Let (X,theta ) be a compact complex manifold X equipped with a smooth (but not necessarily positive) closed (1, 1)-form theta . By a well-known envelope construction this data determines, in the case when the cohomology class [theta ] is pseudoeffective, a canonical theta -psh function u_{theta }. When the class [theta ] is Kähler we introduce a family u_{beta } of regularizations of u_{theta }, parametrized by a large positive number beta , where u_{beta } is defined as the unique smooth solution of a complex Monge–Ampère equation of Aubin–Yau type. It is shown that, as beta rightarrow infty , the functions u_{beta } converge to the envelope u_{theta } uniformly on X in the Hölder space C^{1,alpha }(X) for any alpha in ]0,1[ (which is optimal in terms of Hölder exponents). A generalization of this result to the case of a nef and big cohomology class is also obtained and a weaker version of the result is obtained for big cohomology classes. The proofs of the convergence results do not assume any a priori regularity of u_{theta }. Applications to the regularization of omega -psh functions and geodesic rays in the closure of the space of Kähler metrics are given. As briefly explained there is a statistical mechanical motivation for this regularization procedure, where beta appears as the inverse temperature. This point of view also leads to an interpretation of u_{beta } as a “transcendental” Bergman metric.