Opened 14 years ago

Closed 14 years ago

Last modified 17 months ago

#8546 closed patch

SCUMM Adlib SFX guesswork (Indy 3, MonkeyVGA, ...)

Reported by: eriktorbjorn Owned by: eriktorbjorn
Priority: normal Component: Engine: SCUMM
Keywords: Cc:
Game:

Description

Currently, some of the Adlib sound effects for older SCUMM games like Indy 3 and the floppy version of Monkey Island 1 sound pretty strange. Perhaps most noticeably, the effects for opening and closing doors. I don't know exactly how this is supposed to work, but I've looked a bit at it and made some guesses that I'd like to hear what others have to say about.

First of all, the Adlib sound effects are handled by ScummEngine::convertADResource() where, apparently, we convert the resource to the data layout used by newer SCUMM games. One of the steps of this is to convert some sort of frequency number ('freq') to a note value ('note'). We can see that in most cases 'freq' will be a fairly low number, but in some cases it will be a very high number. Let's assume that these high numbers represent the wrong sound effects.

Looking at http://www.gamedev.net/reference/articles/article446.asp we can see that in Adlib, the note is specified by two values: A 10-bit "F-number", and a 3-bit octave value. This seems to correspond fairly closely to what we do in our code. We can probably assume the standard 12-tone scale, so adding/subtracting 12 would move the note one octave, and if 'freq' has anything to do with frequencies then doubling/halving it would move it one octave.

So if I understand it correctly, we currently do this to adjust 'freq' to the octave:

freq <<= ((current_instr[ch][1] >> 2) & 7) + 1;

So we add one to the three-bit octave field. Suppose that the value is supposed to wrap around to 0 after 7. In that case, it should instead be something like this:

freq <<= (((current_instr[ch][1] >> 2) + 1) & 7);

I've tried this, and it makes the door sound a lot more reasonable to me. The good thing about it is that for most cases, this change should make no difference whatsoever. But I don't know for sure if it's right or wrong.

Ticket imported from: #1508018. Ticket imported from: patches/651.

Attachments (1)

adlib-sfx.diff (458 bytes ) - added by eriktorbjorn 14 years ago.
Patch against current SVN

Download all attachments as: .zip

Change History (6)

by eriktorbjorn, 14 years ago

Attachment: adlib-sfx.diff added

Patch against current SVN

comment:1 by eriktorbjorn, 14 years ago

There's some discussion about these sound effects at http://vogons.zetafleet.com/viewtopic.php?t=8644 including recordings from ScummVM, DOSbox and the real thing.

Seems like we only play half of the "click-click" opening sound effect, and the patch does nothing to fix that. Might be some looping information that we're missing, I guess. The "click-clunk" closing sound effect seems pretty close to the real thing with the patch, though.

comment:2 by eriktorbjorn, 14 years ago

On a similar note, in Indy 3, if I trick the students into leaving, Indy's secretary (is that what she is?) can be seen typing on her typewriter, but there are only occasional "clack" noises from it. Perhaps there's some missing loop here, too?

comment:3 by eriktorbjorn, 14 years ago

Owner: set to eriktorbjorn
Status: newclosed

comment:4 by eriktorbjorn, 14 years ago

I've applied the patch, and added the repeat issue to the TODO on our Wiki.

comment:5 by digitall, 17 months ago

Component: Engine: SCUMM
Note: See TracTickets for help on using tickets.