[Scummvm-devel] V2/3 music in scummvm.
Jochen Hoenicke
Hoenicke at Informatik.Uni-Oldenburg.DE
Thu Jun 19 11:44:09 CEST 2003
Hello ScummVM developers,
I would like to discuss how to get full V2/3 music support. The
current design, which involves IMuse, Player, MidiParser, has a flaw:
- AD music resources need to be converted to ADL resources, which involves
adding some header and some synthetic midi commands.
Look at readSoundResourceSmallHeader() and you know, why this is bad.
- AD sfx resource (which are not yet supported) need even more synthetic
midi commands. In fact they only consist of synthetic commands.
- The Roland resources in Loom are not standard midi scripts. The delay
is encoded differently than in normal midi scripts. If we want to
play them with MidiParser, we would need to parse and convert them
to midi.
- WA resource (PCjr/speaker support) don't look remotely similar to midi
and can't be converted to midi scripts as they are multi-threaded.
This is the main reason, why they are currently not played via IMuse.
As this is all related to parsing midi scripts (which MidiParser
does), I think it should be enough to add a new super class
"MusicParser" (or "IMuseParser") of MidiParser, which has a clean
interface containing a few public abstract virtual methods. From this
we can extent WAParser, ADParser, ROParser, and MidiParser. For
WAParser we would need a corresponding PCjr/speaker MidiDriver, which
Jamieson already requested :)
My question now is: should I start doing this? Jamieson: Do you
forsee any problem with this change? And where should the new classes
reside, in scumm or in sound? I probably need to change a bunch of
code for this, especially player has to be rewritten, to handle
v2/v3 music resources.
Jochen
PS: The public methods of MidiParser, which every parser would need
to implement, are:
loadMusic
unloadMusic
property
setMidiDriver
setTimerRate // for v2/3 always the same, I think.
setTempo // never called from outside
onTimer
setTrack // for v2/3 resources there is only one track.
jumpToTick // isn't needed for v2/3 resources and hard to implement
getTick // Is this what is written to VAR(VAR_MUSIC_TIMER)??
--
Jochen Hoenicke, University of Oldenburg, 26111 Oldenburg, Germany
Email: hoenicke at informatik.uni-oldenburg.de Tel: +49 441 798 3124
More information about the Scummvm-devel
mailing list