A measurement of the double-differential π± production cross-section in proton-carbon, proton-copper and proton-tin collisions in the range of pion momentum 100 MeV/c p<800 MeV/c and angle 0.35 rad θ<2.15 rad is presented. The data were taken with the HARP detector in the T9 beam line of the CERN PS. The pions were produced by proton beams in a momentum range from 3 GeV/c to 12 GeV/c hitting a target with a thickness of 5% of a nuclear interaction length. The tracking and identification of the produced particles was done using a small-radius cylindrical time projection chamber (TPC) placed in a solenoidal magnet. An elaborate system of detectors in the beam line ensured the identification of the incident particles. Results are shown for the double-differential cross-sections d2σ/dpdθ at four incident proton beam momenta (3 GeV/c, 5 GeV/c, 8 GeV/c and 12 GeV/c).