VOGONS


First post, by marzsyndrome

User metadata
Rank Newbie
Rank
Newbie

Whew! Glad I could get that title in at least without running out of space. But to be more precise, I am looking for:

1) A command-line program for Windows...
2) ...that can convert a MIDI file to a WAV file...
3) ...that doesn't simply use soundfonts...
4) ...but instead is able to use external MIDI drivers...
5) ...such as MUNT or OPL3Windows.

So, that eliminates both Timidity and FluidSynth. Basically, I want a batch-friendly program that is able to read a MIDI file like it were, say, WMP, and utilise whatever driver I've specified in the Drivers32 section of the registry and output the end-result into a WAVE format. I'm thinking, for instance, that I could utilise the accuracy of OPL3Windows to create an OPL'd version of a MIDI file of my choice and do as I wish with it. I've tried using that OPL3 128Mb soundfont with the above-mentioned MIDI programs but it obviously isn't all that accurate a lot of the time. And I'd prefer command-line-based because then I could make a batch script to auto-convert many MIDI files in this style, rather than just chuck everything into a bulky GUI program.

I've also tried ADLMIDI - well, whatever outdated Win32 binary I could get my hands on - and somehow it still doesn't sound quite like how I hear it through OPL3Windows. Is it not using Nuked?

Anyhow, whoever can magic up precisely this kind of setup will have my eternal gratitude. Thanking you!

Last edited by marzsyndrome on 2017-07-04, 19:50. Edited 2 times in total.

Reply 1 of 15, by superfury

User metadata
Rank l33t++
Rank
l33t++

You can simply play it using any windows player, which (supports) outputs to MUNT or OPL3Windows(don't know that one, though). Then simply redirect output to the Windows Stereo mix loopback adapter, then record it using any audio software that can record it to a .wav file? Although, that would require real-time recording. Don't know of any software that can directly render output using MUNT etc.(which outputs to hardware only afaik). Thus the loopback adapter is probably the only choice?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 3 of 15, by Falcosoft

User metadata
Rank Oldbie
Rank
Oldbie

Hi,
I do not think such a converter can exist since there is no function in the WinMM API to get back sample data from Midi Out drivers. You can only send Midi messages to drivers that usually render samples directly to WaveOut (virtual Midi cables and HW ports are exceptions). So Superfury is right, only real-time recording is possible. But you can do this process even with one GUI application (FSMP).
And if you want to record directly (avoiding the loop-back adapter) you can also do it with the help of the included Munt VSTi and OPL3 GM VSTi plugins.
http://falcosoft.hu/softwares.html#midiplayer
About the recording part:
http://falcosoft.hu/midiplayer_howto.html#a8
About how to use the VSTi plugins:
http://falcosoft.hu/midiplayer_howto.html#a17

Edit:
I have just tried and Winamp does not seem to use the Disk Writer output when the Midi input plugin (and normal Midi Out ports) is used.

Last edited by Falcosoft on 2017-07-06, 02:47. Edited 1 time in total.

Website, Facebook, Youtube
Falcosoft Soundfont Midi Player + Munt VSTi + BassMidi VSTi
VST Midi Driver Midi Mapper

Reply 4 of 15, by marzsyndrome

User metadata
Rank Newbie
Rank
Newbie
leileilol wrote:

IIRC WinAMP should have a WAV output plugin along with a (buggy!) MIDI input plugin that can sample from midi devices (really meant for the visualizers etc).

Yes, I'm aware of Winamp and its own MIDI-to-WAV usefulness. I just wish someone would write a CLI frontend that utilises in_midi.dll (and I guess out_disk.dll) outside of Winamp like that fhgaacenc program some smart soul made a few years back.

Reply 5 of 15, by Falcosoft

User metadata
Rank Oldbie
Rank
Oldbie

Winamp also cannot render to wav when you select a 'normal' Midi Out port. The conversion only works with the DirectMusic MS GM/GS Softsynth.
I still cannot comprehend how it would be even theoretically possible to write such a converter (considering the lacking of any supporting functions in the API).

Website, Facebook, Youtube
Falcosoft Soundfont Midi Player + Munt VSTi + BassMidi VSTi
VST Midi Driver Midi Mapper

Reply 6 of 15, by marzsyndrome

User metadata
Rank Newbie
Rank
Newbie

Yeah, oops, just noticed the edit to your post after I made my comment (the posting of which I delayed due to being momentarily distracted). So I guess Winamp is a bust unless someone makes a replacement Midi plugin for it (there's already many alternative MOD plugins for it, so I hold out hope).

That said, foobar2000 is a godsend GUI-wise - the foo_midi component for it appears to now include Nuclear support, which I'll take to mean it uses Nuked. And it includes the option to use OPL3W as a preset anyway! Now if only it could be made more CLI batch friendly...

Reply 7 of 15, by marzsyndrome

User metadata
Rank Newbie
Rank
Newbie
Falcosoft wrote:
Hi, I do not think such a converter can exist since there is no function in the WinMM API to get back sample data from Midi Out […]
Show full quote

Hi,
I do not think such a converter can exist since there is no function in the WinMM API to get back sample data from Midi Out drivers. You can only send Midi messages to drivers that usually render samples directly to WaveOut (virtual Midi cables are exceptions). So Superfury is right, only real-time recording is possible. But you can do this process even with one GUI application (FSMP).
And if you want to record directly (avoiding the loop-back adapter) you can also do it with the help of the included Munt VSTi and OPL3 GM VSTi plugins.
http://falcosoft.hu/softwares.html#midiplayer
About the recording part:
http://falcosoft.hu/midiplayer_howto.html#a8
About how to use the VSTi plugins:
http://falcosoft.hu/midiplayer_howto.html#a17

Okay, so I gave your MIDI program a try. Took a while to navigate round the interface and sort out the VSTi configuration, but overall it's pretty neat. Just a couple of questions:

1) Would a fast write-to-WAV output option be possible in future? Just noticed that even after setting the recording output to File Mode, it only writes in real-time.
2) What would be the likelihood of a CLI program on the side designed to deal with MIDI-to-WAV-or-whatever conversions in future also? Noticed the mod2midi program so I hold out hope. 😀

Reply 8 of 15, by Kamerat

User metadata
Rank Oldbie
Rank
Oldbie

foobar2000 with the "MIDI synthesizer host" plugin host can convert at high speed. It comes with Munt (Super MUNT GM), Soundfont support, VSTi support and some FM emulators.

http://www.foobar2000.org/download
http://www.foobar2000.org/components/view/foo_midi

DOS Sound Blaster compatibility: PCI sound cards vs. PCI chipsets
YouTube channel

Reply 9 of 15, by Falcosoft

User metadata
Rank Oldbie
Rank
Oldbie

) Would a fast write-to-WAV output option be possible in future? Just noticed that even after setting the recording output to File Mode, it only writes in real-time.

As I said in case of normal Midi Out ports only real-time recording is possible (even theoretically). In case of Softsynths/Basmmidi output mode that can give back sample data faster than real-time conversion is possible so maybe later it can be added.

2) What would be the likelihood of a CLI program on the side designed to deal with MIDI-to-WAV-or-whatever conversions in future also? Noticed the mod2midi program so I hold out hope. 😀

Just as above. In case of normal Midi Out ports as in your original question:

...whatever driver I've specified in the Drivers32 section

such a conversion tool is not possible. In case of Bassmidi/SoftSynths the chances are higher than zero 😀

Website, Facebook, Youtube
Falcosoft Soundfont Midi Player + Munt VSTi + BassMidi VSTi
VST Midi Driver Midi Mapper

Reply 10 of 15, by marzsyndrome

User metadata
Rank Newbie
Rank
Newbie
Kamerat wrote:

foobar2000 with the "MIDI synthesizer host" plugin host can convert at high speed. It comes with Munt (Super MUNT GM), Soundfont support, VSTi support and some FM emulators.

http://www.foobar2000.org/download
http://www.foobar2000.org/components/view/foo_midi

Yes, I did already mention fb2k earlier. It's very useful at times. I'm just hoping that any command-line support it may have is capable of starting itself up to do one task then auto-quit again.

Falcosoft wrote:
As I said in case of normal Midi Out ports only real-time recording is possible (even theoretically). In case of Softsynths/Basm […]
Show full quote

) Would a fast write-to-WAV output option be possible in future? Just noticed that even after setting the recording output to File Mode, it only writes in real-time.

As I said in case of normal Midi Out ports only real-time recording is possible (even theoretically). In case of Softsynths/Basmmidi output mode that can give back sample data faster than real-time conversion is possible so maybe later it can be added.

2) What would be the likelihood of a CLI program on the side designed to deal with MIDI-to-WAV-or-whatever conversions in future also? Noticed the mod2midi program so I hold out hope. 😀

Just as above. In case of normal Midi Out ports as in your original question:

...whatever driver I've specified in the Drivers32 section

such a conversion tool is not possible. In case of Bassmidi/SoftSynths the chances are higher than zero 😀

Well at this point if BassMIDI/SoftSynth approaches are capable nowadays of more or less replicating what MIDI playback sounds like through WinMM anyway, I'm all for going down that route. 😀

Reply 11 of 15, by Kamerat

User metadata
Rank Oldbie
Rank
Oldbie
marzsyndrome wrote:
Kamerat wrote:

foobar2000 with the "MIDI synthesizer host" plugin host can convert at high speed. It comes with Munt (Super MUNT GM), Soundfont support, VSTi support and some FM emulators.

http://www.foobar2000.org/download
http://www.foobar2000.org/components/view/foo_midi

Yes, I did already mention fb2k earlier. It's very useful at times. I'm just hoping that any command-line support it may have is capable of starting itself up to do one task then auto-quit again.

Think I need some new glasses. 😊

DOS Sound Blaster compatibility: PCI sound cards vs. PCI chipsets
YouTube channel

Reply 12 of 15, by Stretch

User metadata
Rank Member
Rank
Member

ADLMIDI sounds different compared to OPL3Windows, because it has reverb applied. midiplay from libadlmidi sounds more authentic because it has no reverb, but the -w option for writing wav doesn't work.

PGE MusPlay for Win32 from the middle of this page https://github.com/Wohlstand/libADLMIDI is a graphical interface to libADLMIDI and it has the option to write a wav.

Win 11 - Intel i7-1360p - 32 GB - Intel Iris Xe - Sound BlasterX G5

Reply 13 of 15, by datajake1999

User metadata
Rank Newbie
Rank
Newbie

I am looking for a midi to wav converter that uses the code from opl3windows as well.
It is the most accurate compared with everything else because it emulates the pitch bend underflow bug, for example.
I don't like using foobar2000 to convert midis to wav, even though it uses the code from opl3windows, because the output is a bit distorted.
These are the reasons I want someone to write a command-line utility to convert midis to wav using opl3windows.

Reply 15 of 15, by superfury

User metadata
Rank l33t++
Rank
l33t++

Thinking about it, perhaps a normal MIDI driver synth(of any kind, except actual analog synths(like an old MT-32) that are connected using MIDI cables). Windows nowadays has a audio loopback adapter that's hidden by default.
You could playback using any media player, then record what's on the loopback adapter? Windows 10 calls said 'adapter' Stereo Mix or something like that.
Edit: A link for Windows 10 Stereo Mix: https://thegeekpage.com/stereo-mix/

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io