VOGONS


First post, by sndwv

User metadata
Rank Member
Rank
Member

If I compare Phil's excellent recording of Gateway 2: Homeworld on actual hardware:

https://www.youtube.com/watch?v=yHocdA542UI

to my attached recording on my actual MT-32 (old type), but via DOSBox, it seems mine is playing a bit too slow, most noticeable on the timpani rolls. Phil's recording sounds 'right' to me, and is how I remember it from childhood.

I know cycle settings among others have an effect on this, but as of yet I have not been able to get it 'right' (just this, or completely broken). Does anyone know what's going on here?

Filename
gw2.wma
File size
1.02 MiB
Downloads
40 downloads
File comment
Gateway 2 intro, MT-32 old, DOSBox SVN r3950
File license
Fair use/fair dealing exception

PS - Eric the Unready (same engine) seems 'off' to me in the same way, but I have no actual hardware recording to compare with, just one video I found that sounds exactly the same as mine, but could very well have been recorded on DOSBox as well.

Last edited by sndwv on 2016-01-01, 18:39. Edited 1 time in total.

Reply 1 of 35, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The Legend adventures use the MPU-401 Conductor, so if you're compiling SVN you might try reducing the MPU401_TIMECONSTANT define in mpu401.cpp to see if that makes the music speed more like what you think it should be.

Reply 2 of 35, by sndwv

User metadata
Rank Member
Rank
Member

That would be my first time compiling from SVN (or anything at all), but I would not mind looking in to this in the weekend. 😀 Would that mean all games using the conductor would be slightly off, and is there even an objectively 'correct' speed? I assume the current value wasn't picked arbitrarily? Or does it vary depending on host system?

Reply 3 of 35, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I don't think the timing was chosen by ear, it's based on beats-per-minute and tempo commands to the MPU. I doubt the time constant is wrong; changing it is just an easy way to check if the music speed is related to the conductor timing.

Reply 4 of 35, by sndwv

User metadata
Rank Member
Rank
Member

Allrighty, found a seemingly good tutorial for compiling on Windows; I'll have a go at it later today or tomorrow and report back.

I found the line:

#define MPU401_TIMECONSTANT (60000000/1000.0f)

What should I change it to to make a sensible but audible difference? 10% faster or so?

Reply 5 of 35, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I checked and the game is indeed using the MPU Conductor. It sets 123 BPM for the intro song, and overriding that to ~135 BPM seem to be more like the speed in phil's video. However, I don't know why there would be a discrepancy. Maybe check if the music speed in the first Gateway game seems correct to you.

Reply 6 of 35, by sndwv

User metadata
Rank Member
Rank
Member

Thanks. Just did, this is Phil's recording:

https://www.youtube.com/watch?v=c3NhTcpWcf4

and here is mine:

Filename
gw.wma
File size
1.49 MiB
Downloads
34 downloads
File comment
Gateway 1, MT-32 (old), DOSBox SVN r3950
File license
Fair use/fair dealing exception

The difference is less audible here, but Phil's music starts ~6s into the video, and when I stopped my recording at 2:08 they were almost synched up. That means my recording is ~5% slower than Phil's.

edit: and this is the Eric the Unready sample I found: https://www.youtube.com/watch?v=7NIx7Z9Y5vc (sounds the same here). No comparison available for this one, but it sounds off to my ear, does not 'flow' correctly. Same engine, so safe to assume the same issue.

Reply 7 of 35, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The HOME_001.MUS file is a library of song files that can be extracted using a ripping tool that understands standard MIDI format. I found that the 21st song file is the game's MT-32 intro music, and playing that in a Windows MIDI player shows 123 BPM, so the game does not seem to be using that in error, and the music does indeed play a bit faster than in DOSBox.

Srecko might have an idea where to start looking for a Conductor timing issue, but haven't seen him around for awhile. I guess I'll fiddle with the timebase and interrupt delay stuff to see if anything looks promising.

Reply 8 of 35, by sndwv

User metadata
Rank Member
Rank
Member

Great, thanks for taking a look. If there's anything I can do to help, let me know.

By the way: which tool is that? Would like to take a look at that, out of curiosity. I assume it's not allowed to attach the MIDI file?

Reply 10 of 35, by sndwv

User metadata
Rank Member
Rank
Member

Awesome. For completeness sake I've attached recordings of the extracted .MIDs, played using GSPLAY in the exact same DOSBox environment the games were run in. GSPLAY plays them back at their correct (faster) speeds, same for Eric the Unready, which I can confirm has the same issue of being too slow when played by the game engine.

gsplay.png
Filename
gsplay.png
File size
63.25 KiB
Views
1401 views
File license
Fair use/fair dealing exception

Attachments

  • Filename
    eric.wma
    File size
    1.43 MiB
    Downloads
    37 downloads
    File license
    Fair use/fair dealing exception
  • Filename
    gw2.wma
    File size
    1.39 MiB
    Downloads
    37 downloads
    File license
    Fair use/fair dealing exception
  • Filename
    gw.wma
    File size
    1.44 MiB
    Downloads
    30 downloads
    File license
    Fair use/fair dealing exception

Reply 12 of 35, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

After some analysis of the Legend MPU playing code, I made a workaround program that corrects the tempo issue in my tests. Gateway has an additional but apparently related issue where it doesn't play more musical selections after the first one during the game, and as a bonus this new workaround does an even better job of fixing that issue than the previous one I made.

I've tested the attached TSR program with Gateway, Gateway 2, and Eric the Unready with ~10000 cycles in DOSBox SVN, and the MT-32 music tempo sounds right to me. I recommend a vanilla SVN build because the workaround may be less effective elsewhere.

The issue appears to be a somewhat complicated interaction between IRQ 9 and IRQ 0, so may be in the MPU and/or PIC emulations, but I have not yet identified the specific problem.

Attachments

  • Filename
    legmpu.zip
    File size
    274 Bytes
    Downloads
    61 downloads
    File comment
    Password: vogons
    File license
    Fair use/fair dealing exception

Reply 13 of 35, by sndwv

User metadata
Rank Member
Rank
Member

Fantastic! Tried it with SVN r4000 at 20000 cycles (happens to be what I set it to last) and it sounded perfectly fine/correct to me.

Great workaround for now; I can finally play these games again, but if there's any further testing to be done for a DOSBox fix I can help out with, let me know!

Reply 14 of 35, by keropi

User metadata
Rank l33t++
Rank
l33t++

ripsaw8080 is that fix also applicable to real hardware? Gateway stops playing in-game scores after the first one on real hardware if there is some IRQ sharing business (in lack of better description) - in my case I had to disable ACPI to fix that issue (since apparently ACPI is hardwired to IRQ9). The game's driver is really picky and sensitive I never really knew I had this issue until someone mentioned it here and tested on my p1/MPU401AT system.

btw stupid chrome detects your fix as malicious , total annoying BS from chrome

🎵Link to buy a PCMIDI mpu
🎧Orpheus soundcard project
💻WTB Amstrad PC7486SLC-33 system

Reply 15 of 35, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

hmm if chrome does that, than maybe zip it with password or so.
Otherwise vogons will get flagged for hosting malware.

Water flows down the stream
How to ask questions the smart way!

Reply 16 of 35, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

False positives happen, I guess. Reposted the attachment with a password; I hope it's enough to shut out Chrome's scanning.

@keropi: The workaround is hardcoded for an MPU using IRQ 9, but it's unlikely to be useful in your case. It might help with SoftMPU, which uses the DOSBox MPU emulation.

Reply 17 of 35, by KainXVIII

User metadata
Rank Member
Rank
Member

Yeah, i also noticed that tempo is really off with dosbox and munt (TSR program fixed that)
Too bad that digitized sound effects crackles so much in old legend games..(ie Companions of Xanth)

Reply 18 of 35, by keropi

User metadata
Rank l33t++
Rank
l33t++

@ripsaw8080
I see, thanks for the explanation. New zip is fine, chrome does not complain 😀

🎵Link to buy a PCMIDI mpu
🎧Orpheus soundcard project
💻WTB Amstrad PC7486SLC-33 system