Rotary,
In fact in the cruise (at least on the aircraft I fly), the air comes straight out of the engines compressor section, through an ozone filter, then through heat exchanger(s) with a variable flow of cold ram air across it to cool the air, then onwards towards a central manifold; aiming for the lowest required temperature on the aircraft. Then the air to the different zones are warmed up to the required temp using some of the hot air (trim air) which is tapped off and hasn't gone through the heat exchangers to cool.
The air cycle machine (ACM) comes into play when nearer the ground / on the ground (the 'being compressed/heated then cooled' device I assume you are talking about), a device which cools the air (with the help of another heat exchanger and a fan to draw air across said heat exchanger). I am sure ACM operation will be covered on this forum somewhere. Somewhat tricky to get your head around to begin with.
Regards.