• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..27-Nov-2021-

midi_drivers/H27-Nov-2021-17,36012,095

Audio.ccH A D27-Nov-202118.3 KiB858638

Audio.hH A D27-Nov-20216.5 KiB192129

AudioChannel.ccH A D27-Nov-202117.9 KiB736493

AudioChannel.hH A D27-Nov-20215.4 KiB213145

AudioMixer.ccH A D27-Nov-20219.6 KiB363269

AudioMixer.hH A D27-Nov-20212.6 KiB9754

AudioSample.ccH A D27-Nov-20211.6 KiB5430

AudioSample.hH A D27-Nov-20212.4 KiB8852

Makefile.amH A D27-Nov-2021893 4236

Midi.ccH A D27-Nov-202122.6 KiB884622

Midi.hH A D27-Nov-20213.3 KiB11571

OggAudioSample.ccH A D27-Nov-20214.3 KiB173123

OggAudioSample.hH A D27-Nov-20211.9 KiB6733

READMEH A D27-Nov-20213.8 KiB9373

RawAudioSample.ccH A D27-Nov-20213.5 KiB12889

RawAudioSample.hH A D27-Nov-20211.3 KiB5022

VocAudioSample.ccH A D27-Nov-20217.8 KiB350261

VocAudioSample.hH A D27-Nov-20211.8 KiB6636

WavAudioSample.ccH A D27-Nov-20213.7 KiB172104

WavAudioSample.hH A D27-Nov-20211 KiB4014

conv.ccH A D27-Nov-20214.5 KiB218193

conv.hH A D27-Nov-2021877 265

convmusic.hH A D27-Nov-20212.1 KiB9473

module.mkH A D27-Nov-2021397 154

mtestH A D27-Nov-2021214 21

soundtest.ccH A D27-Nov-20214.8 KiB216168

soundtest.hH A D27-Nov-2021921 3313

README

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