Engineered nonlinear photonic quasicrystals for multi-frequency terahertz manipulation.