MIDI music player
One of the early goals I set for
myself when I began to start game programming
was the inclusion of sound in my games. Despite
the addition of CD audio and crisp VOC sound,
a major factor that detracted from the enjoyment
of the games I made was the lack of music. The
effect it has, when introdued, is quite bizaare:
even the simplest MIDI track, if paced correctly,
can add excitement to many games of skill or reflexes,
and a more subtle loop can be used for more cogitative
games (Trooper II is of course both, and so requires
a variety...). I eventually managed to find a
unit that would allow me to do just this, and
in turn I present it to you. This simple unit
loads files in the XMS format, which is
very similar to MIDI, and plays them through the
soundcard in the background whilst your program
is running. The music files reside in the conventional
memory when loaded, but this has minimal impact
upon your program since they are so small (<10Kb)
very little reduction in the free memory occurs;
and the processing required to play the music
seems to be very small, as no slowdown in perceptible
even with the heaviest load on the processor.
The music files themselves are fairly hard to
obtain, but I've collected together an archive
of more than 30 from various sources, in different
styles to suit any type of game. Be warned though,
MIDI music by nature is somewhat repetitive and
often a little shrill, so appropriate use of the
music will be required to achieve effective results.
Nevertheless, addition of music to any Pascal
program is easily achieved with this small unit,
and requires only a negligable amount of space
in the finished package. Music can be loaded in
and out the allocated memory quickly and at will,
and paused and restarted whenever necessary. It
certainly adds an edge to playing Trooper II,
and a rhythm to games that otherwise might lack
it. The unit comes with a simple demonstration
of how to initialise a music track, and a few
sample tunes: the archive of XMS music
contains further songs to supliment your collection,
christened amusing names such as 'lightening'
by their well meaning creator. One of the simplest
ways to add music to any of your programs. Enjoy,
Jon
Download
the XMS music unit (11 Kb, zipped) | Back
to Units & Tools
Download
the XMS tune archive (35 Kb, zipped)