We study the modulation of x-ray diffraction in ideal crystals by a copropagating wave of optical vibrations generated by a fs-laser pulse. Our results suggest that in the synchronous interaction regime the output diffracted x-ray field has the form of ultrafast transients with a time structure even shorter than the period of the excited vibrational mode. The behavior is explained in terms of high-order Raman scattering of x rays by optical phonons.