What causes a car engine to idle rough and miss?

I’m assuming a new cap and rotor were part of the distributor replacement.

Has a compression check been performed? Perhaps one of the valves is burned or not sealing properly.