The generation of a viscous–inviscid instability through scattering of an acoustic wave by localised and distributed roughness on the upper surface of a NACA 0012 aerofoil is studied with a time-harmonic compressible adjoint linearised Navier–Stokes approach. This extends previous work by the authors dedicated to flat plate geometries. The key advancement lies in the modelling of the inviscid acoustic field external to the aerofoil boundary layer, requiring a numerical solution of the convected Helmholtz equation in a non-uniform inviscid field to determine the unsteady pressure field on the curved aerofoil surface. This externally imposed acoustic pressure field subsequently drives the acoustic boundary layer, which fundamentally determines the amplitudes of acoustic-roughness receptivity. A study of receptivity in the presence of Gaussian-shaped roughness and sinusoidally distributed roughness at Mach number $M_\infty =0.4$ and Strouhal numbers $\mathcal {S} \approx \{46,69,115\}$ shows the effects of various parameters, most notably angle of attack, angle of incidence of the externally imposed plane acoustic wave and geometry of surface roughness; the latter is varied from viewpoint of its placement on the aerofoil surface and its wavelength. The parametric study suggests that non-parallel effects are quite substantial and that considerable differences arise when using parallel flow theory to estimate the optimal width of Gaussian-shaped roughness elements to provoke the greatest response. Furthermore, receptivity amplitudes for distributed roughness are observed to be generally higher for lower angles of attack, i.e. for less adverse pressure gradients. It is also shown that the boundary layer is more receptive to upstream-travelling acoustic waves.