[CM] wrapper macro strategies

Bret F Battey bbattey@u.washington.edu
Thu, 24 Jul 2003 16:26:51 -0700 (PDT)

Hi all,

Since I chain a lot of processors, I'm writing wrapper macros for some of the many CLM instruments that don't already have them. (I'll be very, very happy when I never have to use a 'sound-let' in my code.)

Interesting code problems I can't figure out while trying to make two wrappers for a 'balance' instrument:


One should be able to do:

(balance-sounds () (mix soundfile1) (mix soundfile2))

But given that defmacro can only take one &body, I'm really not sure on how to pull this off.

Or one can do 

(balance-sounds () ((mix soundfile1) (mix soundfile2)))

but it still not clear to me how to pull apart the body in a way that functions correctly.


If that can be solved, the next challenge is to make a balance wrapper that works for the most common situation: where you need to balance a processed file against the original unprocessed file. Given an already existing wrapper macro 'contrast-sound', one should be able to do something like the following to compensate for the tendency of 'contrast' to amplify a sound:

(balance-processed-sound () (contrast-sound (:fm-index 2) (mix soundfile1)))

or maybe

(balance-processed-sound () (contrast (:fm-index 2)) (mix soundfile1))

Any hints will be appreciated,

-=Bret Battey