;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Funcion para entrar y panear (panoramica) con
;;; un sonido monofonico
;;;
;;;
;;; juanig\_at\_ccrma
;;;
;;; (c) 2005
(define paninsound
(lambda* (file beg #:key
(inbeg 0)
(degrees 45)
(amp 1.0)
(amp-env '(0 1 100 1))
(distance 1.0)
)
(let* ((start (inexact->exact (floor (* beg (srate)))))
(dur (mus-sound-duration file))
(inloc (inexact->exact (floor (* (or inbeg 0)
(mus-sound-srate file)))))
(inp-a (make-readin file
:channel 0
:start inloc
) )
(ampfunc1 (make-env amp-env amp dur))
(ampfunc2 (make-env amp-env amp dur))
(end (+ start (floor (* (srate) dur))))
(loc (make-locsig
:channels (channels)
:degree (or degrees (random 90))
:distance distance))
(out1 (make-vct end))
(out2 (make-vct end)))
;;
(do ((i start (1+ i)))
((= i end))
(vct-set! out1 i (* (locsig-ref loc 0) (env ampfunc1) (readin inp-a)))
(vct-set! out2 i (* (locsig-ref loc 1) (env ampfunc2) (readin inp-a))))
(mix-vct out1 start #f 0 #f)
(mix-vct out2 start #f 1 #f) )))
;;; (load "pansoni.scm")
;;; (new-sound "/zap/test.snd" :channels 2 :srate 44100)
;;;(paninsound "/zap/insound.snd" 0)
(define sequence-1
(lambda ()
(paninsound "/zap/caneca.snd" 0 :degrees 0.0 :amp-env '(0 0 20 1 80 1 100 0))
(paninsound "/zap/caneca.snd" 1.5 :degrees 22.5 :amp-env '(0 0 20 1 80 1 100 0))
(paninsound "/zap/caneca.snd" 3.0 :degrees 45.0 :amp-env '(0 0 20 1 80 1 100 0))
(paninsound "/zap/caneca.snd" 4.5 :degrees 67.5 :amp-env '(0 0 20 1 80 1 100 0))
(paninsound "/zap/caneca.snd" 6.0 :degrees 90.0 :amp-env '(0 0 20 1 80 1 100 0))
))
|