From scattering amplitudes to gravitational waves