Re: [CM] out

2022-06-16 Thread bil

When you call

  (outa i (* 0.5 (oscil gen)))
  (outb i (* 0.5 (oscil gen)))

you're calling the "gen" oscillator twice
so you get one sample in outa, then its next sample
in outb, etc -- from the channel's point of view
it's seeing an oscillator running twice as fast
(880 Hz).

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


[CM] out

2022-06-16 Thread James Hearon

Hi,
I think I've had a basic misunderstanding re: re stereo and using out such as 
outa, outb, outc, outd. It seems to sum rather than provide discrete outs?  I'm 
just checking I'm not going bonkers looking at the fft of the output signal.  I 
know locsig works differently

ex.1 results in 880 hz on a and b, but would expect 440 on a and 440 on b.
(with-sound (:play #f :channels 2)
  (let ((gen (make-oscil 440.0)))
(do ((i 0 (+ i 1)))
((= i 48000))
  (outa i (* 0.5 (oscil gen)))
  (outb i (* 0.5 (oscil gen)))
  )))

ex.2 but to have have the same signal on both channels I need to use 2 gens?
(with-sound (:play #f :channels 2)
  (let ((gen (make-oscil 440.0))
  (gen2 (make-oscil 440.0)))
(do ((i 0 (+ i 1)))
((= i 48000))
  (outa i (* 0.5 (oscil gen)))
  (outb i (* 0.5 (oscil gen2)))
  )))

Or how do you best do stereo using out?
This seems to sum as well.

(with-sound (:play #f :channels 2)
  (let* ((gen (make-oscil 440.0))
 (gen2 gen))
(do ((i 0 (+ i 1)))
((= i 48000))
  (outa i (* 0.5 (oscil gen)))
  (outb i (* 0.5 (oscil gen2)))
  )))


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