[CM] aif in Grace and CLM
Heinrich Taube
taube at uiuc.edu
Sat Nov 28 05:09:23 PST 2009
hi charles! in Grace the default audio file format is initialized to
WAV because that format works everywhere. but in clm you can use any
format you want, you just need to specify the appropriate header and
data format values, which for AIFF would be :header-type mus-aifc
and :data-format mus-bshort , respectively. so your example would look
something like:
(with-sound (:srate 44100 :header-type mus-aifc :data-format mus-
bshort :output "/Users/cnichols/Work/composition/playground/clm/
test.aif")
(grani 0 5 1 "/Users/cnichols/Work/composition/playground/clm/km1-
sicltttN.aif")
)
if you set up clm's globals the way you want then you dont need to
specfiy these values each time you use with-sound:
(define *clm-file-name* "test.aif")
(define *clm-data-format* mus-aifc )
(define *clm-header-type* mus-bshort)
(define *clm-srate* 44100)
and now your example becomes more managable:
(with-sound (:output "/Users/cnichols/Work/composition/playground/clm/
test.aif")
(grani 0 5 1 "/Users/cnichols/Work/composition/playground/clm/km1-
sicltttN.aif")
)
If you look in Grace's Audio Menu you will find a SndLib submenu
where you can set preferneces like channels and srate. The advantage
of a preference is that the app will boot up with those values in
effect so you dont ever need to set globals. but I see that my menu
doesn have a "default audio format" prefernce for saving AIFF vs WAV
vs SND settings. hmm this would only take about 20 minutes to add so
ill do it today and post a message when you can download the beta app
with it working.
On Nov 28, 2009, at 12:10 AM, Nichols, Charles wrote:
> Rick-
>
> I'm excited to get back to using CM and CLM, and have downloaded
> your new Grace environment, which looks elegant!
>
> I'm trying to write output to an .aif file with
>
> (with-sound (:srate 44100 :output "/Users/cnichols/Work/composition/
> playground/clm/test.aif")
> (grani 0 5 1 "/Users/cnichols/Work/composition/playground/clm/km1-
> sicltttN.aif")
> )
>
> but it doesn't write a playable file. It reads the "km1-
> siclttN.aif" file, but it won't write a playable "test.aif",
> "test.aiff", or "test.snd" file. It will write a playable
> "test.wav" file. Is there something I'm forgetting, to write
> an .aif, or should I stick with .wav? Or, is this a question for
> Bill?
>
> Looking forward to working with Grace.
>
> -Charles
>
> Charles Nichols
> Associate Professor, Composition and Music Technology
> University of Montana, Department of Music
> 32 Campus Drive, Missoula, MT 59812
> (406) 243-5360
> www.charlesnichols.com
>
More information about the Cmdist
mailing list