;*********************************************************************
|
; 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-SPLIT ========================
|
|
; might become a subclass of sox-remix
|
(defclass! sox-split (sox-input)
|
(
|
(gains :accessor gains :initarg :gains :initform nil :documentation *sox-gain-doc*)
|
(channels :accessor channels :initarg :channels :initform nil :documentation *sox-channel-matrix-doc*)
|
)
|
(:icon 17)
|
(:documentation "Split multichannel audio into individual channels.
|
|
<channels> optionally allows to specify combinations and order of input-channels (default: all channels in ascending order).")
|
)
|
|
; redundancy between sox-remix and sox-split here?
|
(defmethod initialize-instance :after ((self sox-split) &rest args)
|
(declare (ignore args))
|
(sox-init-gains self)
|
(when (sound self)
|
(let* ((thechannels (or (channels self) (arithm-ser 1 (sox-sound-channels (sound self)) 1)))
|
;check whether the gains are taken care of in sox-input
|
(newgains (if (equal (length (gains self)) (length thechannels))
|
(gains self)
|
(repeat-n (gains self) (length thechannels))))
|
)
|
(setf (channels self) thechannels)
|
(setf (gains self) (flat newgains))
|
))
|
(sox-init-sound self 'atom)
|
)
|
|
; (when (> (list-max channels) (sox-sound-channels (sound self)))
|
; (om-msg-beep "Channels not existent in input source."))
|