Generating grating in cavity magnomechanics