Reinforcement Learning of Perceptual Coupling for Motor Primitives