Controlled coupling of light and matter