Debian Codegraph @

audio/README

raw
1 Audio and MIDI information
2 --------------------------
3
4 The mixer has recently been replaced by using SDL_mixer. This will allow easier
5 porting to other platforms and removes the need to maintain the complex mixer
6 code. The addition of the SDL_mixer was mainly done so that we could easily
7 support OGG/MP3 music, referred to as "Digital Music" in Exult.
8
9 All Digital SFX and Digital music currently play at 22Khz. This sample rate
10 is high enough for the SFX and digital music as they rarely go above 11Khz,
11 plus SDL_mixer/SDL currently works better at 22khz than 44khz.
12
13 SDL_mixer has the ability to play MIDI music directly through MIDI ports
14 or by using Timidity. The MIDI support in Exult does not currently make use of
15 SDL_mixer but uses tailor made midi drivers in the midi_drivers directory. A
16 generic SDL_mixer interface is available in the midi_drivers directory called
17 mixer_midiout.
18
19 To make use of this mixer_midiout simply use the following in Midi.cc (in the
20 relevant sections):
21 -----------------------------------------
22 #ifdef _WIN32
23 #include "midi_drivers/mixer_midiout.h"
24 #endif
25 -----------------------------------------
26 #ifdef _WIN32
27 TRY_MIDI_DRIVER(Mixer_MidiOut)
28 #endif
29 -----------------------------------------
30
31
32 Sound Effects
33 -------------
34 Sound effects were originally played through MIDI but now that the SFX
35 digital sound packs (jmsfx & sqsfx) are available this has been disabled
36 and will not be developed in future. MIDI now only plays the music.
37 Sound effects are loaded when required from the flx files, each time they
38 are played, but the last 6, or so, played are cached in memory to save disk
39 I/O and conversion processing.
40
41
42 MIDI Music
43 ----------
44 Exult music can be played through MIDI using either MIDI ports or
45 Timidity. Conversion is usually applied to the MIDI music using the XMIDI
46 code to convert from the Roland MT-32 voice assignments to General Midi
47 (GM). It is still possible to play directly to a Roland MT-32 by selecting
48 the "none" midi conversion setting.
49
50 Timidity support works on Linux and should work on Windows. To use it in
51 Linux the timidity.cfg file must be in the directory where the exult
52 executable is run. This appears to be a quirk with SDL_mixer.
53
54 Linux MIDI out currently uses playmidi or KMIDI.
55
56
57 Digital Music
58 -------------
59 Digital Music using OGG is now available in Exult. This uses the Digital
60 Music pack recorded by Simon Quinn on the Roland MT-32, available on the
61 Exult sourceforge site. This should work on any platform that supports
62 SDL_mixer and will give the closest musical experience to the original
63 Ultima VII games.
64
65 Additionally, with the Digital Music support, a number of atmospheric
66 SFX tracks are played when no music is playing. The tracks played are
67 as follows:
68 * Day time outside: wind, bird and frog track
69 * Night time: wind track with randomly generated digital sfx crickets
70 * Dungeon: dungeon music track (atmospheric SFX and music)
71 Music tracks always take priority over these SFX tracks and being "music"
72 tracks they will not play if the music has been switched off.
73
74 These SFX "music" tracks are not available with the MIDI support as they
75 play Roland MT-32 specific voices that cannot be mapped to GM.
76
77 NOTE: OGG was chosen over MP3 as SDL_mixer has better support for OGG and
78 has OGG supported compiled into the drivers by default, from v1.2.4.
79
80
81 Voice/VOC support
82 -----------------
83 The VOC decoding is partially customised to Exult and the U7 data files.
84 Samples are converted to 22Khz (or to match the audio output sample rate)
85 and expanded to two channels, and some bytes are cut off each end to
86 eliminate harsh clicking.
87
88 Sample rate conversion has been left in the VOC decoder as currently,
89 v1.2.4 of SDL, does not have good sample rate conversion.
90
91 The code currently uses a lot of memory as the whole VOC to be played is
92 loaded and converted in RAM, potentially using many megabytes of memory.