everything related to duct tape audio suite (dtas)
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH] doc: favor the "gain" effect over "vol"
@ 2015-05-10  9:16  8% Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-05-10  9:16 UTC (permalink / raw)
  To: dtas-all; +Cc: Eric Wong

Followup-to commit 403ed90e2e7bed3e017938d76e17037b0d5059b6
(replaygain uses the "gain" effect instead of "vol")

The `gain' effect seems superior as it can "see" across the effects
chain to take into account extra/lost headroom.
---
 Documentation/dtas-env.txt            | 2 +-
 Documentation/dtas-player_effects.txt | 6 +++---
 Documentation/dtas-splitfx.txt        | 8 ++++----
 examples/splitfx.sample.yml           | 2 +-
 examples/tfx.sample.yml               | 4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/Documentation/dtas-env.txt b/Documentation/dtas-env.txt
index 374f626..0f59709 100644
--- a/Documentation/dtas-env.txt
+++ b/Documentation/dtas-env.txt
@@ -24,7 +24,7 @@ INFILE - the primary input file for playback or processing.
 (e.g. "/path/to/ex.flac")
 
 RGFX - the sox effect used for applying ReplayGain compensation.
-Only used during playback in dtas-player.  (e.g. "vol -6.0dB").
+Only used during playback in dtas-player.  (e.g. "gain -6.0").
 Removing this prevents ReplayGain from working and may damage
 playback equipment with loudly mastered music.
 
diff --git a/Documentation/dtas-player_effects.txt b/Documentation/dtas-player_effects.txt
index 9bfc525..58b69c7 100644
--- a/Documentation/dtas-player_effects.txt
+++ b/Documentation/dtas-player_effects.txt
@@ -7,9 +7,9 @@ They are applied in the order described.
   rely on inter-track information.
 
   Examples include:
-  - ReplayGain (simple vol/gain changes)
+  - ReplayGain (simple gain changes)
   - anything which does not change the length of the audio:
-    vol, stereo, highpass, lowpass, loudness, bass, treble, equalizer, ...
+    gain, stereo, highpass, lowpass, loudness, bass, treble, equalizer, ...
 
   Modifying source effects should introduce no extra gaps in playback.
   Effects which modify the length of the audio is not recommended here,
@@ -34,7 +34,7 @@ They are applied in the order described.
   - delaying a certain channel or frequency range for time-alignment
   - compressors/limiters
   - reverb
-  - vol
+  - gain
   - remix (for stereo image adjustments)
 
   Additionally, effects which are necessary due to the limitation of the
diff --git a/Documentation/dtas-splitfx.txt b/Documentation/dtas-splitfx.txt
index f8cbe5e..b58adec 100644
--- a/Documentation/dtas-splitfx.txt
+++ b/Documentation/dtas-splitfx.txt
@@ -46,7 +46,7 @@ to use ecasound(1), too.
 * infile - string, the pathname of the original audio file
 * env - ordered hash of environment variables to set for all commands
     env: !omap
-      FX: vol +3dB stats
+      FX: gain 3 stats
 * comments - hash of common tags for all audio (e.g. ARTIST, ALBUM, YEAR)
     comments:
       ARTIST: John Smith
@@ -118,7 +118,7 @@ use in targets:
 * RATEFX - rate effect and arguments for sox(1) resampling
 * DITHERFX - dither effect and arguments for sox(1) dithering
 * FX - any user-specified sox effects which encompases the entire file.
-  (e.g. "highpass 35 vol +3dB stats")
+  (e.g. "highpass 35 gain 3 stats")
 
 # TARGETS
 
@@ -150,8 +150,8 @@ imbalance in a live concert recording from the audience:
     targets:
       flac24:
         command: sox -M
-          "|sox $INFILE -c1 -p $TRIMFX remix 1v1 vol +9.5dB"
-          "|sox $INFILE -c1 -p $TRIMFX remix 2v1 vol +8.5dB"
+          "|sox $INFILE -c1 -p $TRIMFX remix 1v1 gain 9.5"
+          "|sox $INFILE -c1 -p $TRIMFX remix 2v1 gain 8.5"
           $COMMENTS $OUTFMT
           ${OUTDIR}bandYYYY-MM-DD.FOO.t0"$TRACKNUMBER.$SUFFIX"
           $RATEFX $DITHERFX stats
diff --git a/examples/splitfx.sample.yml b/examples/splitfx.sample.yml
index bbd224b..9c29df2 100644
--- a/examples/splitfx.sample.yml
+++ b/examples/splitfx.sample.yml
@@ -17,7 +17,7 @@ env: !omap
   SOX_OPTS: $SOX_OPTS -R
   FX:
     # highpass -1 120 highpass 40 highpass 40
-    # vol +1.5dB
+    # gain 1.5
     stats
 track_start: 1 # 0 for pregap/intro tracks
 cdda_align: true
diff --git a/examples/tfx.sample.yml b/examples/tfx.sample.yml
index 205a0a1..b8add0b 100644
--- a/examples/tfx.sample.yml
+++ b/examples/tfx.sample.yml
@@ -16,8 +16,8 @@ comments:
 track_start: 1
 effects:
 # the following commands are equivalent
-- trim 52 =53 sh sox $SOXIN $SOXOUT $TRIMFX vol -6dB
-- trim 52 1 sox vol -6dB # shorthand
+- trim 52 =53 sh sox $SOXIN $SOXOUT $TRIMFX gain -6
+- trim 52 1 sox gain -6 # shorthand
 
 # as are the following (for little endian machines)
 - trim 52 1 eca -eadb:-6
-- 
EW



^ permalink raw reply related	[relevance 8%]

* [PATCH] replaygain uses the "gain" effect instead of "vol"
@ 2015-05-07  8:41 10% Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-05-07  8:41 UTC (permalink / raw)
  To: dtas-all; +Cc: Eric Wong

The `gain' effect seems superior as it can "see" across the effects
chain to take into account extra/lost headroom.

For example, this allows me to add the the "gain -h" effect at the
start of my effects chain before the RGFX placeholder in my source
command, so when I play a file requiring a -6dB ReplayGain adjustment,
I will only need an additional -4dB of headroom to accomodate the
10dB boost at 20Hz I use (for listening through headphones):

Before:
  RGFX='vol -6dB'
  sox "$INFILE" $SOXFMT - $TRIMFX $RGFX vol -10dB equalizer 20 0.7071q 10

After:
  RGFX='gain -6'
  sox "$INFILE" $SOXFMT - $TRIMFX gain -h $RGFX equalizer 20 0.7071q 10
---
 lib/dtas/rg_state.rb        | 12 +++++++-----
 test/test_rg_integration.rb | 10 ++++++----
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/lib/dtas/rg_state.rb b/lib/dtas/rg_state.rb
index 6ab31b9..b124098 100644
--- a/lib/dtas/rg_state.rb
+++ b/lib/dtas/rg_state.rb
@@ -5,8 +5,10 @@
 # MAYBE: account for non-standard reference loudness (89.0 dB is standard)
 require_relative '../dtas'
 require_relative 'serialize'
+require_relative 'util'
 class DTAS::RGState # :nodoc:
   include DTAS::Serialize
+  include DTAS::Util
 
   RG_MODE = {
     # attribute name => method to use
@@ -53,19 +55,19 @@ class DTAS::RGState # :nodoc:
     to_hash.delete_if { |k,v| RG_DEFAULT[k] == v }
   end
 
-  # returns a dB argument to the "vol" effect, nil if nothing found
+  # returns a dB argument to the "gain" effect, nil if nothing found
   def rg_vol_gain(val)
     val = val.to_f + @preamp
     return if val.abs < @gain_threshold
-    sprintf('vol %0.8gdB', val)
+    sprintf('gain %0.8g', val)
   end
 
-  # returns a linear argument to the "vol" effect
+  # returns a DB argument to the "gain" effect
   def rg_vol_norm(val)
     diff = @norm_level - val.to_f
     return if (@norm_level - diff).abs < @norm_threshold
     diff += @norm_level
-    sprintf('vol %0.8g', diff)
+    sprintf('gain %0.8g', linear_to_db(diff))
   end
 
   # The ReplayGain fallback adjustment value (in dB), in case a file is
@@ -77,7 +79,7 @@ class DTAS::RGState # :nodoc:
     val = @fallback_gain + @preamp
     return if val.abs < @gain_threshold
     warn(reason) if $DEBUG
-    "vol #{val}dB"
+    "gain #{val}"
   end
 
   # returns an array (for command-line argument) for the effect needed
diff --git a/test/test_rg_integration.rb b/test/test_rg_integration.rb
index f8e81c2..efc8f97 100644
--- a/test/test_rg_integration.rb
+++ b/test/test_rg_integration.rb
@@ -1,8 +1,10 @@
 # Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org>
 # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
 require './test/player_integration'
+require 'dtas/util'
 class TestRgIntegration < Testcase
   include PlayerIntegration
+  include DTAS::Util
 
   def tmp_pluck(len = 5)
     pluck = Tempfile.open(%w(pluck .flac))
@@ -58,10 +60,10 @@ class TestRgIntegration < Testcase
       assert_match expect, cur["current"]["env"]["RGFX"]
     end
 
-    check_gain.call(%r{vol -3dB}, "album_gain")
-    check_gain.call(%r{vol -2dB}, "track_gain")
-    check_gain.call(%r{vol 1\.3}, "track_peak")
-    check_gain.call(%r{vol 1\.0}, "album_peak")
+    check_gain.call(%r{gain -3}, "album_gain")
+    check_gain.call(%r{gain -2}, "track_gain")
+    check_gain.call(%r{gain 0\.0}, "album_peak")
+    check_gain.call(%r{gain 2\.5}, "track_peak")
 
     s.req_ok("rg preamp+=1")
     rg = YAML.load(yaml = s.req("rg"))
-- 
EW



^ permalink raw reply related	[relevance 10%]

Results 1-2 of 2 | reverse | sort options + mbox downloads above
-- links below jump to the message on this page --
2015-05-07  8:41 10% [PATCH] replaygain uses the "gain" effect instead of "vol" Eric Wong
2015-05-10  9:16  8% [PATCH] doc: favor the "gain" effect over "vol" Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/dtas.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).