We compute generating functions for the Hedge numbers of the moduli spaces
of H-stable rank 2 sheaves on a rational surface S in terms of theta functi
ons for indefinite lattices. If H lies in the closure of the ample cone and
has self-intersection 0, it follows that the generating functions are Jaco
bi forms. In particular the generating functions for the Euler numbers can
be expressed in terms of modular forms, and their transformation behaviour
is compatible with the predictions of S-duality. We also express the genera
ting functions for the signatures in terms of modular forms. It turns out t
hat these generating functions are also (with respect to another developing
parameter) the generating function for the Donaldson invariants of S evalu
ated on all powers of the point class.