  We study modularity of the characters of a vertex (super)algebra equipped
with a family of conformal structures. Along the way we introduce the notions
of rationality and cofiniteness relative to such a family. We apply the results
to determine modular transformations of trace functions on admissible modules
over affine Kac-Moody algebras and, via BRST reduction, trace functions on
minimal series representations of principal affine W-algebras.
