0

Is there an option in SoX effects processing to mix the wet and dry signals instead of only outputting the wet?

For example, say my effects chain is overdrive into pitch shift:

sox in.wav out.wav overdrive 0.5 gain -0.5 pitch 700

Except I don't want the final file to be just the shifted signal. I want a mix of the distorted, shifted signal and the distorted, unshifted signal.

Does SoX support this somehow?

1 Answer 1

0

If I understand you, there is an option especially to mix two signals: -m.

sox in.wav out.wav mix.wav -m
play mix.wav

You can probably do the effect and mix in one command, but I'm just a beginner with sox.


You can pipe the output of sox into another sox using the |command input filename syntax, and adding -p to make sox output to a pipe in "sox format". It has the advantage of not using temporary intermediate files.

sox -m '|sox -v 0.5 in.wav -p overdrive 0.5 gain -0.5' \
       '|sox -v 0.5 in.wav -p overdrive 0.5 gain -0.5 pitch 700' \
   mix.wav
4
  • I figured there was probably an option with -m, but I was hoping to do it without splitting the signal into multiple chains. What you're describing, applied to the original example would be something like: sox -m -v 0.5 in.wav overdrive 0.5 gain -0.5 in.wav overdrive 0.5 gain -0.5 pitch 700 out.wav But that's pretty ugly for something that I was hoping would be a single extra argument. Oct 12, 2017 at 14:42
  • Revisiting this question because 5 years later, I still don't have a solution. But the possible solution in my previous comment does not work because, as the manual says "When combining input files, SoX applies any specified effects (including, for example, the vol volume adjustment effect) after the audio has been combined". I'd really like to do this without exporting to an intermediate file and running multiple SoX commands, but there may be no alternative. May 1, 2023 at 3:24
  • I added a possibility without intermediate files.
    – meuh
    May 2, 2023 at 17:58
  • I actually came here to add more or less that exact comment. Yep. That is the solution May 4, 2023 at 2:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .