Ecasound

Here are some notes on how I use ecasound, mostly intended for reminding myself.

#!/bin/bash

# usage: rec [file]
# file will be played while recording.
# file can be any sound format known by ecasound.
# .ogg is fine

if [[ -z $1 ]] ; then
    BPM=72
else
    BPM=$1
fi

COMP1=$2
COMP2=$3

if [[ -z $COMP1 ]] ; then
    ecasound -b:256 -f:16,1,44100 \
 	-a:1 -i null -o alsa -el:sine_fcac,440,1 -eemb:$BPM,7 -efl:2000 -ea:10,3 \
	-a:2 -i alsahw,0,0 -o new-track.wav
elif [[ -z $COMP2 ]]; then
    ecasound -B:none -b:256 -f:16,2,44100 \
	-a:1 -i $COMP1 \
	-o alsa \
	-a:2 -f:16,1,44100 -i alsahw,0,0 \
	-o new-track.wav \
	-a:3 -i:null -o:alsa -el:sine_fcac,440,1 -eemb:$BPM,7 -efl:2000 -ea:10,3
else
    ecasound -B:none -b:256 -f:16,1,44100 \
	-a:1 -i $COMP1 \
	-o alsa \
	-a:2 -i $COMP2 \
	-o alsa \
	-a:3 -f:16,2,44100 -i alsahw,0,0 \
	-o new-track.wav
	-i:null -o:alsa -el:sine_fcac,440,1 -eemb:$BPM,7 -efl:2000 -ea:10,3
fi

comments powered by Disqus


Back to the index

Blog roll

R-bloggers, Debian Weekly
Valid XHTML 1.0 Strict [Valid RSS] Valid CSS! Emacs Muse Last modified: 2010-02-14