Tunable transmission and harmonic generation in nonlinear metamaterials