;*********************************************************************
|
; 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-PAN ========================
|
|
(defclass! sox-pan (sox-input)
|
(
|
(gains :accessor gains :initarg :gains :initform nil :documentation *sox-gain-doc*)
|
(panning :accessor panning :initform nil :initarg :panning :documentation *sox-panning-doc*)
|
(numchannels :accessor numchannels :initform nil :initarg :numchannels :documentation "Number of available output channels for panning.")
|
)
|
(:icon 13)
|
(:documentation "Sox-Pan allows panning a sound between a pair of adjacent channels.
|
|
NB. Multichannel input is first summed into a single channel before panning.")
|
)
|
|
; possibly replace numchannels with out-channels
|
; Note: the slot "gains" should actually better be "gain" here (atom), not "gains"
|
; - this is inherited from sox-input
|
|
(defmethod initialize-instance :after ((self sox-pan) &rest args)
|
(declare (ignore args))
|
(when (sound self)
|
(unless (numchannels self) (setf (numchannels self) 2))
|
(sox-init-gains self)
|
(sox-init-panning self)
|
(sox-init-sound self 'atom)
|
(when (< (numchannels self) (+ 1 (floor (panning self))))
|
(setf (numchannels self) (+ 1 (floor (panning self))))
|
)
|
)
|
)
|
|
#|
|
(loop for sound in (list! (sound self))
|
for i from 0 to (- sound-length 1) collect
|
(if (equal (tracknum sound) 0)
|
(nth i panning-list)
|
(+ (tracknum sound) (* 0.01 (pan sound))))
|
|#
|
|
|
|
#|
|
There's a number of options for dealing with 'pan' and 'tracknum' in sound objects
|
1) leave it as is, meaning, sox-mix-console does not consider (overrides) pan or tracknum
|
2) add the tracknum and pan parameters to sox-input -> consequence: cannot use paths as inputs to classes
|
3) work with sound objects in sox-input classes (no conversion in sox-input) -> requires changes in sox-process
|
|#
|