Atomic scale structure of ionic and semiconducting solid solutions