We analyze a general mechanism for producing a nearly scale-invariant spectrum of cosmological curvature perturbations during a contracting phase preceding a big bang, that can be entirely described using 4d effective field theory. The mechanism, based on first producing entropic perturbations and then converting them to curvature perturbations, can be naturally incorporated in cyclic and ekpyrotic models in which the big bang is modelled as a brane collision, as well as other types of cosmological models with a pre-big bang phase. We show that the correct perturbation amplitude can be obtained and that the scalar spectral tilt n tends to range from slightly blue to red, with 0.97 < n < 1.02 for the simplest models, a range compatible with current observations but shifted by a few per cent towards the blue compared to the prediction of the simplest, large-field inflationary models.