#!/bin/bash

for filename in worship.wavex altar.wavex; do
	name=${filename%.wavex}
	ffmpeg -i "$filename" -filter_complex 'channelsplit=channel_layout=4.1[L][R][B][X][Y]' \
		-map '[L]' "${name}-m48.wav" \
		-map '[R]' "${name}-drums.wav" \
		-map '[X]' "${name}-synth-L.wav" \
		-map '[Y]' "${name}-synth-R.wav" \
		-map '[B]' "${name}-bass.wav"
done
