Control generation for embedded systems based on composition of modal processes