Opened 16 years ago

Closed 15 years ago

#1248 closed defect

SAM: some MIDI channels missing on MT-32

Reported by: SF/logicdeluxe Owned by:
Priority: low Component: Engine: SCUMM
Keywords: Cc:
Game: Sam and Max

Description

ScummVM 0.5.3cvs (Sep 26 2003 10:12:25)
I compared with the original interpreter and it sounds
quite complete to me there. ScummVM lefts out some
channels at certain situations. The channel mapping is
correct with the recent MT-32 patch, so they aren't
played on a unsupported channel either, as I can
confirm on my MU5 display. It probably has to do with
iMuse priority settings.
The problem is very noticable in the teaser before the
opening credits for instance.

Ticket imported from: #812998. Ticket imported from: bugs/1248.

Attachments (3)

samintro.ogg (235.5 KB ) - added by SF/logicdeluxe 16 years ago.
sam-midi.zip (68.0 KB ) - added by SF/logicdeluxe 16 years ago.
MT-32 vs. GM recorded from the original interpreter
vortex.zip (9.7 KB ) - added by SF/logicdeluxe 16 years ago.
Recording of entering and leaving the vortex.

Download all attachments as: .zip

Change History (22)

comment:1 by fingolfin, 16 years ago

Owner: set to SF/jamieson630

comment:2 by fingolfin, 16 years ago

What is the status of this item?

comment:3 by SF/jamieson630, 16 years ago

Status is "still trying to formulate a way to test theories given
that I don't have the hardware in question". :)

comment:4 by SF/jamieson630, 16 years ago

Priority: normallow

comment:5 by SF/jamieson630, 16 years ago

I can hear the issue in the opening cutscene. The problem is
(1) the music for that cutscene uses 14 non-percussion
channels, (2) only 2 of those channels have priority overrides,
and (3) the set of channels that could be considered "core
instruments" are scattered all over. (The third point makes it
hard to allocate channels based on, say, whether a part falls
in the Base MIDI or Extended MIDI range.)

Since there are 14 channels in use, the original distro MUST
be discarding some of them for the MT32, but probably only
the more background instruments. Is it possible for you to
record the output of the MT32 when running the original
distro? That way I can try to isolate which instruments it's
discarding, and from there determine how they made their
selection.

I'm lowering priority, in the meantime. This doesn't seem to
affect a lot of the game, since more tracks appear to stay
within the 8-channel limit of the MT-32.

comment:6 by SF/logicdeluxe, 16 years ago

I would record the original output, but I don't have a
sequencer in order to do that. Is there a kind of sequencer
I just could add to the Windows MIDI mapper? With that I
could run the game in DOSBox and record its MIDI output. I
searched the internet for such a tool but I didn't found
such a thing yet. I'll keep trying. And I'll post the
results here as soon as I find a way.

comment:7 by SF/jamieson630, 16 years ago

I mean the audio output. I want to hear exactly what you're
hearing when you drive the MT-32 from the original Sam &
Max distro.

comment:8 by SF/logicdeluxe, 16 years ago

I recorded it running in DOSBox. (Just installed the floppy
version which was the last real mode incarnation of SCUMM
afaik.) It runs a bit slow there, hence some passages in the
music last slightly longer than usual. I hope the sample is
long enough for you.

by SF/logicdeluxe, 16 years ago

Attachment: samintro.ogg added

by SF/logicdeluxe, 16 years ago

Attachment: sam-midi.zip added

MT-32 vs. GM recorded from the original interpreter

comment:9 by SF/logicdeluxe, 16 years ago

So I finaly managed to record the MIDI output from the game.
I made files including the entire intro from the
initializing of the game up to the point you get control
over Sam. So you can easily load them in a MIDI editor and
compare every single event.
Don't take the timing too serious! The ticks are just
counted in emulated VGA retraces of DOSBox, which is 60 Hz,
I guess. ;-)
I hope those MIDI files are of any help for you.

comment:10 by SF/jamieson630, 16 years ago

Whoa, this is good stuff! Your DosBox mod looks quite useful.
It'll take me a while to figure out this problem with it, but I
already noticed something unrelated. I saw the pitch bend
range setup you mentioned, in the init sequence. So they set
everything up to +/- 16 half-steps, and they do it in the
Patch non-temp area. And they do it for all 128 patchs --
yikes!

So I'm interested in seeing how the original distro handles
changes to the pitch bend range mid-game. This happens for
the music outside the Mystery Vortex -- an override of +/- 12
half-steps is applied to the channel doing the eerie sliding
flute sound.

Marek: Do you think you could generate one of these cool
DosBox MIDI dumps for that music? Basically start capturing
from the USA map and stop a few seconds into the Mystery
Vortex music. The pitch bend override is one of the first
events of the track.

That dump may very well tell us what type of SysEx call we
should be making in ScummVM.

by SF/logicdeluxe, 16 years ago

Attachment: vortex.zip added

Recording of entering and leaving the vortex.

comment:11 by SF/logicdeluxe, 16 years ago

> So I'm interested in seeing how the original distro
handles changes to the pitch bend range mid-game.

It doesn't. At least not on the hardware side. All MIDI
games since Monkey2 did setup the hardware to do +-16 half
steps (as you can see in the MIDI files). iMuse must convert
them internally, similar to the way ScummVM currently does
with MT-32 output. ;-)
V6 games use the same approach with GM, exept that the
pitchbend setup is done per channel instead of per patch,
but also there the setup is never changed during the game.
Funny, just as I'm thinking about it, I can't remember ever
hearing a pitchbend in MonkeyEGA/VGA and LoomEGA as threre
is no such initialization. Maybe Michael Land didn't had a
pitch bend wheel back then?
I'll check the Vortex. If this is a problem, we have to
implement the whole thing in ScummVM and convert pitchbends
to +-16 like the original does it.
MIDI dumps for MT-32 and GM uploaded. I traveled from the
map to the vortex and after a few seconds back to the map
and then quit the game. (The silence at the beginning is the
time for copy protection screen and loading of the savegame.)

BTW., will I be added to the credits as MIDI tester and
contributor?

comment:12 by SF/logicdeluxe, 16 years ago

Now I tested the Vortex with current ScummVM:
There is no pitch bend problem with the way it is currently
implemented. My MT-32 plays the Vortex just fine.
If there is a pitch bend of more than +-12 half steps
anywhere in any game, then it would be a problem with the
currently implemented MT-32 code, but I am not aware of such
a cue so far. If I find one, I will post this.

comment:13 by SF/jamieson630, 16 years ago

Well, yeah, we patched ScummVM to do internal pitchbend
scaling and send out pitch bend values that assume the MT-
32 resets itself to a pitchbend range of +/- 12 half steps.

Looking at the GM init sequence for S&M, I see that the
original distro also set up GM devices for +/- 16 half steps,
which means it must have just done internal scaling of
pitchbend values for EVERYTHING. I suppose ScummVM
should take the same approach, then.

BTW, you are correct -- I think MI2 is the earliest game
where I can remember hearing pitch bends. That may be
because of the large number of messages required to conduct
a smooth-sounding pitch bend. Earlier machines might not
have been able to process a high frequency of events without
lagging.

> BTW., will I be added to the credits as MIDI tester and
contributor?

That's not my call to make. We really do appreciate your
many contributions to the project; however, keep in mind
that there are many such people who make frequent
contributions, and we cannot list them all by name. I hope
recognition is not the primary motivation for your
contributions; remember that this is an OSS project, and
getting billed in the credits doesn't really amount to much.

If it makes you feel better, know that I jump for joy every
time I see a new bug report from you in my Inbox. ;)

comment:14 by SF/logicdeluxe, 16 years ago

Since there is a bug in several wide spreaded Dream chipsets
which prevent pitch bend depth setups of more then +/- 12
half steps from working correctly, it would be a good idea
to not implement it EXACTLY the way LEC did. If there really
is no cue using more than +/- 12, and I guess so, there is
really no good reason not using 12 instead of 16. This would
remain the MT-32 pitchbend setup unnessecary, it is kind to
those bugged wavetables, and still would perfectly work with
all other GM compilant devices.
We could add a warning whenever a pitch bend depth is set to
more than that. Let's see if this ever occours! So far the
deepest I found is 12 at SAM's Vortex, DOTT's LEC-Logo and
the crashing bird in the intro right after that.
If there is a pitch bend depth of more than +/- 12 after
all, I would prefer not to change the current behavior,
since it even works very well with those bugged wavetable
chips, which is not the case with the original interpreters.
After all, ScummVM is always proud to do things better,
isn't it?

comment:15 by fingolfin, 16 years ago

What is the status of this item?

comment:16 by fingolfin, 15 years ago

Yo folks, could somebody tell me the status of this item? In particular, is
the original issue (some channels being left out) still there?

The pitchbend stuff sounds very interesting, but maybe it should be in a
separate tracker item?

comment:17 by sev-, 15 years ago

What is the status of this item?

comment:18 by fingolfin, 15 years ago

Owner: SF/jamieson630 removed
Status: newclosed

comment:19 by fingolfin, 15 years ago

Setting to pending, and unassigning from Jamieson (as he isn't really
working on ScummVM anymore, unfortunately :-/)

Note: See TracTickets for help on using tickets.