Streamlined wavelength generation function.