The frequency of the vibration of the object changes as the pitch changes, even if the amplitude (loudness) doesn’t change.
Different pitch sounds are produced from differences in the way the sound source vibrates (slower/faster).