Share |

Black Cat Systems
Follow our tweets to instantly hear about new releases!

Home
Purchase
Support Forum
Get Our CD-ROM
News
Mac OS X Software
Mac OS 9 Software
Windows Software
Ham Radio iPhone/iPad
Linux Software
Documentation
Support/FAQ
Update Policy
Lost Reg Code?

Radiation Detectors
USB Icom CI-V Interface
MIL-STD-188 Interface

General Interest Programs

  Atomic Mac/PC
  Audiocorder
  Audio Toolbox
  Black Cat Timer
  Diet Sleuth
  iUnit
  Graffikon
  Graph Paper Maker
  Health Tracker
  Knitting Wizard
  Label Wizard
  Prog Audio Gen
  Sound Byte
  Synth 76477

Amateur Radio Programs
  Audiocorder
  Black Cat CW Keyer
  DX Toolbox
  Elmer
  MatchMaker
  MININEC Pro
  Morse Mania
  MultiMode
  mySdrPlayback
  RF Toolbox
  SelCall
  Sonde

iPhone/iPad Apps
  ALE
  Atoms To Go
  dB Calc
  Drill Calc
  DX Toolbox
  Elmer Extra
  Elmer General
  Elmer Tech
  Feld Hellschreiber
  Field Strength Calc
  Function Generator Pad
  GMDSS
  Godafoss
  HF Weather Fax
  iAttenuate
  iFunctionGenerator
  iGeiger
  iSoundex
  iSoundByte
  iSweep
  iUnit
  Morse Mania
  ACARS Pad
  Morse Pad
  NAVTEX Pad
  Packet Pad
  PSK31 Pad
  SSTV Pad
  Photon Calc
  Rad Map Tracker
  RF Link Calc
  SelCall Tone Gen
  Sound Byte
  Sound Byte Control
  Spectrum Pad
  SWBC Schedules
  Synth 76477
  Transmission Line Calc
  Weather Calc
  Wire Calc

Android Apps
  ACARS
  HF Weather Fax
  NAVTEX
  Rad Map Tracker
  SelCall Tone Gen
  SWBC Schedules
  Wire Calc

About Black Cat Systems
Geiger Counter
Site Map
Our software for Mac OSX
Privacy Policy
Press/Media
HFunderground
Apple /// Emulator

Macintosh Links
Shortwave Radio
Pirate Radio
Spy Numbers Stations
Science and Electronics
Ham Radio Software
Geiger Counters


   

PAG - Programmable Audio Generator

What is it?
PAG - Programmable Audio Generator - is a program for creating audio files containing a series of tones.

Why would you use it?
PAG is useful for creating files of test tones, for testing audio software, or equipment. Let's say you wanted to make a file of DTMF (Touch Tone) tones to test out some equipment. You can use PAG to generate such a file.

How do you use it?
PAG reads in a text file to define what audio to produce. There are four sections to the file:

  • File format
  • Defintion of tones
  • Macros
  • Tones to send

Below is an actual file, let's take a look at it:

#format WAVE 44100 16 1 dtmf.wav
1 0.2 697 50 50 1209 50 50
2 0.2 697 50 50 1336 50 50
3 0.2 697 50 50 1477 50 50
4 0.2 770 50 50 1209 50 50
5 0.2 770 50 50 1336 50 50
6 0.2 770 50 50 1477 50 50
7 0.2 852 50 50 1209 50 50
8 0.2 852 50 50 1336 50 50
9 0.2 852 50 50 1477 50 50
* 0.2 941 50 50 1209 50 50
0 0.2 941 50 50 1336 50 50
# 0.2 941 50 50 1477 50 50
A 0.2 697 50 50 1633 50 50
B 0.2 770 50 50 1633 50 50
C 0.2 852 50 50 1633 50 50
D 0.2 941 50 50 1633 50 50
s 0.2 1 1 1 1 1 1
#macros
h 8675309
#start
0s1s2s3s4s5s6s7s8s9s0sAsBsCsDs*s#s
h 
The first line defines the format of the file to produce:
#format WAVE 44100 16 1 dtmf.wav
The format of the this line is:
#format fileType sampling bits channels fileName
fileType can be one of: WAVE, AIFF, AU
sampling is the sampling rate in Hz, such as 44100, 11025, 8000, etc
bits is the sample size, only 8 and 16 are allowed
channels is 1 or 2, for mono or stereo
fileName is, as expected, the name of the file to produce

Next come the definitions for the tones. Each tone is assigned to a character, whenever that character appears in the fourth section of the file (tones to send) it is produced. A tone can actually be defined to produce more than one frequency at a time, which is necessary in cases like DTMF where two tones must be played at the same time for each button on the phone. For example, the definition for the 1 button:

1 0.2 697 50 50 1209 50 50
The definition of this line is:
character length freq1 ampL1 ampL2 ... freqN ampLN ampRN
The first letter in the line is the character assigned to that tone. Any printable or non printable character may be used, except for the tilde ~ which is actually mapped to the space character, since it is more likely you will want to define the space than the tilde. That is, you use the tilde here to define the tones to send when the space character is encountered. Hopefully that isn't too confusing.

The second value is the length (in seconds) that tone should be played for.

Next, we take values in blocks of three, such as 697 50 50 in that line. The 697 means to play 697 Hz, the 50 50 means to set the amplitude to 50% for both the left and right channels. The next set of three values is 1209 50 50 which means we want to play a second tone at the same time, of 1209 Hz, also 50% amplitude in each channel. You can have different amplitudes for each tone and channel of course, but for a given channel, the sum of all the amplitudes for all the frequencies should not exceed 100%, or distortion will result.

You can define up to ten frequencies for each character. You must specify all three values for each, including both amplitudes, even if the sound file is monophonic.

After all of the tones are defined, you define the macros, preceeded by the line:

#macros
You must include this line, even if no macros follow. Macros are easy to define, in our example, we have one macro definition:
h 8675309
This means that whenever the character h is encountered, to substitute the characters 8675309 instead. Don't define a macro using a letter already assigned to a tone.

After the macros have been defined, there should be the following line:

#start
And following this, the text to be converted into tones. In our example:
0s1s2s3s4s5s6s7s8s9s0sAsBsCsDs*s#s 
h
In this case we are sending each tone tone button's tone pairs, with a space between them, as s was defined to be a 1 Hz tone of amplitude 1%, making it inaudible. Then we have the letter h, which is a macro, which means that the tones for buttons 8675309 are sent.

We do have returns in our data portion, but as we have not defined them to map to any tones, they cause no additional output.

That's really about it.

There is a text editor in the program, or you can use your own, like BBEdit. TextEdit that comes with Mac OS X doesn't always save in a plain text format. Windows users can use any editor, like Notepad, if they'd prefer.

After you have your text file opened in PAG, select Process File from the File menu. It may take a few seconds (or more!) depending on the length of the sound file being produced. After it is done, it displays a second window with some debugging results (which are also contained in three text files it produces). You can send this to me (along with the input file!) if you're having difficulties, it may help determine the problem.


Download Options:
PAG 1.2.0 for Mac OS X - Mac OS X 10.2 and later (964k)



PAG 1.2.0 for MacOS Classic - Mac OS 8.6 and later (956k)



PAG 1.2.0 for Windows - Windows 98 later (702k)




PAG is only $19.99!

Before buying, you should download a copy and make sure it works on your particular configuration.


Email your comments and questions to info@blackcatsystems.com

Last modified December 4, 2005