[CM] scheme move-locsig

2016-05-05 Thread James Hearon

Hi,
I couldn't come up with the magic to get a pan-env working across a heap of 
notes with move-locsig.  But I made a solution below by just passing degree 
only to the inst and controlling degree over the total duration of the heap 
from with-sound.  Not elegant, but it pans across the whole heap of notes.


(provide 'snd-nrev.scm)

(if (provided? 'snd)
(require snd-ws.scm)
(require sndlib-ws.scm))

(load "/opt/snd-16/CM_patterns.scm")

(define (round-off z n)
  (let ((power (expt 10 n)))
(/ (round (* power z)) power)))

(definstrument (myinst start-time duration frequency amplitude sampling-rate 
revamt distance degree )
  (let* ((beg (floor (* start-time sampling-rate)))
 (end (+ beg (floor (* duration sampling-rate
 (loc (make-locsig :degree degree :distance distance :reverb revamt))
 (sine-wave (make-oscil :frequency frequency)))
 (do ((i beg (+ i 1)))
 ((= i end))
 (let ((x (* amplitude (oscil sine-wave
   (locsig loc i x)
   (move-locsig loc degree distance)
   

(let ((aaa (make-heap '(360 800.345 1200 600))) 
  (bbb (make-heap '(1 1 .75 .25 .20 .15 .10 .10 .10 .10))) )
(with-sound (:reverb nrev :output "/home/MyTest.wav" :srate 48000 :channels 2
 :header-type mus-riff :statistics #t :play #t)
  (let ((i 0))
(let ((mypanenv (make-env '(0 90 5 0) :length 70))) ;not sure 
why length  works here instead of duration
   (do ((k 0 (+ k 1)))
   ((>= k 40))
   (let ((v (next bbb))) 
(myinst  i v  (next aaa) .9 48000  0.01  1.0  (mypanenv k)  ) 
;send degree to inst
(set! i (+ (round-off i 2) v))
  ) )
   


___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist



Re: [CM] scheme move-locsig

2016-04-29 Thread bil

The 45-degrees = center choice goes back before
my time!  John Chowning is to blame, I think.
In MUS10 we used the (non-standard even then)
speaker numbering
  10
  23
so 0 degrees was right-front.

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist



Re: [CM] scheme move-locsig

2016-04-29 Thread andersvi
Hi James.

J> (myinst i v  (next aaa) .9 48000  0.01  0  1.0  '(0 90 5 0)  )

Seems you're setting the panning-envelope for every note to '(0 90 5 0),
and scaling the duration of this env to the hard-coded 12 seconds in
your make-env call.

Given the short note-durations (0.1->1.0 sec.) this leaves all your
notes close to 90 degrees.

Btw, there seem to be different interfaces to the various *locsig
functions in clm/snd.  dlocsig uses 0° as front by default, while Bills
locsig in snd uses 45° as center.  Better check the docs.

If you change the 12 seconds to durations in your ins:

 (make-env panning-env :duration duration)

you may fool around more with the envelope in the calls, eg.:

(myinst i v (next aaa) .9 48000 0.01 0 1.0 `(0 ,(random 90) ,v ,(random 90)))

-anders

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist