lfnetwork.com mark read register faq members calendar

Thread: Creating a MIDI SOUN resource for SCUMM V5
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 07-27-2010, 05:38 PM   #1
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
Creating a MIDI SOUN resource for SCUMM V5

I'm trying to create a new SOUN resource with the ROL signature. I wrote a tool which creates the expected header for a MIDI file. The problem I encounter with MIDI files other than those extracted with Scumm Revisited is, ScummVM plays them like expected, but the native SCUMM exe does not. There is just nothing on the MIDI port at all.

I'm not even trying to do neat iMuse tricks or such. Just playing a single track/multi channel MIDI with startSound()

If you like to try for yourself, here is the tool: mid2rol.exe
It takes one parameter, which is the name of a single-track-MIDI-file. The output file is named 000_ROL.dmp and it is always mode 2, like all SCUMM MIDI files.
LogicDeLuxe is offline   you may: quote & reply,
Old 07-29-2010, 04:00 AM   #2
jestar_jokin
Rookie
 
Join Date: Sep 2004
Posts: 39
If you extract a song from the game (e.g. 000_ROL.dmp), and strip out the non-MIDI data (the ROL header data) using e.g. a hex editor, then use your mid2rol tool, does the resulting file work in a native SCUMM exe?

Maybe the format of the MIDI files is a different version of the file format than whatever the original SCUMM interpreter supports. I assume ScummVM's MIDI handling would be more forgiving/up to date. Just guessing, though.
jestar_jokin is offline   you may: quote & reply,
Old 07-29-2010, 09:37 AM   #3
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
Well, I figured out a few things. Two requirements are very strict for native SCUMM (but not required by ScummVM):
- The iMuse SysEx f0 7d 00... is used to allocate channels (well documented in the ScummVM source), and is mandatory.
- While MIDI specs allow multiple parameter sets after a single event code, SCUMM requires the event code to be repeated before each parameter set.

Furthermore (also thanks to well documented ScummVM source):
- iMuse SysEx f0 7d 30... can be used for looping.
- The time division parameter seems to be ignored. Apparently, native SCUMM is hardcoded to always use 01 e0 for this, just like ScummVM does. Thus I had to modify the tempo to match this value.

I also tried to add General MIDI support, but my SoundCanvas doesn't receive any program change events. I guess, this is done with the MT-32 specific SysEx.

Quote:
Originally Posted by jestar_jokin View Post
If you extract a song from the game (e.g. 000_ROL.dmp), and strip out the non-MIDI data (the ROL header data) using e.g. a hex editor, then use your mid2rol tool, does the resulting file work in a native SCUMM exe?
It does, it produces a bit identical copy after all.
Btw, Scumm Revisited has a save .mid button, which automatically strips the ROL header. No need to hex edit it out.
LogicDeLuxe is offline   you may: quote & reply,
Old 07-29-2010, 11:47 PM   #4
jestar_jokin
Rookie
 
Join Date: Sep 2004
Posts: 39
I don't know any more off-hand, all I can suggest is checking out the ScummC documentation on iMUSE, since it lists some of the SysEx commands used in SCUMM V6. Unfortunately, the ScummC site seems to be down, the best link I can provide is the one below, which may not have the latest info:

http://web.archive.org/web/20080629231810/http://alban.dotsec.net/15.html#A6


(As an aside, would you mind adding your discoveries to the ScummVM wiki? That way other people can build on your work, and there's less chance of the info disappearing like the ScummC pages.
http://wiki.scummvm.org/index.php/SC...ical_Reference
I'd suggest putting it either in the "Sound Resources" page, or creating a new one for iMUSE stuff)
jestar_jokin is offline   you may: quote & reply,
Old 07-30-2010, 02:53 PM   #5
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
I managed to add General MIDI support to V5! I just took the GMIDI.IMS from the Sam & Max WIP demo. Thanks to the redundancy of ROLAND.IMS and ROL_330.IMS, I don't even have to sacrifice anything. I hex edited the exe to refer GMIDI.IMS instead of ROLAND.IMS, and it works flawless on my SoundCanvas.
So adding General MIDI support to V5 games is very possible.
LogicDeLuxe is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Mixnmojo.com > Community Discussion Forums > SCUMM > Creating a MIDI SOUN resource for SCUMM V5

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:20 AM.


LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.