Transient Dynamics of Continuous Systems with Impact and Friction, with Applications to Musical Instruments