Wednesday, June 15, 2016

Building a cheap software sound mixer with Linux

You will need at least two USB mics. Use the alsamixer command. Press F6 to select the sound card and F4 to adjust capture volumes. E.g. condenser microphones should be operated at lower volume than dynamic ones, because they are more sensitive to noise. To start and stop recording from both sources at practically the same time by using the following shell script:

#!/bin/sh
arecord -q -D hw:2,0 -t wav -f s16_le -c1 -r44100 track1.wav &
arecord -q -D hw:3,0 -t wav -f s16_le -c1 -r44100 track2.wav &
read -n1 -r -p "Press any key to stop recording..."
kill $(jobs -p)
replace hw:3,0 and hw:2,0 with your actual audio sources or add more. You can list all audio sources with:
arecord -l

Device names may change order depending on the USB connection order, so for example if you are recording vocals and guitar, you will have to check which track will contain which by playing each track separately. This is something you will want to do anyway to check how the recording from each mic went.

To mix, use Audacity: for each track, select a silence part and use Effect/Noise Reduction/Get Noise Profile. Then type J K to select the whole track and again Effect/Noise Reduction but this time hit OK to reduce noise for that track only based on the profile. You have to do this for each track separately. Then use the gain knob to reduce or increase volume of each track. Select all tracks by clicking on each track panel while you keep shift pressed then go to Tracks/Mix and Render. In the same menu, you can also mix and render to another track, if you do not want to loose the original ones.

No comments: