Monday, September 10, 2018

Allow as low as 1 voice in CoolSoft VirtualMidi Synth

Get rid of CoolSoft VirtualMIDI Synth's hardcoded minimum of 16 voices limit.

So I was previously enjoying the CoolSoft VirtualMIDI ini file hack to allow lower than 16 voices to be set, however, in newest version such ability was completely removed by checking the limit in DLL file as well and overriding the ini set value (unlike previous versions). And I don't want to use outdated version just for this. So I went for an older DLL version which was 32-bit but kept overriding my beautiful voices value of 4, used IDA to show me some assembly, searched for voices and guessed the place (dword and 10h, which means 16, doh). Found it in hex editor and remembered the hex string of that assembly, the most important was 00 00 10 00 00 00, as with x64 assembly is a bit different. Downloaded latest version. But hey, there were a bit more than one 00 00 10 00 00 00, oh well... what's the maximum voices limit? 100 000, so now 100 000 in hexadecimal is? 01 86 A0! Now let's reverse it to have it little endian way. Now let's see if we get 00 00 10 00 00 00 and 00 00 A0 86 01 00 close to each other. Yup, of course there is such a place. And this place, in both EXE and DLL is for voices limit. Vua la, program fixed.

To allow as low as 1 voice in virtualmidi synth do the following:

For version 2.5.3 x64:
- get yourself a hex editor,
- make sure VirtualMIDI Synth is closed and no program is using MIDI (like chrome, steam, any music player) and that VirtualMIDI Synth program is closed,
- navigate to your DRIVE:\Program Files\VirtualMIDISynth,
- edit VirtualMIDISynth.exe in your favourite hex editor,
- change byte 10 [16] at position 3B33 [15 155] to 1 [1],
- navigate to DRIVE:\Windows\system32,
- edit VirtualMIDISynth.dll,
- change byte 10 [16] at position 2507A [151 674] to 1 [1],
- reopen VirtualMIDI Synth and change number of voices to 4 and use chiptune soundfont,
- ????
- enjoy 4 voice channels emulation.