Selective gating to vibrational modes through resonant X-ray scattering