To describe the modulational instability of space-charge waves in an n-type compensated semiconductor plasma, a nonlinear Schrödinger equation has been derived by using quantum hydrodynamical model and standard multiple scale perturbation technique. It has been shown that compensation factor (i.e. relative proportion of donor, acceptor and intrinsic carrier concentrations) and quantum diffraction parameter play important role in generating bright and dark envelope solitons within the semiconductor. Instability growth rate is also found to depend sensitively on the compensation factor and quantum diffraction parameter. From the linear dispersion relation it has been found that inclusion of quantum parameter gives rise to two new wave modes of purely quantum origin. Further the effect of compensation factor and quantum diffraction parameter on the linear dispersion characteristics has been analyzed. It has also been found that due to parabolicity of conduction band the group velocity of space-charge wave becomes dependent on compensation factor and quantum diffraction parameter.