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

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
Has anyone tried Grimoire out on a hardware MIDI module instead of Windows' shitty default synthesizer, like an MT-32, Sound Canvas, or something newer?
 

Jaesun

Fabulous Ex-Moderator
Patron
Joined
May 14, 2004
Messages
37,433
Location
Seattle, WA USA
MCA Dead State Divinity: Original Sin Project: Eternity Torment: Tides of Numenera Shadorwun: Hong Kong Divinity: Original Sin 2 BattleTech
So just to be clear, this game IS using MIDI for the music (and it is not pre-recorded sound files)?

I physically own 2 Roland MT-32's and a Sound Canvas.

I was going to ask, what specific sound module this was written for. Based on what I have heard so far, it is for a Sound Canvas. Of which I don't *believe* it is using any of the extra GS sound bank sounds. So the Windows built in Roland sounds are fairly accurate. It would sound MUCH better on an actual Roland Sound canvas (in theory). It seems the music is written specifically for a General MIDI device (since it is NOT using any of the GS extra sound banks).

And since I am 99.9% sure it is General Midi, that then leaves the Roland MT-32 out. You CAN make a GM sound bank on the MT-32, but the sounds on the Sound Canvas are vastly superior.

Also, you no longer can output to MIDI to a different device using current windows (Windows 7 still has this option). So I can't play this through any of my Sound Modules.

You CAN use MIDI sound modules with DOSBox. It allows you to direct MIDI to any output source.
 

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
So just to be clear, this game IS using MIDI for the music (and it is not pre-recorded sound files)?

I physically own 2 Roland MT-32's and a Sound Canvas.

I was going to ask, what specific sound module this was written for. Based on what I have heard so far, it is for a Sound Canvas. Of which I don't *believe* it is using any of the extra GS sound bank sounds. So the Windows built in Roland sounds are fairly accurate. It would sound MUCH better on an actual Roland Sound canvas (in theory). It seems the music is written specifically for a General MIDI device (since it is NOT using any of the GS extra sound banks).

And since I am 99.9% sure it is General Midi, that then leaves the Roland MT-32 out. You CAN make a GM sound bank on the MT-32, but the sounds on the Sound Canvas are vastly superior.

Also, you no longer can output to MIDI to a different device using current windows (Windows 7 still has this option). So I can't play this through any of my Sound Modules.

You CAN use MIDI sound modules with DOSBox. It allows you to direct MIDI to any output source.

I assumed it was real MIDI based on the fact that Linux users are having to install Timidity to get music when running Grimoire with WINE.

As for MIDI output for arbitrary programs, have you tried the Open MIDI Project's MIDI Selector or CoolSoft's MIDI Selector? Allegedly these sorts of things can work even on Windows 10 but I don't have a hardware module yet so I can't test (I have an SC-88 Pro coming later this month).
 

Crospy

Learned
Joined
Aug 9, 2014
Messages
130
Has anyone tried Grimoire out on a hardware MIDI module instead of Windows' shitty default synthesizer, like an MT-32, Sound Canvas, or something newer?

This depends on the version of windows you have.

http://haskell.cs.yale.edu/euterpea/midi-on-windows/#default
http://donyaquick.com/midi-on-windows/#x1-140004.3

You could use a software synthesizer like Fluidsynth and a good soundfont bank if you're on an older windows. If you're on windows 8/10, you're fucked. Windows 8/10 doesn't allow you to change the default MIDI device so only software that can configure their sound routing like audio workstation programs can do it.

On Windows 8, there is still a registry entry for default MIDI output, but it only seems to affect Windows Media Player and no other programs. Because of this, old software that relies on the default output device setting to know where to send MIDI messages will be tied to the default synthesizer in Windows 8.

Basically you can't get video games to be routed to anything other than windows's absolutely shit synth.

Your best bet is to.. use linux and wine :smug:
 

Crospy

Learned
Joined
Aug 9, 2014
Messages
130
Grimoire would probably work fine in a virtual machine too, if you wanted to keep that stuff on your windows PC. Could try either an older windows in a VM or linux+wine inside that VM.
 

newtmonkey

Arcane
Joined
Aug 22, 2013
Messages
1,384
Location
Goblin Lair
I'm not sure that Grimoire uses MIDI. I have an external SC-88 set as my default MIDI device, but Grimoire just plays music on its own.
 

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
I'm not sure that Grimoire uses MIDI. I have an external SC-88 set as my default MIDI device, but Grimoire just plays music on its own.
Looking at the disassembler output in IDA Pro, it looks like it's set to use Device 0, which is always the built-in soft MIDI. To use the default device, it would have to be set to use Device -1. That's assuming this isn't some obsolete code and I'm not misinterpreting it. But there's definitely MIDI code of some kind in here. If one of the MIDI selector programs doesn't work when my SC-88 Pro arrives, I'll see if I can patch Grimoire directly. Or maybe we can persuade Cleve to make it an actual config option.
 

Zep Zepo

Titties and Beer
Dumbfuck Repressed Homosexual
Joined
Mar 23, 2013
Messages
5,233
yeah...I had to use some MIDI Mapper Wrapper before to get it to send shit to my MIDI Keyboard, was using win 7.

Zep--
 

neckbird

Barely Literate
Joined
Aug 13, 2017
Messages
4
Looking at the disassembler output in IDA Pro, it looks like it's set to use Device 0, which is always the built-in soft MIDI. To use the default device, it would have to be set to use Device -1. That's assuming this isn't some obsolete code and I'm not misinterpreting it. But there's definitely MIDI code of some kind in here. If one of the MIDI selector programs doesn't work when my SC-88 Pro arrives, I'll see if I can patch Grimoire directly. Or maybe we can persuade Cleve to make it an actual config option.
Which windows API are you referring to?
 

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
Looking at the disassembler output in IDA Pro, it looks like it's set to use Device 0, which is always the built-in soft MIDI. To use the default device, it would have to be set to use Device -1. That's assuming this isn't some obsolete code and I'm not misinterpreting it. But there's definitely MIDI code of some kind in here. If one of the MIDI selector programs doesn't work when my SC-88 Pro arrives, I'll see if I can patch Grimoire directly. Or maybe we can persuade Cleve to make it an actual config option.
Which windows API are you referring to?
Well, looking at things again he's using WINMM.DLL (the Windows Multimedia API) to enumerate the MIDI devices and set the volume. It doesn't look like that enumeration is actually used outside of setting the volume at first glance. He seems to be using DirectSound for normal audio and I would expect references to DirectMusic but I can't seem to find any. So patching wouldn't be as straightforward as I thought because I haven't found what I really need yet. I could override the device for volume control purposes but that isn't very useful.
 

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
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.
 

Zep Zepo

Titties and Beer
Dumbfuck Repressed Homosexual
Joined
Mar 23, 2013
Messages
5,233
It's from the 1990s, I would imagine he using the Miles Sound System (not sure if I spelled it right...)

Zep--
 

neckbird

Barely Literate
Joined
Aug 13, 2017
Messages
4
Actually, yea, it might be WINMM.dll. Grimoire.exe imports that and it has some midi related APIs (see below).

I had to install directmusic dlls and gm.dls to get midis to work in wine though. gm.dls has a midi soundfont that I presume the APIs ultimately use for synthesis.

002ae064 002ae0a0 00000000 00000000 002aeebe 002ae55c

DLL Name: DSOUND.dll
vma: Hint/Ord Member-Name Bound-To
80000001 1 <none>

002ae078 002ae4c8 00000000 00000000 002aef86 002ae984

DLL Name: WINMM.dll
vma: Hint/Ord Member-Name Bound-To
2aef54 182 waveOutGetVolume
2aef68 22 auxGetVolume
2aef78 152 timeGetTime
2aeede 78 midiOutGetDevCapsA
2aeeca 90 midiOutSetVolume
2aeef4 191 waveOutSetVolume
2aef08 173 waveOutGetDevCapsA
2aef1e 24 auxSetVolume
2aef2e 19 auxGetDevCapsA
2aef40 84 midiOutGetVolume
 

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
Maybe. My current suspicion is leaning toward some kind of Watcom wrapper for a Windows API. I know Cleve loves Watcom.

Nope, no FLIRT signature matches for Watcom stuff near as I can tell. It seems like Cleve actually used Visual C++ rather than OpenWatcom like all the stuff he talks about on his blog.
 

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
It uses directmusic. dmusic.dll or dmusic32.dll I believe.
I somehow missed your post the first time around. I've since loaded it into a debugger to actually check the loaded DLLs. dmusic.dll is the one. It also loads a few MIDI-related things like winmm.dll, MIDIMapper.dll, and midimap.dll. Still no luck figuring out how to hijack the device ID though.
 

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
Actually, yea, it might be WINMM.dll. Grimoire.exe imports that and it has some midi related APIs (see below).

I had to install directmusic dlls and gm.dls to get midis to work in wine though. gm.dls has a midi soundfont that I presume the APIs ultimately use for synthesis.

002ae064 002ae0a0 00000000 00000000 002aeebe 002ae55c

DLL Name: DSOUND.dll
vma: Hint/Ord Member-Name Bound-To
80000001 1 <none>

002ae078 002ae4c8 00000000 00000000 002aef86 002ae984

DLL Name: WINMM.dll
vma: Hint/Ord Member-Name Bound-To
2aef54 182 waveOutGetVolume
2aef68 22 auxGetVolume
2aef78 152 timeGetTime
2aeede 78 midiOutGetDevCapsA
2aeeca 90 midiOutSetVolume
2aeef4 191 waveOutSetVolume
2aef08 173 waveOutGetDevCapsA
2aef1e 24 auxSetVolume
2aef2e 19 auxGetDevCapsA
2aef40 84 midiOutGetVolume

Unfortunately, near as I can tell, Grimoire just uses the winmm stuff to set the volume. He pulls the details of device 0 via midiOutGetDevCapsA and then uses that information to set the volume with midiOutSetVolume.
 

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
Three people (including myself) have requested that Cleve had support for external MIDI hardware in the Steam suggestion threads. I may poke at this some more but I would rather just be playing Grimoire. So if you guys are interested in using hardware MIDI modules, you should post in the pinned suggestion thread on Steam.
 

Bumvelcrow

Somewhat interesting
Patron
Dumbfuck
Joined
Nov 17, 2012
Messages
1,867,069
Location
Over the hills and far away
Codex 2013 Codex 2014 Make the Codex Great Again! Strap Yourselves In
Three people (including myself) have requested that Cleve had support for external MIDI hardware in the Steam suggestion threads. I may poke at this some more but I would rather just be playing Grimoire. So if you guys are interested in using hardware MIDI modules, you should post in the pinned suggestion thread on Steam.

Nice - allowing a specified MIDI port would allow linuxfags to direct output to something like fluidsynth with custom soundfonts instead of having to install the default DirectX sounds via winetricks.
 

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