Dynamic modulation of external conditions can transform chemistry into logic gates