Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!think!snorkelwacker!bloom-beacon!eru!luth!sunic!draken!d88-jwa From: d88-jwa@nada.kth.se (Jon Watte) Newsgroups: comp.sys.mac.programmer Subject: Re: System 7.0 sound Message-ID: <2864@draken.nada.kth.se> Date: 6 Feb 90 19:19:13 GMT References: <1629@ndmath.UUCP> <2850@draken.nada.kth.se> <14075@reed.UUCP> Reply-To: d88-jwa@nada.kth.se (Jon W{tte) Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 44 In article <14075@reed.UUCP> chaffee@reed.UUCP (Alex Chaffee) writes: >In article <2850@draken.nada.kth.se> d88-jwa@nada.kth.se (Jon W{tte) writes: >|Way 2: Scientific & Cycle-stealing >|Sample the sounds at 11kHz, play them zero-padded at 22kHz: >|2000 3000 4000 5000 A000 B000 C000 8000 Note, you still play byte-by-byte ! 20 00 30 00 40 00 ... As you can see, this introduces a note with frequency equal to half the sampling rate. There is a weird frequency-shift-reversal going on as well that doesn't sound good. This is why you need to filter the sound. 20 00 30 00 40 00 ... _might_ become: 1E 28 32 38 40 46 ... or something else, depending on the filter and surrounding data. >|which you would then digitally cut-filter at 11KHz and regain the >What a great idea. But what do you mean by "digitally cut-filter?" Would >you just divide each sample by 2? And since it should be "real-time," do >you think this could be implemented as a modifier? "Cut-filter" is shorthand for a steep low-pass filter. With this I mean, filter the sound so there's practically nothing left of the tone at half the sampling rate. (Really, you should cut at 120 dB just above one quarter of the sampling rate to be orthodoz, but this is too computationally expensive to even think about doing something else at the same time. Besides, the filter out to the mac speaker isn't good enough anyway, so why waste time ?) A sound modifier works on the sound COMMAND, not the actual data, so that mechanism would be awkward in this case. Best is to filter the buffer just before you pass the bufferCmd. h+ -- --- Stay alert ! - Trust no one ! - Keep your laser handy ! --- h+@nada.kth.se == h+@proxxi.se == Jon Watte longer .sig available on request