Notes from Oct-9

Mic Diagram

Topics:

hw2 (cont'd) -- (part 5) beginning with a script shown today, the object is to model your tube's resonance and create a synthesis that sounds the same as your physical tube.

An amplitude trace of the tube's response to an impulse should look something like this: (try different clapping and mic arrangements)

The scripts in echo.scm, illustrating reflection of waves, were elaborated in class. They create either an FIR or IIR circuit using a simple delayline.


 

The parts of the following script that I've named are echo secs att del xz y0 x0 yz

The parts that are Snd are... make-delay srate tap delay map-chan
and the parts that are Scheme are... define lambda* #&optional let round lambda set!

;;==================================

;; echo -- two versions: finite impulse response (FIR) and infinite impulse response (IIR)
; simulate perfect reflections, with attenuation factor
; terminology:
;             x0, xz are current input and delayed input
;             y0, yz are current output and delayed output
(define echo  ; FIR version, aka feed-forward or one-shot delay
  (lambda* (secs #&optional (att 1.0))
    (let ((del (make-delay (round (* secs (srate)))))    ; make a delayline of length srate * secs
   (xz 0.0)                                       ; storage for delayed sample
   (y0 0.0))                                      ; and for output sample
      (lambda (x0)                                       ; get input sample
       (set! xz (tap del))                        ; get delayed sample
       (set! y0 (+ x0 (* att xz)))                ; output = input + (att * delayed)
       (delay del x0)                             ; feed input into delayline
       y0)                                        ; return output
      )))
;; load a click into snd, at the beginning of a 0.1 sec soundfile
;; the click is a single sample of maximum amplitude
(click 0.1)
;; iterate the echo procedure over all samples in the soundfile
(map-chan (echo 0.01 0.9))                               ; secs = 0.01, attenuation = 0.9


Noteworthy:

Snd editing hints on Planet CCRMA (a new guide to all things Linux in the lab, by Juan Reyes)
http://www-ccrma.stanford.edu/guides/planetccrma/soundutilities.html