Hong–Ou–Mandel control through spectral shaping