Shaping harmonic frequency combs in quantum cascade lasers