CompuServe Messages

#Audio.device

    11-Sep-89 23:38:26
Sb: #65174-#Audio.device
Fm: Richard Rae/SYSOP 76703,4253
To: Sylvain Duford 76056,1655
55 hertz sounds suspicious; wait a second… <figuring madly>… okay, maybe I have it. To control the pitch of the output signal, you change the value in the period register for the channel you're using. The range is from 124 to 65535, and the resulting period is period_register/3579545. Plugging in the largest possible value gives us 0.0183, which translates to "54.6 Hz". Is this the 55 Hz you're coming up with? What you have to remember is that this is the period BETWEEN TWO SAMPLES, and that multiple samples are required to define a cycle. For example, if the simplest waveform you can create (in this context) is a square wave: one point high, one point low. This takes TWO samples to define one cycle, which means TWO periods, or 27.3 Hz with a period_register of 65535. More typically, you'd have a larger power of two in your wave table; for example, if you had a sine wave define by 16 points, your minimum frequency would be 3.4 Hz! Be aware, however, that the audio output of the Amiga is NOT DC coupled, and therefore IS limited as to the lowest frequency you can reproduce. The amplitude will start rolling off as you approach the lower limit; I don't know if this is important to your application or not. You might want to check the Hardware Reference Manual for a more detailed explanation; pages 140-143 contain the meat of this discussion. And, of course, you're welcome to ask for further clarification here. Writing a sweep generator to verify your speaker response graphs, are you?