Viscous-to-viscoelastic transition in phononic crystal and metamaterial band structures.