ref: b5418d1f8a26a9687119b7d8f56ff44f13c586aa
parent: 24674c847633e9d283cac69fa1710ac7cdeef968
author: robs <robs>
date: Fri Jul 25 13:32:26 EDT 2008
Moved contents of soxexam man page into soxeffect man page
--- a/ChangeLog
+++ b/ChangeLog
@@ -118,6 +118,7 @@
use the libSoX effects chain. (robs)
o Added example2: simple example of how to develop applications that
use libSoX to read an audio file. (robs)
+ o Moved contents of soxexam man page into soxeffect man page. (robs)
Other bug fixes:
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,8 +9,8 @@
# man pages are not considered to be sources, so need to add "dist_"
# prefix to ensure they are added to the distribution.
-dist_man_MANS = sox.1 soxi.1 soxeffect.7 soxformat.7 soxexam.7 libsox.3
-EXTRA_DIST = sox.txt soxi.txt soxeffect.txt soxformat.txt soxexam.txt libsox.txt CMakeLists.txt sox.pc.in
+dist_man_MANS = sox.1 soxi.1 soxeffect.7 soxformat.7 libsox.3
+EXTRA_DIST = sox.txt soxi.txt soxeffect.txt soxformat.txt libsox.txt CMakeLists.txt sox.pc.in
if HAVE_PKGCONFIG
pkgconfigdir = @PKGCONFIGDIR@
@@ -24,13 +24,13 @@
.1.txt .3.txt .7.txt:
tbl $(srcdir)/$< | nroff -man | col -b > $@
-txt: sox.txt soxi.txt soxeffect.txt soxformat.txt soxexam.txt libsox.txt
+txt: sox.txt soxi.txt soxeffect.txt soxformat.txt libsox.txt
# Rule for making PDF man pages
.1.pdf .3.pdf .7.pdf:
tbl $(srcdir)/$< | groff -man -Tps | ps2pdf - $@
-pdf: sox.pdf soxi.pdf soxeffect.pdf soxformat.pdf soxexam.pdf libsox.pdf
+pdf: sox.pdf soxi.pdf soxeffect.pdf soxformat.pdf libsox.pdf
install-data-hook:
cd $(DESTDIR)$(mandir)/man1 && $(RM) play.1 && $(LN_S) sox.1 play.1
--- a/README
+++ b/README
@@ -25,7 +25,6 @@
o soxi(1)
o soxformat(7)
o soxeffect(7)
- o soxexam(7)
o libsox(3)
or in plain text or PDF files for those systems without man.
--- a/debian/manpages
+++ b/debian/manpages
@@ -1,2 +1,1 @@
build-tree/sox*/sox.1
-build-tree/sox*/soxexam.7
--- a/libsox.3
+++ b/libsox.3
@@ -299,7 +299,8 @@
This manual page is both incomplete and out of date.
.SH SEE ALSO
.BR sox (1),
-.BR soxexam (7)
+.BR soxformat (7),
+.BR soxeffect (7)
.SH LICENSE
Copyright 1991 Lance Norskog and Sundry Contributors.
Copyright 1998\-2007 by Chris Bagwell and SoX Contributors.
--- a/sox.1
+++ b/sox.1
@@ -118,9 +118,12 @@
.EE
records a new track in a multi-track recording.
.SP
-Further examples are included throughout this manual;
-more-detailed examples can be found in
-.BR soxexam (7).
+Detailed explanations of how to use each SoX parameter, file format, and
+effect can be found below in this manual, and in
+.BR soxformat (7),
+&
+.BR soxeffect (7)
+respectively.
.SS File Formats
There are two types of audio file format that SoX can work with. The
first is `self-describing'; these formats include a header that
@@ -138,12 +141,11 @@
(8\ kHz); audio Compact Discs use 44100\ Hz (44\*d1\ kHz).
.TP
sample size
-The number of bits used to store each sample. Most popular are 8-bit
-(one byte) and 16-bit (two bytes). (Since many now-common sound
-formats were invented when most computers used a 16-bit word, two
-bytes is often called a `word', but since current personal computers
-overwhelmingly have 32-bit or 64-bit words, this usage is confusing,
-and is not used in the SoX documentation.)
+The number of bits used to store each sample. The most popular is 16-bit
+(two bytes); 8-bit (one byte) was popular in the early days of computer
+audio, and is still used in telephony; 24-bit (three bytes) is used,
+primarily as an intermediate format, in the professional audio arena. Other
+sizes are also used.
.TP
data encoding
The way in which each audio sample is represented (or `encoded'). Some
@@ -879,7 +881,6 @@
(sox-users@lists.sourceforge.net).
.SH SEE ALSO
.BR soxi (1),
-.BR soxexam (7),
.BR soxformat (7),
.BR soxeffect (7),
.BR gnuplot (1),
@@ -888,6 +889,8 @@
.BR libsox (3)
.SP
The SoX web site at http://sox.sourceforge.net
+.br
+SoX scripting examples at http://sox.sourceforge.net/Docs/Scripts
.SH LICENSE
Copyright 1991 Lance Norskog and Sundry Contributors.
Copyright 1998\-2008 by Chris Bagwell and SoX Contributors.
--- a/soxeffect.7
+++ b/soxeffect.7
@@ -36,7 +36,15 @@
In addition to converting and playing audio files, SoX can be used to
invoke a number of audio `effects'. Multiple effects may be applied
by specifying them one after another at the end of the SoX command line.
+Note that applying multiple effects in real-time (i.e. when playing audio)
+is likely to need a high performance computer; stopping other applications
+may alleviate performance issues should they occur.
.SP
+Some of the SoX effects are primarily intended to be applied to a single
+instrument or `voice'. To facilitate this, the \fBremix\fR effect and
+the global SoX option \fB-M\fR can be used to isolate then recombine
+tracks from a multi-track recording.
+.SP
In the descriptions that follow,
brackets [ ] are used to denote parameters that are optional, braces
{ } to denote those that are both optional and repeatable,
@@ -189,6 +197,33 @@
speed in Hz using depth in milliseconds.
The modulation is either sinusoidal (\fB\-s\fR) or triangular
(\fB\-t\fR). Gain-out is the volume of the output.
+.SP
+The chorus effect has its name because it will often be used to make a single
+vocal sound like a chorus. But it can be applied to other instrument samples
+too.
+.SP
+It works like the echo effect with a short delay, but the delay isn't constant.
+The delay is varied using a sinusoidal or triangular modulation. The modulation
+depth defines the range the modulated delay is played before or after the
+delay. Hence the delayed sound will sound slower or faster, that is the delayed
+sound tuned around the original one, like in a chorus where some vocals are
+a bit out of tune.
+.SP
+The typical delay is around 40ms to 60ms, the speed of the modulation is best
+near 0\*d25Hz and the modulation depth around 2ms.
+.SP
+A single delay will make the sample more overloaded:
+.EX
+ play file.xxx chorus 0.7 0.9 55 0.4 0.25 2 \-t
+.EE
+Two delays of the original samples sound like this:
+.EX
+ play file.xxx chorus 0.6 0.9 50 0.4 0.25 2 \-t 60 0.32 0.4 1.3 \-s
+.EE
+A big chorus of the sample is (three additional samples):
+.EX
+ play file.xxx chorus 0.5 0.9 50 0.4 0.25 2 \-t 60 0.32 0.4 2.3 \-t 40 0.3 0.3 1.3 \-s
+.EE
.TP
\fBcompand \fIattack1\fB,\fIdecay1\fR{\fB,\fIattack2\fB,\fIdecay2\fR}
[\fIsoft-knee-dB\fB:\fR]\fIin-dB1\fR[\fB,\fIout-dB1\fR]{\fB,\fIin-dB2\fB,\fIout-dB2\fR}
@@ -204,7 +239,11 @@
parameters (in seconds) determine the time over which the
instantaneous level of the input signal is averaged to determine its
volume; attacks refer to increases in volume and decays refer to
-decreases. Where more than one pair of attack/decay parameters are
+decreases.
+For most situations, the attack time (response to the music getting
+louder) should be shorter than the decay time because the human ear is more
+sensitive to sudden loud music than sudden soft music.
+Where more than one pair of attack/decay parameters are
specified, each input channel is companded separately and the number of
pairs must agree with the number of input channels.
Typical values are
@@ -256,6 +295,26 @@
.SP
This effect supports the \fB\-\-plot\fR global option (for the transfer function).
.SP
+The following example might be used to make a piece of music with both
+quiet and loud passages suitable for listening to in a noisy environment
+such as a moving vehicle:
+.EX
+ sox asz.flac asz-car.flac compand 0.3,1 6:-70,-60,-20 -5 -90 0.2
+.EE
+The transfer function (`6:\-70,...') says that very soft sounds (below
+\-70dB) will remain unchanged. This will stop the compander from
+boosting the volume on `silent' passages such as between movements.
+However, sounds in the range \-60dB to 0dB (maximum
+volume) will be boosted so that the 60dB dynamic range of the
+original music will be compressed 3-to-1 into a 20dB range, which is
+wide enough to enjoy the music but narrow enough to get around the
+road noise. The `6:' selects 6dB soft-knee companding.
+The \-5 (dB) output gain is needed to avoid clipping (the number is
+inexact, and was derived by experimentation).
+The \-90 (dB) for the initial volume will work fine for a clip that starts
+with near silence, and the delay of 0\*d2 (seconds) has the effect of causing
+the compander to react a bit more quickly to sudden volume changes.
+.SP
See also
.B mcompand
for a multiple-band companding effect.
@@ -348,11 +407,40 @@
.TP
\fBecho \fIgain-in gain-out\fR <\fIdelay decay\fR>
Add echoing to the audio.
-Each
+Echoes are reflected sound and can occur naturally amongst mountains
+(and sometimes large buildings) when talking or shouting; digital echo
+effects emulate this behaviour and are often used to help fill
+out the sound of a single instrument or vocal. The time difference
+between the original signal and the reflection is the `delay' (time),
+and the loudness of the relected signal is the `decay'. Multiple echoes
+can have different delays and decays.
+.SP
+Each given
.I "delay decay"
pair gives the delay in milliseconds
and the decay (relative to gain-in) of that echo.
Gain-out is the volume of the output.
+.SP
+For example:
+.SP
+This will make it sound as if there are twice as many instruments as are
+actually playing:
+.EX
+ play file.xxx echo 0.8 0.88 60 0.4
+.EE
+If the delay is very short, then it sound like a (metallic) robot playing
+music:
+.EX
+ play file.xxx echo 0.8 0.88 6 0.4
+.EE
+A longer delay will sound like an open air concert in the mountains:
+.EX
+ play file.xxx echo 0.8 0.9 1000 0.3
+.EE
+One mountain more, and:
+.EX
+ play file.xxx echo 0.8 0.9 1000 0.3 1800 0.25
+.EE
.TP
\fBechos \fIgain-in gain-out\fR <\fIdelay decay\fR>
Add a sequence of echoes to the audio.
@@ -361,6 +449,25 @@
pair gives the delay in milliseconds
and the decay (relative to gain-in) of that echo.
Gain-out is the volume of the output.
+.SP
+Like the echo effect, echos stand for `ECHO in Sequel', that is the first echos
+takes the input, the second the input and the first echos, the third the input
+and the first and the second echos, ... and so on.
+Care should be taken using many echos; a single echos
+has the same effect as a single echo.
+.SP
+The sample will be bounced twice in symmetric echos:
+.EX
+ play file.xxx echos 0.8 0.7 700 0.25 700 0.3
+.EE
+The sample will be bounced twice in asymmetric echos:
+.EX
+ play file.xxx echos 0.8 0.7 700 0.25 900 0.3
+.EE
+The sample will sound as if played in a garage:
+.EX
+ play file.xxx echos 0.8 0.7 40 0.25 63 0.3
+.EE
.TP
\fBequalizer \fIfrequency\fR[\fBk\fR]\fI width\fR[\fBq\fR\^|\^\fBo\fR\^|\^\fBh\fR\^|\^\fBk\fR] \fIgain\fR
Apply a two-pole peaking equalisation (EQ) filter.
@@ -443,6 +550,8 @@
.TP
\fBflanger\fR [\fIdelay depth regen width speed shape phase interp\fR]
Apply a flanging effect to the audio.
+See [3] for a detailed description of flanging.
+.SP
All parameters are optional (right to left).
.TS
center box;
@@ -472,12 +581,10 @@
T}
.TE
.DT
-.SP
-See [3] for a detailed description of flanging.
.TP
\fBgain \fIdB-gain\fR
Apply an amplification or an attenuation to the audio signal.
-This is just an alias for the
+This is an alias for the
.B vol
effect\*mhandy for those who prefer to work in dBs by default.
.TP
@@ -539,6 +646,22 @@
frequency for that band is given by \fIxover-freq\fR; these can be
repeated to create multiple bands.
.SP
+For example, the following (one long) command shows how multi-band
+companding is typically used in FM radio:
+.EX
+ play file.xxx gain -3 filter 8000- 32 100 mcompand \\
+ \(dq0.005,0.1 -47,-40,-34,-34,-17,-33\(dq 100 \\
+ \(dq0.003,0.05 -47,-40,-34,-34,-17,-33\(dq 400 \\
+ \(dq0.000625,0.0125 -47,-40,-34,-34,-15,-33\(dq 1600 \\
+ \(dq0.0001,0.025 -47,-40,-34,-34,-31,-31,-0,-30\(dq 6400 \\
+ \(dq0,0.025 -38,-31,-28,-28,-0,-25\(dq \\
+ gain 15 highpass 22 highpass 22 filter -17500 256 \\
+ gain 9 lowpass -1 17801
+.EE
+The audio file is played with a simulated FM radio sound (or broadcast
+signal condition if the lowpass filter at the end is skipped).
+Note that the pipeline is set up with US-style 75us preemphasis.
+.SP
See also
.B compand
for a single-band companding effect.
@@ -732,12 +855,35 @@
.TP
\fBphaser \fIgain-in gain-out delay decay speed\fR [\fB\-s\fR\^|\^\fB\-t\fR]
Add a phasing effect to the audio.
+See [3] for a detailed description of phasing.
+.SP
delay/decay/speed gives the delay in milliseconds
and the decay (relative to gain-in) with a modulation
speed in Hz.
-The modulation is either sinusoidal (\fB\-s\fR) or triangular
-(\fB\-t\fR). The decay should be less than 0\*d5 to avoid
+The modulation is either sinusoidal (\fB\-s\fR) \*mpreferable for multiple
+instruments, or triangular
+(\fB\-t\fR) \*mgives single instruments a sharper phasing effect.
+The decay should be less than 0\*d5 to avoid
feedback. Gain-out is the volume of the output.
+.SP
+A good range is about 0\*d5 to 0\*d1 for the decay.
+.SP
+Examples:
+.EX
+ play file.xxx phaser 0.8 0.74 3 0.4 0.5 \-t
+.EE
+Less severe:
+.EX
+ play file.xxx phaser 0.9 0.85 4 0.23 1.3 \-s
+.EE
+A popular sound:
+.EX
+ play file.xxx phaser 0.89 0.85 1 0.24 2 \-t
+.EE
+This sounds as if ten springs are in your ears:
+.EX
+ play file.xxx phaser 0.6 0.66 3 0.6 2 \-t
+.EE
.TP
\fBrate\fR [\fB\-q\fR\^|\^\fB\-l\fR\^|\^\fB\-m\fR\^|\^\fB\-h\fR\^|\^\fB\-v\fR] [\fIRATE\fR[\fBk\fR]]
Change the audio sampling rate (i.e. resample the audio)
@@ -954,10 +1100,14 @@
.br
[\fIpre-delay\fR (0ms) [\fIwet-gain\fR (0dB)]]]]]]
.SP
-Add reverberation to the audio using the freeverb algorithm.
+Add reverberation to the audio using the `freeverb' algorithm. A
+reverberation effect is sometimes desirable for concert halls that are too
+small or contain so many people that the hall's natural reverberance is
+diminished. Applying a small amount of stereo reverb to a (dry) mono signal
+will usually make it sound more natural. See [3] for a detailed description
+of reverberation.
.SP
-Note that
-.B reverb
+Note that this effect
increases both the volume and the length of the audio, so to prevent clipping
in these domains, a typical invocation might be:
.EX
@@ -1043,6 +1193,13 @@
.B %
to indicate a percentage of maximum value of the sample value
(\fB0%\fR specifies pure digital silence).
+.SP
+The following example shows how this effect can be used to start a recording
+that does not contain the delay at the start which usually occurs between
+`pressing the record button' and the start of the performance:
+.EX
+ rec \fIparameters filename other-effects\fR silence 1 5 2%
+.EE
.TP
\fBspeed \fIfactor\fR[\fBc\fR]
Adjust the audio speed (pitch and tempo together). \fIfactor\fR
@@ -1462,7 +1619,8 @@
but possibly lower quality, result.
.SP
.I factor
-gives the ratio of new tempo to the old tempo.
+gives the ratio of new tempo to the old tempo, so e.g. 1.1 speeds up the
+tempo by 10%, and 0.9 slows it down by 10%.
.SP
The optional
.I segment
@@ -1484,7 +1642,11 @@
.SP
See also
.B stretch
-for a similar effect.
+for a similar effect,
+.B speed
+for an effect that changes tempo and key together, and
+.B key
+for an effect that changes key without changing tempo.
.TP
\fBtreble \fIgain\fR [\fIfrequency\fR[\fBk\fR]\fR [\fIwidth\fR[\fBs\fR\^|\^\fBh\fR\^|\^\fBk\fR\^|\^\fBo\fR\^|\^\fBq\fR]]]
Apply a treble tone-control effect.
@@ -1777,9 +1939,10 @@
.BR soxi (1),
.BR soxformat (7),
.BR libsox (3),
-.BR soxexam (7)
.SP
The SoX web page at http://sox.sourceforge.net
+.br
+SoX scripting examples at http://sox.sourceforge.net/Docs/Scripts
.SS References
.TP
[1]
@@ -1794,8 +1957,8 @@
.TP
[3]
Scott Lehman,
-.IR "Flanging" ,
-http://harmony-central.com/Effects/Articles/Flanging
+.IR "Effects Explained" ,
+http://harmony-central.com/Effects/effects-explained.html
.TP
[4]
Wikipedia,
--- a/soxexam.7
+++ /dev/null
@@ -1,397 +1,0 @@
-'\" t
-'\" The line above instructs most `man' programs to invoke tbl
-'\"
-'\" Separate paragraphs; not the same as PP which resets indent level.
-.de SP
-.if t .sp .5
-.if n .sp
-..
-'\"
-'\" Replacement em-dash for nroff (default is too short).
-.ie n .ds m " -
-.el .ds m \(em
-'\"
-'\" Placeholder macro for if longer nroff arrow is needed.
-.ds RA \(->
-'\"
-'\" Decimal point set slightly raised
-.if t .ds d \v'-.15m'.\v'+.15m'
-.if n .ds d .
-'\"
-'\" Enclosure macro for examples
-.de EX
-.SP
-.nf
-.ft CW
-..
-.de EE
-.ft R
-.SP
-.fi
-..
-.TH SoX 7 "July 1, 2008" "soxexam" "Sound eXchange"
-.SH NAME
-SoX \- Sound eXchange, the Swiss Army knife of audio manipulation
-.SH EXAMPLES
-.SS Introduction
-The core problem is that you need some experience in using effects
-in order to say `that any old sound file sounds with effects
-absolutely hip'. There isn't any rule-based system which tell you
-the correct setting of all the parameters for every effect.
-But after some time you will become an expert in using effects.
-.SP
-Here are some examples which can be used with any music sample.
-(For a sample where only a single instrument is playing, extreme
-parameter setting may make well-known `typically' or `classical'
-sounds. Likewise, for drums, vocals or guitars.)
-.SP
-Single effects will be explained and some given parameter settings
-that can be used to understand the theory by listening to the sound file
-with the added effect.
-.SP
-Using multiple effects in parallel or in series can result either
-in a very nice sound or (mostly) in a dramatic overloading in
-variations of sounds such that your ear may follow the sound but
-you will feel unsatisfied. Hence, for the first time using effects
-try to compose them as minimally as possible. We don't regard the
-composition of effects in the examples because too many combinations
-are possible and you really need a very fast machine and a lot of
-memory to play them in real-time.
-.SP
-However, real-time playing of sounds will greatly speed up learning
-and/or tuning the parameter settings for your sounds in order to
-get that `perfect' effect.
-.SP
-Basically, we will use the `play' front-end of SoX since it is easier
-to listen sounds coming out of the speaker or earphone instead
-of looking at cryptic data in sound files.
-.SP
-For easy listening of file.xxx (`xxx' is any sound format):
-.SP
- play file.xxx effect-name effect-parameters
-.SP
-Or more SoX-like (for `dsp' output on a UNIX/Linux computer):
-.SP
- sox file.xxx \-t oss \-2 \-s /dev/dsp effect-name effect-parameters
-.SP
-or (for `au' output):
-.SP
- sox file.xxx \-t sunau \-2 \-s /dev/audio effect-name effect-parameters
-.SP
-And for date freaks:
-.SP
- sox file.xxx file.yyy effect-name effect-parameters
-.SP
-Additional options can be used. However, in this case, for real-time
-playing you'll need a very fast machine.
-.SP
-Notes:
-.SP
-I played all examples in real-time on a Pentium 100 with 32 MB and
-Linux 2.0.30 using a self-recorded sample ( 3:15 min long in `wav'
-format with 44\*d1 kHz sample rate and stereo 16 bit ).
-The sample should not contain any of the effects. However,
-if you take any recording of a sound track from radio or tape or CD,
-and it sounds like a live concert or ten people are playing the same
-rhythm with their drums or funky-grooves, then take any other sample.
-(Typically, less then four different instruments and no synthesizer
-in the sample is suitable. Likewise, the combination vocal, drums, bass
-and guitar.)
-.SS Echo
-.SP
-An echo effect can be naturally found in the mountains, standing somewhere
-on a mountain and shouting a single word will result in one or more repetitions
-of the word (if not, turn a bit around and try again, or climb to the next
-mountain).
-.SP
-However, the time difference between shouting and repeating is the delay
-(time), its loudness is the decay. Multiple echos can have different delays and
-decays.
-.SP
-It is very popular to use echos to play an instrument with itself together,
-like some guitar players (Queen's Brian May) or vocalists do.
-For music samples of more than one instrument, echo can be used to add a
-second sample shortly after the original one.
-.SP
-This will sound as if you are doubling the number of instruments playing
-in the same sample:
-.SP
- play file.xxx echo 0\*d8 0\*d88 60 0\*d4
-.SP
-If the delay is very short, then it sound like a (metallic) robot playing
-music:
-.SP
- play file.xxx echo 0\*d8 0\*d88 6 0\*d4
-.SP
-Longer delay will sound like an open air concert in the mountains:
-.SP
- play file.xxx echo 0\*d8 0\*d9 1000 0\*d3
-.SP
-One mountain more, and:
-.SP
- play file.xxx echo 0\*d8 0\*d9 1000 0\*d3 1800 0\*d25
-.SS Echos
-Like the echo effect, echos stand for `ECHO in Sequel', that is the first echos
-takes the input, the second the input and the first echos, the third the input
-and the first and the second echos, ... and so on.
-Care should be taken using many echos (see introduction); a single echos
-has the same effect as a single echo.
-.SP
-The sample will be bounced twice in symmetric echos:
-.SP
- play file.xxx echos 0\*d8 0\*d7 700 0\*d25 700 0\*d3
-.SP
-The sample will be bounced twice in asymmetric echos:
-.SP
- play file.xxx echos 0\*d8 0\*d7 700 0\*d25 900 0\*d3
-.SP
-The sample will sound as if played in a garage:
-.SP
- play file.xxx echos 0\*d8 0\*d7 40 0\*d25 63 0\*d3
-.SS Chorus
-The chorus effect has its name because it will often be used to make a single
-vocal sound like a chorus. But it can be applied to other instrument samples
-too.
-.SP
-It works like the echo effect with a short delay, but the delay isn't constant.
-The delay is varied using a sinusoidal or triangular modulation. The modulation
-depth defines the range the modulated delay is played before or after the
-delay. Hence the delayed sound will sound slower or faster, that is the delayed
-sound tuned around the original one, like in a chorus where some vocals are
-a bit out of tune.
-.SP
-The typical delay is around 40ms to 60ms, the speed of the modulation is best
-near 0\*d25Hz and the modulation depth around 2ms.
-.SP
-A single delay will make the sample more overloaded:
-.SP
- play file.xxx chorus 0\*d7 0\*d9 55 0\*d4 0\*d25 2 \-t
-.SP
-Two delays of the original samples sound like this:
-.SP
- play file.xxx chorus 0\*d6 0\*d9 50 0\*d4 0\*d25 2 \-t 60 0\*d32 0\*d4 1\*d3 \-s
-.SP
-A big chorus of the sample is (three additional samples):
-.SP
- play file.xxx chorus 0\*d5 0\*d9 50 0\*d4 0\*d25 2 \-t 60 0\*d32 0\*d4 2\*d3 \-t 40 0\*d3 0\*d3 1\*d3 \-s
-.SS Flanger
-The flanger effect is like the chorus effect, but the delay varies between
-0ms and maximal 5ms. It sound like wind blowing, sometimes faster or slower
-including changes of the speed.
-.SP
-The flanger effect is widely used in funk and soul music, where the guitar
-sound varies frequently slow or a bit faster.
-.SP
-Now, let's groove the sample:
-.SP
- play file.xxx flanger
-.SP
-listen carefully between the difference of sinusoidal and triangular modulation:
-.SP
- play file.xxx flanger triangle
-.SS Reverb
-A reverberation effect is sometimes needed in concert halls that are too
-small or contain so many people that the hall's natural reverberance is
-diminished.
-.SP
-Using the effect is easy:
-.EX
- play file.xxx reverb
-.EE
-gives the default reverberance (50%); or specify the desired reverberance
-as a percentage:
-.EX
- play file.xxx reverb 80
-.EE
-For fine tuning, see
-.BR sox (1).
-.SP
-If you run out of machine power or memory, then stop as many applications
-as possible.
-.SS Phaser
-The phaser effect is like the flanger effect, but it uses a reverb instead of
-an echo and does phase shifting. You'll hear the difference in the examples
-comparing both effects.
-The delay modulation can be sinusoidal or triangular, preferable is the
-later for multiple instruments. For single instrument sounds,
-the sinusoidal phaser effect will give a sharper phasing effect.
-The decay shouldn't be to close to 1 which will cause dramatic feedback.
-A good range is about 0\*d5 to 0\*d1 for the decay.
-.SP
-We will take a parameter setting as before (gain-out is
-lower since feedback can raise the output dramatically):
-.SP
- play file.xxx phaser 0\*d8 0\*d74 3 0\*d4 0\*d5 \-t
-.SP
-The drunken loudspeaker system (now less alcohol):
-.SP
- play file.xxx phaser 0\*d9 0\*d85 4 0\*d23 1\*d3 \-s
-.SP
-A popular sound of the sample is as follows:
-.SP
- play file.xxx phaser 0\*d89 0\*d85 1 0\*d24 2 \-t
-.SP
-The sample sounds if ten springs are in your ears:
-.SP
- play file.xxx phaser 0\*d6 0\*d66 3 0\*d6 2 \-t
-.SS Compander
-The compander effect allows the dynamic range of a signal to be
-compressed or expanded. It works by calculating the input signal level
-averaged over time according to the given attack and decay parameters,
-and setting the output signal level according to the given
-transfer-function parameters.
-.SP
-For most situations, the attack time (response to the music getting
-louder) should be shorter than the decay time because our ears are more
-sensitive to suddenly loud music than to suddenly soft music.
-.SP
-For example, suppose you are listening to Strauss's `Also Sprach
-Zarathustra' in a noisy environment such as a moving vehicle.
-If you turn up the volume enough to hear the soft passages over the
-road noise, the loud sections will be too loud.
-So you could try this:
-.EX
- sox asz.flac asz-car.flac compand 0.3,1 6:-70,-60,-20 -5 -90 0.2
-.EE
-The transfer function (`6:\-70,...') says that very soft sounds (below
-\-70dB) will remain unchanged. This will stop the compander from
-boosting the volume on `silent' passages such as between movements.
-However, sounds in the range \-60dB to 0dB (maximum
-volume) will be boosted so that the 60dB dynamic range of the
-original music will be compressed 3-to-1 into a 20dB range, which is
-wide enough to enjoy the music but narrow enough to get around the
-road noise. The `6:' selects 6dB soft-knee companding.
-The \-5 (dB) output gain is needed to avoid clipping (the number is
-inexact, and was derived by experimentation).
-The \-90 (dB) for the initial volume will work fine for a clip that starts
-with near silence, and the delay of 0\*d2 (seconds) has the effect of causing
-the compander to react a bit more quickly to sudden volume changes.
-.SP
-In order to visualise the transfer function, SoX can be invoked with the
-.B \-\-plot
-option, e.g.
-.EX
- sox -n -n --plot gnuplot compand 0,0 6:-70,-60,-20 -5 > my.plt
- gnuplot my.plt
-.EE
-The following (one long) command shows how multi-band companding is
-typically used in FM radio:
-.EX
- play file.xxx vol -3dB filter 8000- 32 100 mcompand \\
- \(dq0.005,0.1 -47,-40,-34,-34,-17,-33\(dq 100 \\
- \(dq0.003,0.05 -47,-40,-34,-34,-17,-33\(dq 400 \\
- \(dq0.000625,0.0125 -47,-40,-34,-34,-15,-33\(dq 1600 \\
- \(dq0.0001,0.025 -47,-40,-34,-34,-31,-31,-0,-30\(dq 6400 \\
- \(dq0,0.025 -38,-31,-28,-28,-0,-25\(dq \\
- vol 15dB highpass 22 highpass 22 filter -17500 256 \\
- vol 9dB lowpass -1 17801
-.EE
-The audio file is played with a simulated FM radio sound (or broadcast
-signal condition if the lowpass filter at the end is skipped).
-Note that the pipeline is set up with US-style 75us preemphasis.
-.SS Changing the Rate of Playback
-You can use stretch to change the rate of playback of an audio sample
-while preserving the pitch. For example to play at half the speed:
-.SP
- play file.wav stretch 2
-.SP
-To play a file at twice the speed:
-.SP
- play file.wav stretch 0\*d5
-.SP
-Other related options are `speed' to change the speed of play
-(and changing the pitch accordingly), and pitch, to alter the
-pitch of a sample. For example to speed a sample so it plays in
-half the time (for those Mickey Mouse voices):
-.SP
- play file.wav speed 2
-.SP
-To raise the pitch of a sample 1 while note (100 cents):
-.SP
- play file.wav pitch 100
-.SP
-.SS Reducing noise in a recording
-First find a period of silence in your recording, such as the beginning or
-end of a piece. If the first 1\*d5 seconds of the recording are silent, do
-.SP
- sox file.wav \-n trim 0 1\*d5 noiseprof /tmp/profile
-.SP
-Next, use the noisered effect to actually reduce the noise:
-.SP
- play file.wav noisered /tmp/profile
-.SS Making a recording
-Thanks to Douglas Held for the following suggestion:
-.SP
- rec \fIparameters filename other-effects\fR silence 1 5 2%
-.SP
-This use of the
-.B silence
-effect allows you to start a recording session but only start writing
-to disk once non-silence is detect. For example, use this to
-start your favorite command line for recording and walk
-over to your record player and start the song. No periods
-of silence will be recorded.
-.SS Scripting with SoX
-One of the benefits of a command-line tool is that it is easy to use it
-in scripts to perform more complex tasks.
-In marine radio, a Mayday emergency call is transmitted preceded by a
-30-second alert sound. The alert sound comprises two audio tones at
-1300Hz and 2100Hz alternating at a rate of 4Hz.
-The following shows how SoX can be used in a script to construct an audio file
-containing the alert sound.
-The scripting language shown is `Bourne shell' (sh) but it should be
-simple to translate this to another scripting language if you do not
-have access to sh.
-.EX
-# Make sure we append to a file that's initially empty:
-rm \-f 2tones.raw
-
-for freq in 1300 2200; do
- sox \-c1 \-r8000 \-n \-t raw \- synth 0\*d25 sine $freq vol 0\*d7 >> 2tones.raw
-done
-
-# We need 60 copies of 2tones.raw (0\*d5 sec) to get 30 secs of audio:
-iterations=60
-
-# Make sure we append to a file that's initially empty:
-rm \-f alert.raw
-
-while [ $iterations \-ge 1 ]; do
- cat 2tones.raw >> alert.raw
- iterations=\`expr $iterations \- 1\`
-done
-
-# Add a file header and save some disc space:
-sox \-s2 \-c1 \-r8000 alert.raw alert.ogg
-
-play alert.ogg
-.EE
-If you try out the above script, you may want to hit Ctrl-C fairly soon
-after the alert tone starts playing\*mit's not a pleasant sound! The
-.B synth
-effect is used to generate each of the tones;
-.B "\-c1 \-r8000"
-selects mono, 8kHz sampling-rate audio (i.e. relatively low fidelity,
-suitable for the marine radio transmission channel); each tone is
-generated at a length of 0\*d25 seconds to give the required 4Hz
-alternation. Note the use of `raw' as the intermediary file format; a
-self-describing (header) format would just get in the way here. The
-self-describing header is added only at the final stage; in this case,
-.B .ogg
-is chosen, since lossy compression is appropriate for this application.
-.SP
-There are further practical examples of scripting with SoX available to
-download from the SoX web-site [1].
-.SH SEE ALSO
-.BR sox (1),
-.BR soxi (1),
-.BR libsox (3)
-.SS References
-.TP
-[1]
-.IR "SoX\*mSound eXchange | Scripts" ,
-http://sox.sourceforge.net/Docs/Scripts
-.SH AUTHORS
-This man page was written largely by Juergen Mueller (jmueller@uia.ua.ac.be).
-Other SoX authors and contributors are listed in the AUTHORS file that
-is distributed with the source code.
--- a/soxformat.7
+++ b/soxformat.7
@@ -597,12 +597,13 @@
.BR sox (1),
.BR soxi (1),
.BR soxeffect (7),
-.BR soxexam (7),
.BR libsox (3),
.BR octave (1),
.BR wget (1)
.SP
The SoX web page at http://sox.sourceforge.net
+.br
+SoX scripting examples at http://sox.sourceforge.net/Docs/Scripts
.SS References
.TP
[1]
--- a/soxi.1
+++ b/soxi.1
@@ -74,7 +74,6 @@
.BR sox (1),
.BR soxformat (7),
.BR soxeffect (7),
-.BR soxexam (7),
.BR libsox (3)
.SP
The SoX web site at http://sox.sourceforge.net