everything related to duct tape audio suite (dtas)
 help / color / Atom feed
* Adding fade effect
@ 2015-01-12 11:23 Rene Maurer
  2015-01-12 22:01 ` Eric Wong
  0 siblings, 1 reply; 4+ messages in thread
From: Rene Maurer @ 2015-01-12 11:23 UTC (permalink / raw)
  To: dtas-all

Hello

I have two questions concerning sinks:

1.
What is the recommended way to add a fade effect like

# play song.flac fade 0 15 5"

to a sink?

2.
When I change for example the default sink with "dtas-sinkedit default"
and I then store the edited sink. Is the changed sink directly applied
or is a dtas-player restart required?

Best
René



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Adding fade effect
  2015-01-12 11:23 Adding fade effect Rene Maurer
@ 2015-01-12 22:01 ` Eric Wong
  2015-01-14  4:56   ` Rene Maurer
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Wong @ 2015-01-12 22:01 UTC (permalink / raw)
  To: Rene Maurer; +Cc: dtas-all

Rene Maurer <rmnet@mailc.net> wrote:
> Hello
> 
> I have two questions concerning sinks:
> 
> 1.
> What is the recommended way to add a fade effect like
> 
> # play song.flac fade 0 15 5"
>
> to a sink?

Sinks have no concept of which song is playing, however you can
edit the source instead using "dtas-sourceedit sox".  Change
(or add) the following line starting with "command:"

command: exec sox "$INFILE" $SOXFMT - $TRIMFX fade 0 =0 5

I think the above fade example requires sox 14.4.x and later,
if you're using an older version you'll probably need to calculate
the "=0" offset based on the length of the track itself, but
also need to take into account the offset set by the $TRIMFX
variable (if you're seeking)

> 2.
> When I change for example the default sink with "dtas-sinkedit default"
> and I then store the edited sink. Is the changed sink directly applied
> or is a dtas-player restart required?

It should be applied immediately upon exiting your editor.  You'll
probably hear an audible gap if you're using ALSA directly as your
device gets restarted.

Again, I recommend editing the source instead of the sink as it won't
restart the device and for most effects, there won't be an audible gap.

I think dtas-sourceedit will get inotify support in the next release.
It'll allow you to hear changes with every save of the $EDITOR and not
have to restart dtas-sourcedit on every change (similar to how the
splitfx YAML file editing works in dtas.git)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Adding fade effect
  2015-01-12 22:01 ` Eric Wong
@ 2015-01-14  4:56   ` Rene Maurer
  2015-01-14  9:06     ` Eric Wong
  0 siblings, 1 reply; 4+ messages in thread
From: Rene Maurer @ 2015-01-14  4:56 UTC (permalink / raw)
  To: Eric Wong; +Cc: dtas-all

Eric Wong <e@80x24.org> wrote:

> command: exec sox "$INFILE" $SOXFMT - $TRIMFX fade 0 =0 5
> 
> I think the above fade example requires sox 14.4.x and later,

I have SoX v14.4.1 but the "=0 syntax" isn't supported.

Surprisingly doing just

command: exec sox "$INFILE" $SOXFMT - $TRIMFX fade 0 5 5

on a playing song starts fade out immediate and does the job (fade out
current song) as desired!

> if you're using an older version you'll probably need to calculate
> the "=0" offset based on the length of the track itself, but
> also need to take into account the offset set by the $TRIMFX
> variable (if you're seeking)

This was my first idea but as already said, this seams not to be
necessary...

> Again, I recommend editing the source instead of the sink as it won't
> restart the device and for most effects, there won't be an audible
> gap.

Done. It works well!

The documentation http://dtas.80x24.org/dtas-player_effects.txt brought
me on the wrong way:

,----
| 1. source effects
|
|  - anything which does not change the length of the audio
`----

René


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Adding fade effect
  2015-01-14  4:56   ` Rene Maurer
@ 2015-01-14  9:06     ` Eric Wong
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2015-01-14  9:06 UTC (permalink / raw)
  To: Rene Maurer; +Cc: dtas-all

Rene Maurer <rmnet@mailc.net> wrote:
> Eric Wong <e@80x24.org> wrote:
> 
> > command: exec sox "$INFILE" $SOXFMT - $TRIMFX fade 0 =0 5
> > 
> > I think the above fade example requires sox 14.4.x and later,
> 
> I have SoX v14.4.1 but the "=0 syntax" isn't supported.

> Surprisingly doing just
> 
> command: exec sox "$INFILE" $SOXFMT - $TRIMFX fade 0 5 5
> 
> on a playing song starts fade out immediate and does the job (fade out
> current song) as desired!

Ah, OK, I didn't realize you wanted you wanted to fade out immediately
(as opposed to fadiing out the last few seconds of every song
 as is typical for some radio stations).

> > if you're using an older version you'll probably need to calculate
> > the "=0" offset based on the length of the track itself, but
> > also need to take into account the offset set by the $TRIMFX
> > variable (if you're seeking)
> 
> This was my first idea but as already said, this seams not to be
> necessary...

OK, I thought you wanted something like a crossfade effect in MPD
where you fade out every song.  However, fade-in does not seem
to work right if seeking.

But just trying "fade 5 =0 5" seems to work right as long as you
do not seek, it just sounds horrible with a lot of silence :<

> > Again, I recommend editing the source instead of the sink as it won't
> > restart the device and for most effects, there won't be an audible
> > gap.
> 
> Done. It works well!
> 
> The documentation http://dtas.80x24.org/dtas-player_effects.txt brought
> me on the wrong way:
> 
> ,----
> | 1. source effects
> |
> |  - anything which does not change the length of the audio
> `----

Ah, a few lines below, there is:

  Effects which modify the length of the audio is not recommended here,
  as seek functionality will be impaired.

I can make the following change (wording suggestions appreciated!):

--- a/Documentation/dtas-player_effects.txt
+++ b/Documentation/dtas-player_effects.txt
@@ -10,6 +10,7 @@ They are applied in the order described.
   - ReplayGain (simple vol/gain changes)
   - anything which does not change the length of the audio:
     vol, stereo, highpass, lowpass, loudness, bass, treble, equalizer, ...
+  - ...or the fade effect for fading tracks out.
 
   Modifying source effects should introduce no extra gaps in playback.
   Effects which modify the length of the audio is not recommended here,

-- 
EW


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-12 11:23 Adding fade effect Rene Maurer
2015-01-12 22:01 ` Eric Wong
2015-01-14  4:56   ` Rene Maurer
2015-01-14  9:06     ` Eric Wong

everything related to duct tape audio suite (dtas)

Archives are clonable:
	git clone --mirror https://80x24.org/dtas-all
	git clone --mirror http://ou63pmih66umazou.onion/dtas-all

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.audio.dtas
	nntp://ou63pmih66umazou.onion/inbox.comp.audio.dtas

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git