From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 208.118.235.0/24 X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: dtas-all@80x24.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 7F6EA1F493 for ; Mon, 19 Jan 2015 00:24:49 +0000 (UTC) Received: from localhost ([::1]:35101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YD09A-0000m3-Ii for dtas-all@80x24.org; Sun, 18 Jan 2015 19:24:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YD094-0000l5-NC for dtas-all@nongnu.org; Sun, 18 Jan 2015 19:24:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YD08w-00039o-HG for dtas-all@nongnu.org; Sun, 18 Jan 2015 19:24:42 -0500 Received: from dcvr.yhbt.net ([64.71.152.64]:35966) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YD08w-00039O-C6 for dtas-all@nongnu.org; Sun, 18 Jan 2015 19:24:34 -0500 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2A9BE1F490; Mon, 19 Jan 2015 00:24:32 +0000 (UTC) Date: Mon, 19 Jan 2015 00:24:32 +0000 From: Eric Wong To: dtas-all@nongnu.org Subject: mid-side stereo processing example Message-ID: <20150119-mid-side-processing-example.sh@sox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.71.152.64 X-BeenThere: dtas-all@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dtas-all-bounces+dtas-all=80x24.org@nongnu.org Sender: dtas-all-bounces+dtas-all=80x24.org@nongnu.org I just put this together based on an old SoX mailing list post: http://mid.gmane.org/72D2BEA8-3801-41EF-9BF0-364EACAE4C05@music.mcgill.ca Not sure if it's worth converting into Ruby and making it officially a part of dtas (and possibly libifying it for splitfx...) ---------------------------- 8< ------------------------------ #!/bin/sh # mid-side processing example, based on: # http://mid.gmane.org/72D2BEA8-3801-41EF-9BF0-364EACAE4C05@music.mcgill.ca usage () { echo >&2 "$0 INFILE " exit 1 } set -e INFILE="$1" test -n "$INFILE" || usage TYPE=$2 test -n "$TYPE" || usage shift 2 mid="remix 1,2" side="remix 1v0.5,2v-0.5" export SOX_OPTS=-V3 set -x OUT=${OUT-"-t alsa"} t="$TRIMFX" case $TYPE in mid) cmd="$mid" ;; side) cmd="$side" ;; merge) # Merge the Mid and Side signals into a stereo file: exec sox -M "|sox '$INFILE' -p $t $mid" "|sox '$INFILE' -p $t $side" \ $OUT ;; stereo) # Convert Mid/Sid stereo to L/R stereo: exec sox -M "|sox '$INFILE' -p $t $mid" "|sox '$INFILE' -p $t $side" \ $OUT remix -m 1,2 1,2i ;; esac exec sox "$INFILE" $OUT $t $cmd -- EW