Does anyone know how to stop a woodpecker from drumming on metal gutters??

I don't have helpful tips, but you should be aware that in the USA, woodpeckers are federally protected:

Woodpeckers are classified as migratory, nongame birds and are protected by the Federal Migratory Bird Treaty Act. The red-cockaded woodpecker (Picoides borealis) and the ivory-billed woodpecker (Campephilus principalis) are on the Endangered Species list and are thus offered full protection. When warranted, woodpeckers other than the endangered species can be killed but only under a permit issued by the Law Enforcement Division of the US Fish and Wildlife Service upon recommendation of USDA-APHIS-Wildlife Services personnel. Generally, there must be a good case to justify issuance of a permit.

Woodpeckers are commonly protected under state laws, and in those instances a state permit may be required for measures that involve lethal control or nest destruction. Other methods of reducing woodpecker damage do not infringe upon their legal protection status. Threatened or endangered species, however, cannot be harassed.

You should approach the pecker with respect as it may cause you more than just lost sleep if you handle it the wrong way.

Woodpecker info

/r/homeowners Thread