Re: On the fly bass downmixing to mono (mpd or alsa)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matt Garman <matthew.garman@xxxxxxxxx> wrote:
> I started the thread "How is the bass mixed? Per-channel frequency
> analysis? Histogram?" a few weeks ago.  One suggestion that came up a
> few times was to simply downmix the bass to mono before sending it
> out.
> 
> How would I go about this?  Currently, this system doesn't have any
> audio.  What I intend to do is send audio out over USB to a DAC.
> Ideally, I'd like to do on-the-fly remixing of only "bass frequencies"
> to mono.  Ideally the frequency should be configurable, but I think
> about 150Hz or below is a good start.

Instead of mpd, you could try my dtas-player component of dtas
(duct-tape audio suite)[1].  dtas-player is nearly as much a *nix shell
as a music player.  It is written in Ruby, but runs arbitrary shell
commands of your choosing (sox by default).

I suggest starting with a shell script using sox like below:

(My sox knowledge is rusty, so the following may not be 100% correct:)
------------------------ /path/to/sum-mono.sh ------------------------
#!/bin/sh
set -e
: note: TRIMFX, RGFX, INFILE, and SOXFMT vars come from dtas-player
COMMON="sox \"$INFILE\" -p $TRIMFX"
MONO="remix 1,2 1,2"
: stacking two filters should give a Linkwitz-Reily crossover at 150Hz
XO=${XO-150}
lo="$COMMON lowpass $XO lowpass $XO $MONO"
hi="$COMMON highpass $XO highpass $XO"
exec sox --combine=mix -v1 "|$lo" -v1 "|$hi" $SOXFMT - $RGFX
----------------------------------------------------------------------

Then, after dtas-player is started in a different terminal:

	$ dtas-ctl source ed sox command=$HOME/bin/sum-mono.sh
	$ dtas-ctl play

At the core, dtas-player is really like running the following in a shell:

        source-command | sink-command

Except it's possible to replace source-command without restarting
sink-command (and vice-versa) while preserving the same pipe.

To restore default behavior:

	$ dtas-ctl source ed sox command=


[1] - http://dtas.80x24.org/ - a bunch of scripts by me, a GUI-phobe :)
      Hopefully I'll have more time for this project soon.


Disclaimer: I was also an mpd developer and even project leader for a
short while, but decided to go off on my craziness.  Anyways I find it
much more enjoyable to just glue sox/ecasound/whatever commands together
with pipes than deal with maintaining a music player in C (or C++).
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@xxxxxxxxxxxxxxxxxxxx
http://lists.linuxaudio.org/listinfo/linux-audio-user




[Index of Archives]     [Linux Sound]     [ALSA Users]     [Pulse Audio]     [ALSA Devel]     [Sox Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux