  In this work, doubly extended linearized Reed--Solomon codes and triply
extended Reed--Solomon codes are generalized. We obtain a general result in
which we characterize when a multiply extended code for a general metric
attains the Singleton bound. We then use this result to obtain several families
of doubly extended and triply extended maximum sum-rank distance (MSRD) codes
that include doubly extended linearized Reed--Solomon codes and triply extended
Reed--Solomon codes as particular cases. To conclude, we discuss when these
codes are one-weight codes.
