Madonna learned the hard way this weekend you can't throw a banger in The Hamptons without neighbors calling the cops.

We're told Madge threw her 57th B-Day party Saturday night and it was so loud the neighbor's houses were shaking. Law enforcement tells us, around 2:30 AM, they were called after a neighbor complained about ear-shattering noise.

Cops say they never spoke with Madonna, because by the time they got there the partygoers knew something was about to go down so they muted the noise.

One source says ... after cops left the party started raging again.