The generation of nonclassical states of light via photon blockade with time-modulated input is analyzed. We show that improved single-photon statistics can be obtained by adequately choosing the parameters of the driving laser pulses. An alternative method, where the system is driven via a continuous-wave laser and the frequency of the dipole is controlled (e.g., electrically) at very fast time scales is presented.