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