A spectral beam combining system based on a MLD diffraction grating is established. Three typical double-pulse lasers with arbitrary sub-pulse shapes are obtained. The inter-pulse separation of each double-pulse laser can be set at random. Several-pulse laser with more sub-pulses can be realized in this system.