Water pressure:
This could be caused by higher than normal water pressure, that's why the noise changes when you turn on the sink (you reduce the flow to the shower).
Solution:
You could adjust the Pressure Reducing Valve for the whole house (if you have one), or install one on the line to the shower.
Reducing Washer:
In most newer shower heads, there is a washer that reduces the water flow to save water.
Solution:
Removing this washer and replacing it with a normal one should fix the problem (but then you'll be "wasting" water).
Diverter:
This might also be caused by the diverter (the mechanism that diverts the water to the shower head, rather than the tub spout), if the valve is not functioning properly it could cause noise as the water passes through it. This may be accompanied by a small amount of water still flowing from the tub spout when the shower is on (basically it could be creating a "water whistle", similar to how a flute works but with water instead of air).
Solution:
Replace the diverter.
Loose Pipes:
The noise could be increased by improperly secured plumbing, as the pipes are allowed to resonate freely.
Solution:
Properly fastening the pipes using clamps, may reduce the sound.
I'm not sure why you're suddenly having trouble with water hammer, the old plumbing may have been installed in such a way as to mitigate water hammer. Since I have no way of knowing what the old plumbing looked like and/or what you changed, I can't say for sure why you're having trouble.
So I'll simply talk about a couple ways of stopping the hammering.
The old way
We [plumbers] used to try to stop water hammer with 12-18" capped risers, and this method worked great, just long enough for us to be on to the next job.
![enter image description here](https://i.stack.imgur.com/IHIsJm.png)
The idea was that air would be trapped in the capped riser, which would provide a "cushion" for the fast moving water. This effect, however, is short lived. The air is eventually absorbed into the water, and the riser becomes completely filled with water.
The new way
Modern water hammer arrestors separate the water from the air, which allows them to function properly for much longer. Most devices either use a flexible bladder, or a piston type design to cushion the water and prevent hammering.
![enter image description here](https://i.stack.imgur.com/eTKQW.png)
These devices are usually less than 6" long, so they can fit in much tighter places. Cost wise they are comparable to the old method, so they are not going to break the bank. They are available with different connector types, so they can be connected to the existing plumbing in a variety of ways.
![enter image description here](https://i.stack.imgur.com/AMB3Q.png)
As with the old style standpipes, water hammer arrestors should be installed in line with the flow of water. Water hammer arrestors should be installed near all fast acting valves, to prevent water hammer.
Best Answer
All drains must be vented to the atmosphere, to allow water to exit smoothly.. Vent pipes (on the roof, can act as pitch pipes, as the wind blows across them.
Clogs (or restrictions-soon-to-be clogs) in the drain pipes can cause water to rise into the vent pipe, changing the pitch as the water level varies.
Sometimes a bird can block the pipe with a nest or other critter can bodily block the pipe.
In any case, checking the main vent pipe is a the first order.