Xref: utzoo rec.music.synth:16820 comp.sys.ibm.pc.hardware:2717 comp.os.msdos.programmer:1759 comp.music:2075 comp.lang.pascal:4409 rec.music.makers:11258 Newsgroups: rec.music.synth,comp.sys.ibm.pc.hardware,comp.os.msdos.programmer,comp.music,comp.lang.pascal,rec.music.makers Path: utzoo!utgpu!watserv1!broehl From: broehl@watserv1.waterloo.edu (Bernie Roehl) Subject: Re: Adding Effects to Samples w/computers Message-ID: <1990Oct31.222913.15575@watserv1.waterloo.edu> Organization: University of Waterloo References: Date: Wed, 31 Oct 90 22:29:13 GMT Lines: 32 In article am42+@andrew.cmu.edu (Alexander Paul Morris) writes: > >I'm interested in taking a digital sound file saved on a PC and adding >(digitally, by means of a program) effects such as echo, reverb, delay, >chorus, distortion, etc. Does anyone possibly have any code or algorithms >they could share with my that may facilitate my ability to do this? It's actually pretty easy to do most of those things. You essentially add the waveform to itself, sample by sample, with an offset and a weight. Your first output value is the first value of the input. Your second output value is your second input value plus half the first input value. Your third output value is half the second plus a quarter of the first. And so on. out[0] = in[0]; out[1] = in[1] + .5 * in[0]; For all subsequent indices (2, 3, 4 etc): out[i] = in[i] + .5 * in[i-1] + .25 * in[i - 2]; (The above assumes you're storing values in floating point, which is a bad idea; the principle is the same, regardless. And needless to say, you can use more that just the previous two samples). Hope this helps. -- Bernie Roehl, University of Waterloo Electrical Engineering Dept Mail: broehl@watserv1.waterloo.edu OR broehl@watserv1.UWaterloo.ca BangPath: {allegra,decvax,utzoo,clyde}!watmath!watserv1!broehl Voice: (519) 885-1211 x 2607 [work]