When a key is pressed, a hole is opened, allowing air to escape from the instrument. This shortens the vibrating air column, which increases the pitch of the sound produced. Conversely, when a key is released, the hole is closed, lengthening the vibrating air column and lowering the pitch of the sound.
In addition to the keys, the clarinet also has a register key, which is typically located near the bottom of the instrument. When the register key is pressed, it opens a small hole near the mouthpiece, which changes the way the air vibrates inside the instrument. This produces a higher-pitched sound, known as the "chalumeau" register.
By combining the different keys and the register key, a clarinetist can produce a wide range of pitches, from the low notes of the chalumeau register to the high notes of the altissimo register.