[CM] With-sound question
cristopher pierson ewing
cewing@u.washington.edu
Tue, 22 Oct 2002 17:55:42 -0700 (PDT)
Okay,
Tried that here, it works on our system too, so the problem must lie in my
macro. I'm not sure what it could be, though. I'll kick it wround for a
few days and see what I can find. If I need to, I'll send a copy of the
rest of the code, so you can see why I'm using a macro at all.
Thanks for the input.
C
********************************
Cris Ewing
CARTAH Assistant
University of Washington
Home Phone: (206) 365-3413
E-mail: cewing@u.washington.edu
*******************************
On Mon, 21 Oct 2002, Fernando Pablo Lopez-Lezcano wrote:
> > I have a macro that writes calls to an instrument:
> >
> > (write-ins my-instrument-gen)
> > > (my-instrument 0 4 440) ;;this might ba an simp-type instrument that
> > ;; implements a simple oscilator.
> >
> > If i place a call to this macro in the spot where a normal instrument call
> > would be in a with-sound:
> >
> > (with-sound () (write-ins my-instrument-gen))
> >
> > The results are rather odd. No error is returned, but the output
> > soundifle is only 1 sample in length.
>
> Things work fine here:
> start cmucl
> (compile-file "v.ins")
> (load "v.cmucl")
>
> - load this macro:
>
> (defmacro twov (start dur f1 f2 amp)
> `(progn
> (fm-violin ,start ,dur ,f1 ,amp)
> (fm-violin ,start ,dur ,f2 ,amp)))
>
> - execute this with-sound call:
>
> (with-sound()(twov 0 1 440 450 0.1)
>
> It creates a soundfile with two violin notes with 440 and 450Hz
> frequencies For something like this obviously a macro is overkill, a
> simple function would suffice:
>
> (defun twovfun (start dur f1 f2 amp)
> (fm-violin start dur f1 amp)
> (fm-violin start dur f2 amp))
>
> -- Fernando
>
>