  We show that a large class of maximally degenerating families of
n-dimensional polarized varieties come with a canonical basis of sections of
powers of the ample line bundle. The families considered are obtained by
smoothing a reducible union of toric varieties governed by a wall structure on
a real n-(pseudo-)manifold. Wall structures have previously been constructed
inductively for cases with locally rigid singularities and by Gromov-Witten
theory for mirrors of log Calabi-Yau surfaces and K3 surfaces by various
combinations of the authors. For trivial wall structures on the n-torus we
retrieve the classical theta functions. Possible applications include mirror
symmetry, geometric compactifications of moduli of certain polarized varieties
via stable pairs and geometric quantization.
