As discussed in Standing Waves and Musical Instruments, instruments produce musical tones by trapping waves of specific lengths in the instrument. It's pretty easy to see why the standing waves on a string can only have certain lengths; since the ends of the strings are held in place, there has to be a node in the wave at each end. But what is it that makes only certain standing waves possible in a tube of air?
To understand that, you'll have to understand a little bit about what makes waves in a tube different from waves on a string. Waves on a string are transverse waves. The string is stretched out in one direction (call it "up and down"), but when it's vibrating, the motion of the string is in a different direction (call it "back and forth"). Take a look at this animation. At the nodes (each end, for example), there is no back and forth motion, but in between the nodes, the string is moving back and forth very rapidly. The term for this back-and-forth motion is displacement. There is no displacement at a node; the most displacement happens at an antinode.
The standing waves of air in a tube are not transverse waves. Like all sound waves, they are longitudinal. So if the tube of air is going in a certain direction (call it "left and right"), the vibrations in the air are going in that same direction (in this case, they are rushing "left and right").
But they are like the waves on a string in some important ways. Since they are standing waves, there are still nodes - in this case, places where the air is not rushing back and forth. And, just as on the string, in between the nodes there are antinodes, where the displacement is largest (the air is moving back and forth the most). And when one antinode is going in one direction (left), the antinodes nearest it will be going in the other direction (right). So, even though what is happening is very different, the end result of standing waves "trapped" in a tube will be very much like the end result of standing waves "trapped" on a string: a harmonic series based on the tube length.
More on that harmonic series in the next section. First, let's talk about why only some standing waves will "fit" in a tube of a particular length. If the tube were closed on both ends, it's easy to see that this would be a lot like the wave on the string. The air would not be able to rush back and forth at the ends, so any wave trapped inside this tube would have to have nodes at each end.
It's very difficult to draw air that is rushing back and forth in some places and standing still in other places, so the figures below show the waves as if they are transverse. But here is an
animation that may give you some idea of what is happening in a longitudinal standing wave.
Now, a closed tube wouldn't make a very good musical instrument; it wouldn't be very loud. Most of the sound you hear from an instrument is not the standing wave inside the tube; the sound is made at the open ends where the standing waves manage to "leak out" of the tube a little bit. Physicists sometimes study the acoustics of a tube closed at both ends (called a Kundt tube), but most musical instruments have at least one open end. An instrument that is open at both ends may be called open-open, or just an open tube instrument. An instrument that is only open at one end may be called open-closed, or a closed tube or stopped tube instrument (or sometimes semi-closed or half-closed). This is a little confusing, since such instruments (trumpets, for example) still obviously have one open end.
Now, there's nothing stopping the air from rushing back and forth at the open end of the tube. In fact, the waves that "fit" the tube are the ones that have antinodes at the open end, so the air is in fact rushing back and forth there, causing waves (at the same frequency as the standing wave) that are not trapped in the instrument but can go out into the room.
What is it that requires the waves to have an antinode at an open end? Look again at the animation of what is happening to the air particles in the standing wave. The air at the nodes is not moving back and forth, but it is piling up and spreading out again. So the air pressure is changing a lot at the nodes. But at the antinodes, the air is moving a lot, but it is moving back and forth, not piling up and spreading out. In fact, you can imagine that same wave to be an air pressure wave instead of an air displacement wave. It really is both at the same time, but the pressure wave nodes are at the same place as the displacement antinodes, and the pressure antinodes are at the same place as the displacement nodes.
At an open end of the tube, there is nothing to stop the air rushing in and out, and so it does. What the air cannot do at the open end is build up any pressure; there is nothing for the air to build up against, and any drop in pressure will just bring air rushing in from outside the tube. So the air pressure at an open end must remain the same as the air pressure of the room. In other words, that end must have a pressure node (where the air pressure doesn't change) and (therefore) a displacement antinode.
Since being exposed to the air pressure outside the instrument is what is important, the "open end" of a wind instrument, as far as the sound waves are concerned, is the first place that they can escape - the first open hole. This is how
woodwinds change the length of the wave, and the pitch of the note. For more on this, please see
Wind Instruments – Some Basics.