Politician interview mode on
“If what you’re asking is whether my bugle would still work when full of water then the answer is that it has the potential to follow the same principals”
<shameless Reddit copy-paste follows>
Sound is made of compression waves. The fundamental equation here is
Speed = Frequency * Wavelength
In different mediums (air, water, other gasses) the speed of wave propagation will change, so the relation between frequency and wavelength will change. In general, the denser medium, the speed of sound will change. The speed of sound in water is a bit more than 4 times faster than it is in air.
Now for instruments. There are mechanical issues with some instruments playing in different mediums. If a flute is filled with water, you would have to blow water instead of air, but the energy required would need to be greater, since the water is denser. A stringed instrument, such as a guitar, would function just fine, but the water would dampen the sound, so the note would not last very long and the string would stop vibrating after a short amount of time.
What would they sound like? Well a guitar would play the same note. See the sound is set by the properties of the string, so for a given length you get a certain frequency, based on the speed of sound in a string. So playing different notes is just altering the length (fretting.) This would not change underwater, so guitars would play the same note but sound different to us, because the damping would cause the string to stop very quickly.
A wind instrument like a flute, would change drastically (assuming you could still play it, a human probably can’t blow water the right way.) In wind instruments, the wavelength is set related to the length of the air from the mouthpiece to the holes (the length is changed by the fingering). But the wave is propagating in the air, rather than a string, so if you replaced the air with water, the frequency would change drastically. So a flute would be over 4 times higher frequency in water than in air. So it would be about 2 octaves higher, you could still hear it.