Chemical Concepts Demonstrated: The relationship between the molar weight of a gas and the speed of sound in that gas; the relationship between the velocity of the particles of a gas and the speed of sound in that gas
The different gases provide different pitches in the same pipe.
The velocity of sound in a gas is proportional to the ratio of the specific heats at constant pressure and constant volume (g) and the molecular weight (M).
U = (gRT/M)1/2
Assuming that g is reasonably constant (it ranges from 1.15 to 1.66 for common gases), the speed of sound should increase as the molecular weight of the gas decreases. Since the product of the wavelength times the frequency of a wave is equal to the speed of the wave, and the "wavelength" of the organ pipe is more or less constant, the frequency of the wave must increase as the velocity of sound increases.
This same phenomenon explains why one's voice becomes substantially higher after one inhales a quantity of helium. This can be done in class, but caution should be taken, as helium can act as an anaesthetic and/or an asphyxiant. Although hydrogen gas would produce an even higher pitched voice, it is not recommended for obvious safety concerns.