

   Ŀ Ŀ    Ŀ Ŀ       Ŀ    Ŀ
                            Ĵ ӷ 
   Ŀ                   
                                   
                         
                Ŀ Ŀ Ŀ Ŀ Ŀ Ŀ Ŀ Ŀ
                                Ĵ         
                  Ŀ                   
                    
               

Version 1.2.0
December 2005
Copyright Eric Pietrocupo
License GNU Open source

	This software is distributed as open source software. You you may
use, copy and distribute this software as you wish. If you consider this
software really useful, you can always make a donation via Pay Pal. Look
at the end of the document for the references. 

Table of Content

1. Introduction
2. technical Information
3. Using this program
4. Using the source code
5. Known Bugs and Unimplemented features
6. Contact and references

>>>>> 1. Introduction >>>>>>>>>>

	Most video game programmers need some sound for their games. 
Unfortunately, besides recording through a microphone the sound you want,
there is currently no software on the market which can allow you to create
intelligible sound from scratch. All the sound software on the net can
either record or modify recorded sound. This make it difficult to find,
for example, an explosion sound without actually blowing something in your
house to record it. 

	Sound wave generator has been made to solve this problem. The
concept of this tool is to create a sound by setting various parameters to
change the output. With various adjustment and testing, it will be
possible to get the desired sound you want. You do not need to have
extensive knowledge in sound waves or math to produce reasonable sound.

	Due to the high demands from programmers, I will extract some
functions from this tool and make a library that you will be able to
compile with your game. It will allow you to generate sound inside your
game by loading SWG files or by setting the parameters yourself. It will
never generate sound in real time, but it will allow you to generate
SAMPLE object that you will be able to use in your game. The library will
be distributed as a separate package on www.allegro.cc. Or you can take a
look at the source code an extract some of the routines located in
wave.cpp yourself. 

>>>>> 2. Technical Information >>>>>>>>>>

	This program is available for DOS and Windows. I has been built
with the Allegro Video game Library and the Degui, the user interface
extension for Allegro. This software should have come with the following 
files :

sndwaveg.exe : This is the executable program you must run.

setup.bat : This is a batch file that invoke the setup program of allegro
            from the executable.

sndwaveg.dat : Datafile containing a few images.

keyboard.dat
language.dat
setup.dat : Allegro standard datafiles used by the setup program.

readme.txt : The file you are currently reading.

handbook.txt : This is the help file of the program teaching how to use
               sound wave generator.

gnugpl.txt : The GNU general public license.

alleg40.dll : Windows version only, this is the Allegro Library.

swg/???.swg : Folder containing a series of sound examples for you to check.

allegro.cfg : Allegro configuration file. ( Generated by setup )

	This software use the Graphic User interface and digital sound
output routines of Allegro. The only thing that should be set is the
digital sound output since we won't use the MIDI sound output. To start
the setup program type "sndwaveg -setup" or execute "setup.bat" which
will do the job for you. Select your sound hardware and make the sound
test. When it's done, it should normally work.

>>>>> 3. Using this program >>>>>>>>>>

	The generation of a sound sample has been based on 3 main
parameters : The Waveform, the Envelope and the Pitch gradient.  Each of
theses have a series of parameter which can be adjusted to perform various
output. On the main screen, you see the status of these 3 parameters. The
"parameter" menu will allows you to to changes all the settings of these
main parameters. When your parameters are set, you click "Generate" to
create the sound wave according to the settings selected.  There is also a
volume slider which adjust audio output. It will not influence in any way
the content of the generated sample, it's only for the playback.

	In each parameter windows, there is a series of text box and list
where you can select and set various parameters. The "preview" allows you
to make a preview of the setting you have selected. Note that this preview
only consider the parameters in the windows you are currently in and it
ignore all other. All the samples in the preview will always last 1.5
second and they will be sampled at 11025 with 8 bit even if you are
selected otherwise in your option. You will take advantage of all the
settings only when you click the "generate" button.

	You can save your samples in 2 different ways. First, I made my
own file format named .SWG. This file contains all the parameters setting
you have selected and it does not contains any generated sound. This is
useful if you want to reload your settings later to make some
modification. The swg file takes only around 112 bytes, so it saves a lot
of space. When you click "Generate", a new window with a waveform will
appear allowing you to "Play" the sound and to "Export" it. The export
button will allow you to save the currently generated sound in .WAV. 
It will now make it available for other applications. Note that Sound Wave
Generator cannot load waves, this is why there is the .swg file system. It
is a good idea to save the .swg even if you have your generated .wav file.

	Look at handbook.txt to see how all the parameters works.

>>>>> 4. Using the source code >>>>>>>>>>

	The source code for this software is available under the GNU
General Public License. I do not recommand compiling completely this
software. I am using DeGUI, which is a C++ encapsulation of the Allegro
GUI. The problem is that this library is full of errors and it is not
maintained anymore. I had to do many modifications to the library before
making it work. So it will really be hard to find yourself a working
library. 

	Most of the generations routines are located in wave.cpp. The most
important routine is "generate_sound". This is the function that does all
the generation according the a series of parameters contained in the
structure "s_wave_parameter" (definition in sndwaveg.h). 

>>>>> 5. Known Bugs and Unimplemented features >>>>>>>>>>

--- Bugs ---

- Wave cutting variation centering: When doing wave cutting effect in all
variation modes except "Stable", the cut might not be centered correctly
in the sample leaving wider space uncut.

- .Wav Export : Not sure if it is a bug, but the exported wav file sound
differently than the sample played in sound wave generator. It could be
related to stereo/mono stuff. Maybe the output can vary from a sound
playing software to another. There is also a little cut sound at the end
of the sound in .wav format. Not sure if it is normal. I also have
problem with chaotic sound export. The sound is ugly in the generator
but it sound great in .WAV. Generate the sample "shot.swg" and compare
the difference. In other words, the export to wav file might not be
perfect. 

- Double Sound : Not sure if it is a bug or if it is normal, but some
time, when making a envelope variation at high frequency and proportion,
you can hear like 2 different sound together (see cycle.swg): the original
sound and the modified sound. I am not sure if the generated wav should
actually play like this. 

--- Unimplemented Feature ---

- The random parameter selection to generate different sound without
bothering setting the parameters has not been implemented.

- Stereo sound is not implemented. Since I am generating the same wave for
both speaker ( there is no panning envelope ) I thought it was a bit
useless to implement it. 

- Chaotic Sound : I want it possible to produce chaotic sound like
explosions, fire, thunder, etc. I recently tried to analyse some wave form
and I created a series of new parameters in the waveform. I can now
produce some sound that are somewhat chaotic(explosion, gunshot) but there
is still a lot of them that I cannot to produce yet (fire, thunder). 

- Effect distribution : Some effect are repeated over the process of 1
second while some effect are distributed over the whole sample. In some
case you might want to set the effect globally while the program repeat
the process of each second. There is currently now way to influence this
choice.

>>>>> 6. Contact And Reference >>>>>>>>>>

	So this is it, new features will be added in order to increase the
range of sounds which can be produced. Being able to make most of all
sounds used in a video game is my primary objective. I will not introduce
features that could be done by another sound software. If you have some
ideas that could extend the possibilities of possible sounds generation,
you can always send the suggestion. 

	For suggestion, ideas, question or comments, you can
always e-mail me at the following Address :

ericp@ariel.bdeb.qc.ca

	You can also visit my Allegro web site where I placed my tutorial
Online book, all my source code or software related to allegro. You can
also find there a link for Pay Pal donations.

ariel.bdeb.qc.ca/~ericp/allegro

	Thank you and enjoy this wonderful tool! Yes, it is a wonderful
tool!(no arguing).


						Eric Pietrocupo
						The Shadow

