John's Corner

AudioGen

[ Legacy archive ]

AudioGen is a native DOS program that implements an audio waveform generator. It can generate sine, square, triangle and sawtooth waves from 20Hz to 20KHz using a parallel port and doesn't need a sound card.

The waveform is generated on the first parallel port (378h) and requires an R - 2R network as follows:


 Pin 2 —— R ——·—— 2R —— Pin 18
              |
             2R
              |
 Pin 3 —— R ——·
              |
             2R
              |
 Pin 4 —— R ——·
              |
             2R
              |
 Pin 5 —— R ——·
              |
             2R
              |
 Pin 6 —— R ——·
              |
             2R
              |
 Pin 7 —— R ——·
              |
             2R
              |
 Pin 8 —— R ——·
              |
             2R
              |
 Pin 9 —— R ——·—— C ——> Audio out
              |
             2R
              |
Pin 18 ———————·———————> Ground

Use resistor values of R = 10K and 2R = 20K (1% tolerance)

Use a capacitor value of C = 1uF (monolithic ceramic or tantalum with + to pin 9)

Will operate in Win9x but timing restrictions will lead to distortion in waveform. Will also operate in Dosbox on a Win32 or Win64 platform. Dosbox will direct the output through the PC sound so the R-2R network and parallel port is not required but the waveform will be distorted, especially at high frequencies.

The user interface is very basic and uses function keys to select frequencies, waveforms and amplitudes. But we are more interested in the output (aren't we?)

Programmed in C++ with an embedded assembler routine to generate the waveforms from lookup tables - needed to get high frequency performance on typical 386 or 486 hardware.

Did this one mainly for the challenge of seeing if it could be done this way. Does work and is useful. Be careful of loading the output - high impedance line level only.


Download AudioGen


Return to Front Page


John's Corner