Well, it would be unpleasant, but the simplest approach would be to create a square wave.
Depending on whether you're creating a file with signed or unsigned amplitudes, you'll need to work out whether to oscillate between 0
and amplitude
, or -amplitude
and +amplitude
.
The frequency will determine how many samples to create at each value before switching.
It's hard to hlep more without any more details about what output format you're trying to create, etc - but that may help you to start with. Create a sine wave for a rather nicer tone :)