Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Hardware MIDI

Jaesun

Fabulous Ex-Moderator
Patron
Joined
May 14, 2004
Messages
37,241
Location
Seattle, WA USA
MCA
I'm hoping to do some recordings with an ACTUAL Roland Sound Canvas (of which this MIDI score was designed for).

Just curious if any of the MIDI files have actual Reverb and Chorus SYSEX settings in them. Still need to browse those extracted MIDI files from the other thread.

Would be interesting to compare it to the recording above.
 

mwnn85

Savant
Joined
Aug 14, 2017
Messages
210
I'm hoping to do some recordings with an ACTUAL Roland Sound Canvas (of which this MIDI score was designed for).
I'm using Sound Canvas VA - ridiculous price - at least to just get better sounding DOSBOX music.
Well unless you know where to find it of course.

You get four different models you can switch between: SC-55, SC-88, SC-88 Pro, SC-8820
I can't stop listening to various Monkey Island, System Shock and Doom tracks.

Made a few recordings using the extracted MID files.

Default settings - SC-8820
SLEEP
https://instaud.io/1aVc
BATTLE
https://instaud.io/1aVe
ENIGMA
https://instaud.io/1aVi
SYSTEM SHOCK INTRO
https://instaud.io/1aVl (SC-8820) https://instaud.io/1aVp (SC-55)

If Cleve would make game use the default midi device instead of Wavetable you'd get the choice of soundbanks, MUNT or this setup.
Coolsoft MIDI Wrapper can set the default MIDI device in newer Windows editions.
LoopMidi and SaviHost do the rest.
 

Jaesun

Fabulous Ex-Moderator
Patron
Joined
May 14, 2004
Messages
37,241
Location
Seattle, WA USA
MCA
Curious mwnn85 have you looked at the actual MIDI files at all when you were playing them? Just curious if there are SYSEX Reverb and Chorus commands present in them.
 

mwnn85

Savant
Joined
Aug 14, 2017
Messages
210
Curious mwnn85 have you looked at the actual MIDI files at all when you were playing them? Just curious if there are SYSEX Reverb and Chorus commands present in them.
The reverb and chorus and pan numbers are changing on the display depending on the track played - so I'm guessing yes.
http://i.imgur.com/Dg505XY.jpg


If I knew what to look for in a MIDI editor - like this one - I could give a more definitive answer.
 

Jaesun

Fabulous Ex-Moderator
Patron
Joined
May 14, 2004
Messages
37,241
Location
Seattle, WA USA
MCA
I use SONAR and I will just load up the songs in that. I can then see the entire MIDI track and any SYSEX commands. Just won't have time until later today.

That certainly does look like there ARE Chorus and Reverb settings, which is perfect. These "events" are Control Change commands, that have a value sent to the MIDI device. They control things like volume of instrument, reverb level, chorus, or when to select a new instrument etc...

Sadly those just using Windows for the MIDI, there is NO Reverb or Chorus effects available (just the sounds/instruments).
 

mwnn85

Savant
Joined
Aug 14, 2017
Messages
210
That does look to be exactly the behaviour of the Sound Canvas device.

When playing the track all the separate instruments are set with their own independent reverb, chorus, volume levels, etc.

If I reset the device mid way through a track the sound is all wrong until the track is restarted/reopened.


MIDI seems quite clever for it's day. Lots of electronic samples of different instruments, 16+ instruments playing at once, all combined into a sound sheet - orchestra in a box essentially.

Terrible music format for the end user though mainly down to the large differences in hardware.

For those early DOS games it was PC Speaker, ADLIB or Soundblaster back in the day and in retrospect what utter crap that was; once you hear the Roland devices you can't go back.

My old AMIGA 500+ used to look & sound great though probably better than the first PC running Windows 3.1 which replaced it.

Thank god for Redbook/CD audio and now common formats mp3, aac, flac etc.

I suppose if Cleve wanted he just include the games music tracks (flac, aac) recorded on a top end Roland device then everyone benefits and doesn't need the hardware/software.
 

Jaesun

Fabulous Ex-Moderator
Patron
Joined
May 14, 2004
Messages
37,241
Location
Seattle, WA USA
MCA
Yeah, perhaps an OPTION for V2 might be to include some well recorded Roland Soundcanvas music in some format (ogg? etc...) where the music could be played from the digital recordings. Similar to what the Exult engine does. You can either play the original MIDI OR high quality .ogg music samples recorded on a MT-32. Everybody get's to enjoy it. And works really well.
 

Sceptic

Arcane
Patron
Joined
Mar 2, 2010
Messages
10,871
Divinity: Original Sin
If there are distinct reverb/chorus levels that vary with different tracks or different parts within one track then you definitely want to play this with a proper module or a real softsynth (and not Windows built-in) to get the full effect. Pretty cool if Cleve implemented that. Unless he specifically uses proprietary tones though (either Roland's or Yamaha's) you can use any MIDI device or a keyboard if you have one, or a software synthesizer with a good soundfont. I've used VirtualMIDISynth in the past, and while I prefer a real Sound Canvas, it does work quite nicely especially with a good quality soundfont.

Sound Canvas VA is overpriced IMO. I paid $50 for my SC-55mkII and I've seen SC-88s go for less than what they're asking. I guess it would be nice for the ability to play both SC-55 and SC-88 games the way they're supposed to sound (later SC tones are backward compatible, but they don't always sound the same, and it can change the mood on tunes IMO).

I use Coolsoft's wrapper on Windows 7 and it works great. I didn't know you couldn't reassign ports on Win8 and above, glad I never upgraded now. I guess the only option on newer OS is to either use VirtualMIDIsynth or Sound Canvas VA.

Anyway I don't have Grimoire yet but if someone wants to send me the MIDI files (or buy me the game :M) I can make some recordings off the SC-55.

Oh and someone mentioned listening to Monkey Island on a Sound Canvas - don't do that. Both 1 and 2 are MT-32 compositions.
 

Madmate

Novice
Joined
Dec 2, 2012
Messages
29
You can find MIDIs in Groke's post: http://www.rpgcodex.net/forums/index.php?threads/grimoire-rsf-unpacker.117755/#post-5253151

I listened them in Sound Canvas VA, and they sound great. Tried in Munt for MT-32 but I think SC-88's sounds better.
Just noticed that, ie, in SPHINX.MID, reverb/chorus levels are changing, but some instruments are noname (------). Does that means this midi is made with some other soundfont?

P.S.
Ellsworth Hall is currently working on the soundtrack album which will feature new orchestral reworkings of the original MIDI music. The soundtrack will be available on the Steam site. ( http://www.ellsounds.com/ )
 

Sceptic

Arcane
Patron
Joined
Mar 2, 2010
Messages
10,871
Divinity: Original Sin
I listened them in Sound Canvas VA, and they sound great. Tried in Munt for MT-32 but I think SC-88's sounds better.
Just noticed that, ie, in SPHINX.MID, reverb/chorus levels are changing, but some instruments are noname (------). Does that means this midi is made with some other soundfont?
Keep in mind the MT-32 is NOT a General MIDI device. Playing MT-32 MIDIs on GM or GM MIDIs on an MT-32 will cause all sort of weirdo sounds, most prominently the wrong tone calls being made and therefore the wrong instruments being played.

I remember some game composed on a Yamaha device (which uses an extension of General MIDI that isn't compatible with Roland's GS) that displayed a noname instrument when it didn't recognize the Yamaha-proprietary calls, so that's probably what's happening here too.
 

Max Stats

Liturgist
Joined
Nov 26, 2016
Messages
1,091
I remember some game composed on a Yamaha device

I don't know if it's what you're thinking of but I seem to recall the ports of Final Fantasy 7 and 8 having some sort of deal with yamaha. Didn't much bother me since I had a Yamaha midi daughter card for my SB16.
 

Moonrise

The Magnificent
Patron
Joined
Jul 7, 2017
Messages
386
Make the Codex Great Again!
Okay, I figured out a workaround for the problem. You can use Awave Studio to convert SF2 to DLS, and replace the GM.DLS file in Windows. Search for the file, take ownership of the folder it's in, make a backup copy and voila! Unfortunately, I have to get to the Amish bakery before it closes, but later today I'll make a bunch of these for you guys. Easy peasy lemon squeezy.
 

Crospy

Learned
Joined
Aug 9, 2014
Messages
130
Since there are differences between formats and how the software interprets the soundbank, I can't say for sure if it's going to be good, but if the DLS version of FluidR3 is anything like its soundfont version, it's by far much better than the Roland Sound Canvas and SC-55, and as a bonus, it's free, not piracy. The FluidR3 sound bank is released under the MIT license.

You can listen to a comparison of soundfonts based on the Roland set vs FluidR3 and some others here :
https://www.youtube.com/watch?v=eYViUHp0JYw
 

Solanacean

Educated
Joined
Sep 25, 2017
Messages
42
Well, I found out why I couldn't easily find the stuff for playback. It's using libraries unknown to my debugger. I was only able to find it via one of Cleve's error messages: "Failed to Load and Play MIDI :", filename, "..\\Source\\Sound.cpp", 464. Figuring this out without even knowing what library this is supposed to be talking to is going to be a huge pain.
No, that's not why you couldn't find it. There is no black magic there. You couldn't find it is because you've been looking for the wrong things. The game uses DirectMusic which is a pure COM, meaning that there aren't any helper functions you can see in your debugger. Take a close look at the two calls to CoCreateInstance. The first call creates performance object and returns a pointer to IDirectMusicPerformance interface:

Code:
CoCreateInstance(
         CLSID_DirectMusicPerformance,
         NULL,
         CLSCTX_INPROC_HANDLER|CLSCTX_INPROC_SERVER,
         IID_IDirectMusicPerformance,
         (void**)&pDMPerformance)

And the second call creates a loader object and returns a pointer to IDirectMusicLoader interface:

Code:
CoCreateInstance(
           &CLSID_DirectMusicLoader,
           NULL,
           CLSCTX_INPROC_HANDLER|CLSCTX_INPROC_SERVER,
           &IID_IDirectMusicLoader,
           (void**)&pDMLoader)

The code after that calls IDirectMusicPerformance::Init with ppDirectMusic = NULL, meaning that the application has no use for a DirectMusic object pointer, and just wants the performance to initialize itself, and after that is a call to IDirectMusicPerformance::AddPort with pPort = NULL, which means that the default MIDI port is added.
 

DoomIhlVaria

Cipher
Patron
Joined
Nov 1, 2009
Messages
373
Location
Hell's Waiting Room
Make the Codex Great Again! Insert Title Here I'm very into cock and ball torture
The code after that calls IDirectMusicPerformance::Init with ppDirectMusic = NULL, meaning that the application has no use for a DirectMusic object pointer, and just wants the performance to initialize itself, and after that is a call to IDirectMusicPerformance::AddPort with pPort = NULL, which means that the default MIDI port is added.

I did end up doing more digging and figured most of that out by looking at Microsoft's documentation. But I eventually abandoned the project for a few reasons. Among them:

First, Cleve seems to be pretty unhappy about anyone poking at the internals of his game at all. I don't need Zep-level drama in my life.

Second, I stopped playing Grimoire entirely because every single patch seems to bring radical changes to basic game mechanics. I don't really have much interest in a long play through in which the rules will be completely changed out from under me and my party choice invalidated on a weekly basis. I'll probably return to it if 2.0 ever happens.

Third, Cleve has been talking about encrypting the binary, which would make issuing patches way more complicated. However, if I were to return to this or if someone else wanted to do it, I think the long-term solution would be DLL injection. Then you could use an arbitrary MIDI device without touching Cleve's binary at all. It could also potentially work with other games.

I don't think there's much hope of Cleve changing this himself. He hasn't responded to any posts about it on here or Steam and never responded to my direct message here about it. I suspect either he's holding out for the "remastered" recordings or he simply doesn't care. I can definitely understand why either may be the case.
 

Solanacean

Educated
Joined
Sep 25, 2017
Messages
42
I can certainly understand the desire to avoid the drama. I'm also holding off playing Grimoire for the same reasons as you and I wouldn't want to get on the wrong side of Cleve as well. Not until the game is fleshed out, at least. As for DLL injection, sounds like a great idea. I think I'll try to do it myself.
 
Last edited:

Solanacean

Educated
Joined
Sep 25, 2017
Messages
42
Now this is hilarious. I've been reverse engineering the audio engine for a while, recreating the classes, methods, members and all that. Then I decided to take a look at the RTTI - specific information C++ compilers put in the executable files they produce, which contains the names of the classes, virtual tables for classes containing virtual functions (including virtual destructors), information about class hierarchy - which class inherits from which, and so on.

Among the class names found in the RTTI there were two in particular that caught my eye - one called CDXMidi and CDXSound. Upon closer inspection, as I suspected, they turned out to be the classes I've been recreating, the classes Grimoire depends on for playing music and sound effects. Now thanks to the RTTI I knew their original names, so I've typed them into google search bar and, to my surprise, found out that these classes belong to an old game development kit called CDX. Quoting the documentation, CDX "is a free GDK (Game Development Kit) which is comprised of a set of C++ wrapper classes for writing Windows games. It is built on top of Microsoft Windows and DirectX technology and offers simple to use C++ wrappers for all aspects of game development".

I've compared the CDX source code with the result of my reverse engineering - there can be no doubt, this is your mysterious audio library, DoomIhlVaria. The code is almost identical. I say "almost" because some code is slightly modified - probably by Cleve, to suit his specific needs. For example, CDX's CDXMidi::LoadMidi loads MIDI file from disk, so one has to supply it with a file name. The modified version used in the game hovewer takes a pointer to the block containing MIDI data in memory and the length of the data as another argument.

You can download CDX and read its source code if you're interested. Look for the following files:

cdxmidi.h
cdxmidi.cpp

cdxsound.h
cdxsound.cpp
cdxsoundbuffer.cpp
 
Last edited:

Solanacean

Educated
Joined
Sep 25, 2017
Messages
42
A prototype. Grimoire playing music using BASS + BASSMIDI audio libraries and SGM v2.01 SoundFont on Windows 10. This is achieved via DLL injection - the injected DLL intercepts DirectMusic method calls and redirects them to my code which calls BASSMIDI.



Yeah, perhaps an OPTION for V2 might be to include some well recorded Roland Soundcanvas music in some format (ogg? etc...) where the music could be played from the digital recordings. Similar to what the Exult engine does. You can either play the original MIDI OR high quality .ogg music samples recorded on a MT-32. Everybody get's to enjoy it. And works really well.
Oh, and with BASS, adding support for OGG, MP3 or even FLAC would be almost trivial.
 
Last edited:

DoomIhlVaria

Cipher
Patron
Joined
Nov 1, 2009
Messages
373
Location
Hell's Waiting Room
Make the Codex Great Again! Insert Title Here I'm very into cock and ball torture
A proof of concept. Grimoire playing music using BASS + BASSMIDI audio libraries and SGM v2.01 SoundFont on Windows 10. This is achieved via DLL injection - the injected code intercepts DirectMusic methods and redirects them to the code which calls BASSMIDI.



Yeah, perhaps an OPTION for V2 might be to include some well recorded Roland Soundcanvas music in some format (ogg? etc...) where the music could be played from the digital recordings. Similar to what the Exult engine does. You can either play the original MIDI OR high quality .ogg music samples recorded on a MT-32. Everybody get's to enjoy it. And works really well.
Oh, and with BASS, adding support for OGG, MP3 or even FLAC would be almost trivial.


Are you getting it to respect a default MIDI device (as picked with something like MIDI Mapper) or is this tied specifically to BASS? My original hope with all this was to get Grimoire playing out of real hardware. From what I remember, Cleve's code was hardcoded to the Windows softsynth, which I think is always Device 1. Device -1, however, would always go to what is set by something like MIDI Mapper.

In any case, impressive work so far!
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom