shithub: sox

Download patch

ref: c7ebcb686ad3e5aaea98f2a07fd099586ffce861
parent: 41783531471a5c9378ac992b907fbb28fb46a24e
author: robs <robs>
date: Sun Apr 12 03:17:35 EDT 2009

display (better) effect attributes

--- a/FEATURES.in
+++ b/FEATURES.in
@@ -55,6 +55,7 @@
 ** bass: Tone control: RBJ shelving biquad IIR filter
 ** equalizer: RBJ peaking equalisation biquad IIR filter
 ** fir: FFT convolution FIR filter using externally provided coefficients
+** firfit+: FFT convolution FIR filter using given freq. response (W.I.P.)
 ** highpass: High-pass filter: Single pole or RBJ biquad IIR
 ** lowpass: Low-pass filter: single pole or RBJ biquad IIR
 ** sinc: Sinc-windowed low/high-pass/band-pass/reject FIR
@@ -85,7 +86,7 @@
 ** vol: Adjust audio volume
 
 * Editing effects
-** crop: Like `trim', but can crop end without specifying length
+** crop+: Like `trim', but can crop end without specifying length (W.I.P.)
 ** pad: Pad (usually) the ends of the audio with silence
 ** silence: Remove portions of silence from the audio
 ** splice: Perform the equivalent of a cross-faded tape splice
@@ -93,6 +94,7 @@
 
 * Mixing effects
 ** channels: Auto mix or duplicate to change number of channels
+** divide+: Divide sample values by those in the 1st channel (W.I.P.)
 ** mixer: Mix up to 4 channels in certain ways
 ** remix: Produce arbitrarily mixed output channels
 ** swap: Swap stereo channels
@@ -117,17 +119,17 @@
 
 * Analysis `effects'
 ** noiseprof: Produce a DFT profile of the audio (use with noisered)
-** spectrogram+: graph signal level vs. frequency & time
+** spectrogram: graph signal level vs. frequency & time (needs `libpng')
 ** stat: Enumerate audio peak & RMS levels, approx. freq., etc.
 ** stats: Multichannel aware `stat'
 
-  + optional effect, available only if SoX is built with `libpng'.
-
 * Miscellaneous effects
 ** ladspa: Apply LADSPA plug-in effects e.g. CMT (Computer Music Toolkit)
 ** synth: Synthesise/modulate audio tones or noise signals
 ** newfile: Create a new output file when an effects chain ends.
 ** restart: Restart 1st effects chain when multiple chains exist.
+
+  + Experimental or incomplete effect; may change in future.
 
 Multiple audio files can be combined (and then further processed with
 effects) using any one of the following combiner methods:
--- a/src/crop.c
+++ b/src/crop.c
@@ -15,7 +15,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-/* This is W.I.P. hence marked SOX_EFF_DEPRECATED for now.
+/* This is W.I.P. hence marked SOX_EFF_ALPHA for now.
  * Need to change size_t/INT32_MAX to uint64_t/INT64_MAX (for LFS) and do
  * proper length change tracking through the effects chain.
  */
@@ -133,7 +133,7 @@
       "  n\tposition relative to start\n"
       "  -n\tposition relative to end\n"
       "  +n\tposition relative to previous",
-    SOX_EFF_MCHAN | /* SOX_EFF_LENGTH | */ SOX_EFF_MODIFY | SOX_EFF_DEPRECATED,
+    SOX_EFF_MCHAN | /* SOX_EFF_LENGTH | */ SOX_EFF_MODIFY | SOX_EFF_ALPHA,
 
     create, start, flow, NULL, stop, kill, sizeof(priv_t)
   };
--- a/src/divide.c
+++ b/src/divide.c
@@ -15,6 +15,11 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+/* This is W.I.P. hence marked SOX_EFF_ALPHA for now.
+ * Needs better handling of when the divisor approaches or is zero; some
+ * sort of interpolation of the output values perhaps.
+ */
+
 #include "sox_i.h"
 #include <string.h>
 
@@ -61,7 +66,7 @@
 sox_effect_handler_t const * lsx_divide_effect_fn(void)
 {
   static sox_effect_handler_t handler = {
-    "divide", NULL, SOX_EFF_MCHAN | SOX_EFF_GAIN | SOX_EFF_DEPRECATED,
+    "divide", NULL, SOX_EFF_MCHAN | SOX_EFF_GAIN | SOX_EFF_ALPHA,
     NULL, start, flow, NULL, stop, NULL, sizeof(priv_t)
   };
   return &handler;
--- a/src/firfit.c
+++ b/src/firfit.c
@@ -15,7 +15,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-/* This is W.I.P. hence marked SOX_EFF_DEPRECATED for now.
+/* This is W.I.P. hence marked SOX_EFF_ALPHA for now.
  * Need to add other interpolation types e.g. linear, bspline, window types,
  * and filter length, maybe phase response type too.
  */
@@ -126,7 +126,7 @@
   handler = *lsx_dft_filter_effect_fn();
   handler.name = "firfit";
   handler.usage = "[knots-file]";
-  handler.flags |= SOX_EFF_DEPRECATED;
+  handler.flags |= SOX_EFF_ALPHA;
   handler.getopts = create;
   handler.start = start;
   handler.priv_size = sizeof(priv_t);
--- a/src/input.c
+++ b/src/input.c
@@ -50,7 +50,7 @@
 sox_effect_handler_t const * lsx_input_effect_fn(void)
 {
   static sox_effect_handler_t handler = {
-    "input", NULL, SOX_EFF_MCHAN | SOX_EFF_DEPRECATED,
+    "input", NULL, SOX_EFF_MCHAN | SOX_EFF_INTERNAL,
     getopts, NULL, NULL, drain, NULL, NULL, sizeof(priv_t)
   };
   return &handler;
--- a/src/output.c
+++ b/src/output.c
@@ -51,7 +51,7 @@
 sox_effect_handler_t const * lsx_output_effect_fn(void)
 {
   static sox_effect_handler_t handler = {
-    "output", NULL, SOX_EFF_MCHAN | SOX_EFF_DEPRECATED,
+    "output", NULL, SOX_EFF_MCHAN | SOX_EFF_INTERNAL,
     getopts, NULL, flow, NULL, NULL, NULL, sizeof(priv_t)
   };
   return &handler;
--- a/src/sox.h
+++ b/src/sox.h
@@ -442,15 +442,17 @@
 
 #define SOX_MAX_EFFECTS 20
 
-#define SOX_EFF_CHAN     1           /* Effect can alter # of channels */
-#define SOX_EFF_RATE     2           /* Effect can alter sample rate */
-#define SOX_EFF_PREC     4           /* Effect can alter sample precision */
-#define SOX_EFF_LENGTH   8           /* Effect can alter audio length */
-#define SOX_EFF_MCHAN    16          /* Effect can handle multi-channel */
-#define SOX_EFF_NULL     32          /* Effect does nothing */
-#define SOX_EFF_DEPRECATED 64        /* Effect is living on borrowed time */
-#define SOX_EFF_GAIN     128         /* Effect does not support gain -r */
-#define SOX_EFF_MODIFY   256         /* Effect does not modify samples */
+#define SOX_EFF_CHAN     1           /* Can alter # of channels */
+#define SOX_EFF_RATE     2           /* Can alter sample rate */
+#define SOX_EFF_PREC     4           /* Can alter sample precision */
+#define SOX_EFF_LENGTH   8           /* Can alter audio length */
+#define SOX_EFF_MCHAN    16          /* Can handle multi-channel */
+#define SOX_EFF_NULL     32          /* Does nothing */
+#define SOX_EFF_DEPRECATED 64        /* Is living on borrowed time */
+#define SOX_EFF_GAIN     128         /* Does not support gain -r */
+#define SOX_EFF_MODIFY   256         /* Does not modify samples */
+#define SOX_EFF_ALPHA    512         /* Is experimental/incomplete */
+#define SOX_EFF_INTERNAL 1024        /* Is in libSoX but not sox */
 
 typedef enum {sox_plot_off, sox_plot_octave, sox_plot_gnuplot, sox_plot_data} sox_plot_t;
 typedef struct sox_effect sox_effect_t;