Instrument length directly affects pitch because it determines the wavelength of the standing wave produced. Longer instruments = longer wavelengths = lower frequency = lower pitch. Shorter instruments = shorter wavelengths = higher frequency = higher pitch.
Musicians exploit this physics daily: guitarists fret higher to shorten vibrating length; wind players use valves, keys, or slides to effectively lengthen or shorten the air column. This principle unlocks the full pitch spectrum in music.