[CM] map-channel with dsp

bil at ccrma.Stanford.EDU bil at ccrma.Stanford.EDU
Sat Feb 10 07:35:00 PST 2018


(map-channel func) calls func on every sample; the value returned by the 
function
is the new sample if that value is a number, but your do loop just 
returns #t
(the value of the multiply in the loop body is simply thrown away), so 
the
map-channel operation quits, leaving zeros in the new sound.  I think 
you intend:

(let ((i 0))
   (map-channel (lambda (y)
                  (let ((result (* (amplitude-modulation 0.5) (im i))))
                    (set! i (+ i 1))
                    result))))




More information about the Cmdist mailing list