;*********************************************************************
|
; OM-SoX, (c) 2011-2013 Marlon Schumacher (CIRMMT/McGill University) *
|
; http://sourceforge.net/projects/omsox/ *
|
; *
|
; Multichannel Audio Manipulation and Functional Batch Processing. *
|
; DSP based on SoX - (c) C.Bagwell and Contributors *
|
; http://sox.sourceforge.net/ *
|
;*********************************************************************
|
;
|
;This program is free software; you can redistribute it and/or
|
;modify it under the terms of the GNU General Public License
|
;as published by the Free Software Foundation; either version 2
|
;of the License, or (at your option) any later version.
|
;
|
;See file LICENSE for further informations on licensing terms.
|
;
|
;This program is distributed in the hope that it will be useful,
|
;but WITHOUT ANY WARRANTY; without even the implied warranty of
|
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
;GNU General Public License for more details.
|
;
|
;You should have received a copy of the GNU General Public License
|
;along with this program; if not, write to the Free Software
|
;Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,10 USA.
|
;
|
;Authors: M. Schumacher
|
|
(in-package :om)
|
|
; ==== SOX-REMIX ========================
|
|
(defclass! sox-remix (sox-input)
|
(
|
(gain-matrix :accessor gain-matrix :initarg :gain-matrix :initform nil :documentation *sox-gain-matrix-doc*)
|
(channel-matrix :accessor channel-matrix :initarg :channel-matrix :initform nil :documentation *sox-channel-matrix-doc*)
|
)
|
(:icon 19)
|
(:documentation "Select and mix input audio channels into output audio channels.
|
Each output channel is specified, in turn, by a given a list of contributing input channels and gain values.
|
|
NB: this input class represents a mixing-matrix which allows for arbitrary combinations of input and output channels; it should not be confused with sox-mix (where multiple audio inputs are mixed together.")
|
)
|
|
; consider for the editor to have out-channels as rows, instead of columns (like in the description of mat-trans)
|
|
(defmethod initialize-instance :after ((self sox-remix) &rest args)
|
(when (sound self)
|
(if (consp (sound self))
|
(om-beep-msg "sox-remix expects a single sound (not a list)")
|
|
(let* ((thesound (sound self))
|
(thevolume (if (soundp thesound) (vol (sound self)) 100)))
|
(unless (channel-matrix self) (setf (channel-matrix self) (list (arithm-ser 1 (sox-sound-channels thesound) 1)))) ;when there's no
|
(setf (gain-matrix self) (sox-gain-matcher (or (gain-matrix self) (list (sox-vol-convert thevolume))) (channel-matrix self)))
|
(sox-init-sound self 'atom)
|
)
|
)
|
))
|