Path: utzoo!attcan!uunet!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!mips!pacbell.com!pacbell!att!mcdchg!tellab5!nucsrl!accuvax.nwu.edu!anaxagoras!ils.nwu.edu!sandell From: sandell@ils.nwu.edu (Greg Sandell) Newsgroups: comp.music Subject: Re: Books on massaging waveforms... Keywords: samples sound Message-ID: <987@anaxagoras.ils.nwu.edu> Date: 28 Jun 90 00:02:56 GMT References: <4090@uqcspe.cs.uq.oz.au> Sender: news@anaxagoras.ils.nwu.edu Reply-To: sandell@ils.nwu.edu (Greg Sandell) Distribution: comp Organization: The Institute for the Learning Sciences Lines: 33 In article <4090@uqcspe.cs.uq.oz.au>, tonyg@batserver.cs.uq.oz.au (Tony Gedge) writes: > Can someone point me towards a good starting book in manipulating > sampled sound? I want to do things like: > > * Raise and lower the pitch of samples without changing the speed > that samples are played. > * Mix two or more samples together. > * Change the sampling rate. > I would get the new book on Computer Music by F. R. Moore which is out in Prentice-Hall, 1990. The title is something like (sorry, I don't have it here in my office) THE ESSENTIALS OF COMPUTER MUSIC. The task of changing the pitch of a soundfile without changing its apparant speed or duration (which is what I think you are trying to describe above) is a problem which requires large amounts of number crunching; it takes quite a long time to make such a conversion (like, maybe 60 seconds for a one second soundfile on a powerful computer). The algorithm I know of which does this is the Phase Vocoder, for which C code is provided in Moore's book. The second two questions I don't know quite as much about, but I believe if you simply add samples together and then normalize them so you don't get samples out of range, you get mixed samples. For changing the sampling rate, if you are going from a higher sampling rate to a lower one, you can keep one sample, delete the next (new_samp_rate/old_samp_rate) samples, and keep doing this for the rest of the soundfile. I have done this in going from 22000k to 8000k and the results sound just fine. Somehow I suspect this is not the most HiFi way to do this task, though. As for going from a smaller sampling rate to a larger one, the strategy of duplicating samples in the equivalent way will *definitely* not work!