Pattern generator.