It is shown how to reverse engineer the parameters that, starting from a multitrack recording, can produce a given mix. Linear effects and dynamic processors, which comprise all the effects commonly used in the mixing and mastering stages, are considered. Two different techniques based on least-squares optimization are described. Starting from a multitrack recording and a target mix, which is obtained by applying effects to each of its channels, impulse responses and gain envelopes are calculated, which can be used to estimate gains, delays, filters, panning settings, and combinations of these processors; or to estimate time-varying gain envelopes produced by dynamic effects, such as compressors and expanders. Theoretical and experimental results show that, given some assumptions about the nature of the processing originally applied, the proposed techniques are able to precisely and efficiently retrieve the mixing parameters.