Introduction
Sound brings a new dimension to the presentation of a model railway thanks to the recorded comments which allow you to explain to the guests every operation and also use sounds associated to the machines which improve the realism of the presentation.
There is a solution which consists of incorporating sound effect generators on locos but it presents at least 3 major inconveniences:
-The size of the circuits not always easy to install in a loco
-The synthetic sounds which lack realism
-The sound quality which is generally very bad because of the small size of loudspeakers installed in machines.
A solution which is much better when the network is piloted by computer consists of using recorded sounds on the PC and reproduced in synchronization with the movement of locos. These sounds can be reproduced by loudspeakers hidden under the layout. It is thus possible to use sounds of real locos.
Two loudspeakers are generally enough to reproduce the train sounds thanks to the stereo effect . Sometimes according to the typology of the network, it is necessary to arrange several groups of 2 loudspeakers to accompany various routes made by trains. The selection of the group of loudspeakers is made by the PC according to the chosen route.
Structure of a sound sequence
Every route made by a train is accompanied by a sequence of sounds. For example one will suppose that the train moves from the left towards the right-hand side and that route duration is 30 seconds. The sound sequence is then constituted as follows:
-The comment describing operation is produced by a feminine synthetic voice (LEFT loudspeaker, 10 seconds)
-The starting up of the engine (LEFT loudspeaker, 10 seconds)
-The whistle of the stationmaster announcing departure (LEFT loudspeaker, 2 seconds)
-The starting up of the loco (LEFT loudspeaker, 5 seconds)
-Sound accompanying the route from the point of departure to the place of destination (progressive passage of the sound between the LEFT loudspeaker and the RIGHT loudspeaker, duration 20 seconds)
-The arrival of the loco (RIGHT loudspeaker, duration 5 seconds)
The use of train passage detectors can improve synchronization, but it is not absolutely necessary.
Sound processing
I use the following software packages
-the tape recorder of Windows to record comments, to cut sequences and to convert between various sound PCM formats.
-The freeware AUDACITYwhich allows you to process separately the right and left tracks .
-The freeware 4mp3 for the conversion in wav files of mp3 files that one finds usually on Internet.
-The freeware SpeechMillfor the speech synthesis. The result is rather impressive.
Restoration of sounds by the PC in simultaneous with the movement of trains
The network that I created is piloted by a PC which commands by way of the parallel interface the movements of rolling stocks, the switches and the signals.
To pilot power supply and switches, the Microsoft QBASIC program is ideal and is widely used. Programming is very simple (to pilot an element, it is enough to type for example the instruction OUT 888,32 where 888 is the address of the PC parallel port and 32 is the address of the output which defines the command to be made).
Regrettably, QBASIC which works under DOS does not handle sounds and it was necessary to find another QBasic's adequate, most close possible software package to be able to reuse the former programs.
My choice went on two software packages: Rapid-Q and Visual BASIC
Rapid-Q
Rapid-Q is an object programming language under Windows (with a graphic Windows interface) which administers perfectly wav sounds. Compatibility with QBASIC is rather good, although not immediate. Furthermore, it is free that is interesting. Programs can be compiled to produce files.EXE that one can execute on any PC, even though it has not the Rapid-Q program installed.
This program can be downloaded on the site:
http://telecharger.01net.com/windows/Programmation/langage/fiches/3537.html
One can find a complete documentation on Rapid-Q as well as examples of programs on the site:
http://www.basicguru.com/rapidq/about.html
Regrettably, the memory capacity for the stocking of sounds associated to a program is limited. When the number of sounds becomes too great, the program crashes. There is maybe a solution to this problem, but I did not find it. That is why, I use VisualBasic now.
VisualBasic
With VisualBasic from Microsoft, one can make everything (or almost). Sounds associated to the program can have any format (wav, mp3 ) and there is no memory limitation . However the software is expensive and not very easy to use. Furthermore, specific DLL to command the parallel port and the restoration of sounds is needed. Fortunately, they are found easily on the net. Compatibility with QBASIC is rather good
Here are the addresses of some sites on VisualBasic (there are dozens of it):
The reference site
A good tutorial
Programming the parallel port in Visual Basic
A documentation on the SndPlaySound function which allows the restoration of sounds in Visual BASIC and the associated DLL winmm.dll
However, to begin, I recommend to use Rapid-Q, leave buying VisualBasic till later.