Partial-wave decomposition of pion and photoproduction amplitudes