Inelastic scattering of medium-energy pions from carbon