  A theory for spin and lattice couplings to the electronic states in
high-T$_C$ oxides is presented, with HgBa$_2$CuO$_4$ as an example. A simple
analytical model suggests that the barrel band is sensitive to potential
perturbations with long-range Fourier components, and that gaps can be opened
at the Fermi energy. This is confirmed in self-consistent band calculations for
modulations in elongated supercells, where spin waves and phonon coupling
compete for equal q-vectors. It is argued that the wavelengths of spin-wave
modulations and of the phonon modes with large coupling, depend on the doping.
This mechanism supports the idea that pseudogaps are caused by stripe like
spin-modulations in underdoped systems, while superconductivity is attributed
to enhanced electron-phonon coupling for long wavelength phonons.
