An aldol switch discovered in stilbene synthases mediates cyclization specificity of type III polyketide synthases.