A magnetically pulsed neutron time-of-flight spectrometer for inelastic scattering