  We study $\mathbb Z$-graded modules of nonzero level with arbitrary weight
multiplicities over Heisenberg Lie algebras and the associated generalized loop
modules over affine Kac-Moody Lie algebras. We construct new families of such
irreducible modules over Heisenberg Lie algebras. Our main result establishes
the irreducibility of the corresponding generalized loop modules providing an
explicit construction of many new examples of irreducible modules for affine
Lie algebras. In particular, to any function $\phi:\mathbb N\rightarrow
\{\pm\}$ we associate a $\phi$-highest weight module over the Heisenberg Lie
algebra and a $\phi$-imaginary Verma module over the affine Lie algebra. We
show that any $\phi$-imaginary Verma module of nonzero level is irreducible.
