Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foobar MIDI support using system default device (Read 12053 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foobar MIDI support using system default device

While messing with some .MID files i just noticed foobar2000 has no buit in suport for MIDI files, and the only avaliable plugin offers no support for the system device, only built-in, software synthetizers.

The default synth (Emu de MIDI), IMHO, has unacceptable sound quality, sounding more like an old SNES game, and much, much worse than my almost 10-years old SB Live Value card.

And FluidSynth requires the user to provide a SoundFont file. And its not easy for the average user to find a generic, general use, free, "standard" SoundFile. And I dont think an end user should be required to have this burden of hunting a file when the the soundcard already has MIDI, its quality is decent enough for my tastes, and the OS provides support for it for like a decade or so.

So both choices are very innadequate, and theres no option to use the system default MIDI device.

Ive browsed and searched the forum, but most topics about this date to 2004 or 2006. Ive read them all, but i would like to know if anything have changed in the last 4-6 years. My main issues are:

- Im aware that MIDI works differently than other PCM audio, and thus using the OS General MIDI device would mean no Replaygain, DSP, convertion, etc. So what? Let it act as a mere passthrough then! It still can be played, stopped, paused, seeked, used in playlists, so it IS useful to have them in a single player.

- Some formats do have inherent limitations. WAV has no built-in tagging, for example. So the user is used to those limitations, and wouldnt complain if equalizer or replaygain does not work with midi. Visualization, Equalizer and other tools are also disabled in WMP when you play a midi, so its not foobar's fault, and as long as you can enqueue, play it and add it to a playlist, and it sounds the same, its fine.

- A simple solution would be to add a 3rd option in foo_midi, "System default MIDI device". Let it shows a text explaining that using it would disable *all* DSPs and other sound processing features, such as converter, replaygain, CD Burn, etc. Internally it would be digital silence, while all the data is thrown to for OS to handle.

- Maybe the only feature truly missed would be volume control. Default foobar control wouldnt work, and one should use the systems default mixer and sliders for that. WMP uses a smart "trick" for this: when you play a midi, the internal player volume actually changes the system´s MIDI volume. If the same trick could be used in foobar, great. If not, its fine too.

- It would be VERY frustrating if foobar cant be used to play midis like all other major players do. Its very dissapointing to ask the user to use a separate player just for midis. From a user point of view, if Media Player, Winamp, iTunes (heck, even DOSBox!) do use the general OS midi device, why cant foobar? They all offer limited funcionality for this, so would foobar. But its there, out of the box, its simple to use, and it sounds the same no matter the player.

Let the user choose between features vs sound quality and simplicity.

Sorry for the long post and the poor english... but i really would like to hear comments on these issues. Maybe kode54 is more suited to answer, but anyones opinion about this would be greatly appreciated.


foobar MIDI support using system default device

Reply #2
Ive read this thread before my post. Its the longest, and most technical one, but unfortunatly the debate goes far beyond the scope, with several posts discussing  MAD Decoder, VSTs quality, and other unrelated discussion.

Here are my thoughts about the main objections presented in those posts:

  • From the user point of view, the "send data to midi device via DirectMusic while sending nulls to foobar" approach is NOT "hackish", because its completely transparent to the user. He would double click a file, it would open and play, and play very nicely. No hassle, no "go find yourself a SF2 file on the net".
  • From a technical/dev point of view, its not hackish either. This is called a "passthrough" approach, and since it bypasses most processing, and only sends data to the OS, i really fail to see why this would be any hard to do. Its certainly a LOT easier than doing a complete soft-synth as "Emu de MIDI" does. For me, trying to squeeze midi data into a PCM pipeline, making it sound complety different than OS default, IS a hackish approach. Its a way to pretend MIDI is just like any other audio, when it isnt, with horrible results quality-wise.
  • Sure, many features like Replaygain or Equalization wouldnt work, but they dont work in other players anyway. And, granted the MIDI inherent differences from all other audio formats, its understandable and acceptable. Using an analogy, its the same approach the video players use for sending 5.1 Dolby Digital AC3 signals to a receiver using the SPDIF output. When enabled, no processing is done by the player, and even volume has to be set using the receiver. So why not take this road?


Remember, we are not talking about an obscure format here. MIDI is there for like 15+ years, it is a very known standard, existed way before MP3 and its still widely used today. How many audio formats can say that? So why cant foobar make an exception and offer this functionality?

Some quotes about other users on the limitations of the "passthrough" approach:

My reason for wanting proper MIDI with Foobar is just so I don't have to keep switching back and forth between players to play different audio formats.  Foobar is, after all, an audio player first.  [...] Anyway, I like having a single audio player where I can just queue up a list of files to play and then use the multimedia keys on my keyboard to control it's progress through that playlist while I work on other things.
Yes I'm aware that foobar playing MIDI won't really much be foobar playing MIDI so much as DirectShow or whatever playing it (eg no DSP settings or anything) but, that's perfectly alright.
Again.  I don't want DSP, I don't want replaygain, I don't even care if I loose visualization for MIDI only.


Huge +1 for all the statements above.


I was wondering if there is a way to let foobar play midi-files and sound like when I play them in wmp. I have installed the lates foo_midi and it seems to work fine, BUT it doesnt sound the same.

Hi, what do I need to play midi files with foobar? [...] Windows Media Player plays midi flawlessly so why foobar can't

I have recently switched to Foobar (amazing) from Winamp [...] Foobar doesnt come with a midi input, and the only other plugin I can find was foo_midi. Thing is, foo_midi isnt very good. You cant choose your output device, resulting in it sounding terrible [...] Not that I listen to Midi's terribly often - but still, I would like to use Foobar as my audio player fulltime.


So Users DO want foobar to play such a common audio format, because they do consider it a regular audio player, capable to do at least the same of what  other players do. (not talking about bloatware here, im keeping focus on audio playback)


Use winamp input wrapper for foobar, download winamp, copy the in_midi-plugin to the foobar2000 folder, select that folder as plugin directory, change settings (I use wave output to listen to midi in surround), load a playlist with midi-files and enjoy

Are you saying you tweaked the Winamp midi dll to work with Foobar using the midi instruments from the soundcard? If so, that is awesome. Even better would be if you could make it work for v0.9 since a lot of people don't use 0.8.x anymore.


*THATS* hackish for me! And yet its still acceptable to some users. The same could be done simpler and easier by enabling soundcard MIDI passthrough via foo_midi.


At least I have a decent solution now, but I would still prefer to be able to oupt midiout to my SB Audigy Synth, or through direct music.


+1 here, and i think from all users who find Emu de MIDI insatisfatory and cant find a general use SoundFont similar to its soundcards or simply dislike the complexities needed for that solution;


As final thoughts:

I truly respect and and admire kode54 HUGE effort in doing foo_midi. Developing a fully working soft-synth does not sound easy, and adding an option for musicians/savvy/advanced users to use their own Soundfont is truly awesome, all this to honor foobar's (developers) paradigm and fit midi in the PCM pipeline, enabling all the cool features we all know and love in foobar, like Replaygain, conversion, plugin DSPs, etc. so i am deeply grateful for that.

But its not a complete solution. Quotes above shows that for many users using the soundcard MIDI synth would be best, both quality- and simplicity- wise. And techicaly it is quite easy to develop a passthrough. It would disable most of the great features of foobar, yes, but that its acceptable if one wants to have foobar as its main audio player. And if from developers point of view this approach may look like an heretic exception to its design, it may be, but we are talking about support of a widely known, 15+ years long format that its still used today. That should earn MIDI a right to such exception. The way it is implemented it looks like a flaw or a lack of foobar in comparison to other players

Foobar2000 IS perceived by the general user as a general audio player. Changing this scope just because the (techinically easy) solution would not adhere to developers paradigm, allowing no exception for a major format, makes little sense to me.

.

foobar MIDI support using system default device

Reply #3
Digging up further, ive found THIS ancient but amazing thread on the subject. Lots of relevant opinions, very focused on this very issue, and with several pots from kode and peter itself.

After carefully reading it, i guess it all nails down to this:
Proper MIDI input needs to get PCM data from rendered MIDI files, and no win32 MIDI playback API supports that properly. [...] I originally came with the idea of capturing PCM data from DirectMusic synth years ago, it was a total pain to work with, and had unfixable issues

Ok, that means proper MIDI handling isnt technically possible, mostly to OS/API fault, not foobar's. Ok, thats sad, so dont do it the "proper" way. Drop the feed from MIDI rendered data to PCM pipeline.

Peter's "answer" to this approach:
would suck because if it even got somehow implemented (...), it would break all interesting playback features (replaygain, DSP, different outputs, visualisations, dithering, clipping detection, etc etc, hell, even diskwriting).

Once again, thats too bad, but i can live with that. I lose several features, but i get excelent quality with no hassle at all. For MIDI files, thats a worthy trade-off. Specially since most DSPs make no sense in midi-world. With the bonus of having everything in a single player. Playlists, keyboard shortcuts, integration, no need of other programs for audio files. Very worthy trade-off, IMHO.

And im not alone:
i would also be pleased if foobar supports midi. but i don't understand, why foobar needs an own softsynthesizer.

why not use a simple midi plug in like in winamp where u can select your midi device to play the files. the midi device schoud normally be the wavetable of the soundcard (every sk has its on midi device, even a sb live/audigy or onboard soundcard)
(...)
of course u cannot use visualisation, diskwriter etc, but foobar schould only support playing midi files nothing more


Final question:
Foobar2000 does not yet support inputs which do not generate samples. Developing an input which generates silence while producing its own audio through an external means is not a good idea.

Why its not a good idea? Just because it breaks many features? I can live with that. Why not let the user decide if this trade-off is worth or not?

Any comments and opinions on that matter would be greatly appreciated

foobar MIDI support using system default device

Reply #4
foo_midi is the best midi component that foobar2000 will likely ever have. Your objections are noted, but they will be disregarded.

foobar MIDI support using system default device

Reply #5
Thanks for the answer, but... why?

If its just lack of interest on developers, as they consider this question settled and whant to dedicate their effort on other features, i would gladly volunteer myself to develop this passthrough. 

Or are there any other techinical issues im unware of?

Would such solution be discouraged by developers due to its design? Like not allowing it to be integrated with foo_midi? It wouldnt make any sense for this to be a separate plugin. Its meant to complement its funcionality, not replace it in any way.

Cheers!

 

foobar MIDI support using system default device

Reply #6
There are many free GM soundfonts, which are easy to find, for example Fluid, RealFont, Chorium and others. Or there is VSTi like SoundCanvas, HyperCanvas which are not hard to find either. So yours is not quite a problem, more like personal preference.

foobar MIDI support using system default device

Reply #7
There are many free GM soundfonts, which are easy to find, for example Fluid, RealFont, Chorium and others. Or there is VSTi like SoundCanvas, HyperCanvas which are not hard to find either. So yours is not quite a problem, more like personal preference.


VSTs like SoundCanvas or HyperCanvas, from the very little ive read, are paid - so thats not an option. Why pay if my hardware does it nicely for free?

As for the free ones, i indeed found a few (but only like half a dozen) after some hours googling. It is very hard when you have no idea what or where to look for, since ive never had to bother with this kind of trouble - again, my hardware/OS always did it hassle-free. And working with all players, games and applications. All but foobar.

To make it work, i had to aquire quite large technical knowledge. GS, GM, SoundFont, SF2, Banks, things ive never heard of until yesterday. Should this really be required for acceptable-quality MIDI play in my favorite player?

Speaking of quality... the few SoundFonts ive found, including Fluid, are a HUGE improvement over Emu de MIDI. But they all still sound quite inferior to my soundcard synth. And im talking about an almost 10 year old cheap SB Live Value , which i assume is far from top-notch hardware.

And this is NOT personal preference.. i could record some samples using the same test MIDIs provided by some SoundFont developers. You dont have to be an audiophile (as im not), not even be picky... just be honest and anyone would agree they are clearly inferior. Specially (but not only) regarding some awfully LOUD instruments. And i DO mean heavily clipped-loud!

Anyway... im NOT sugesting a *replacement* for FluidSynth, just a *complement*, for a more complete MIDI solution. Why would that be so bad?

foobar MIDI support using system default device

Reply #8
Speaking of quality... the few SoundFonts ive found, including Fluid, are a HUGE improvement over Emu de MIDI. But they all still sound quite inferior to my soundcard synth. And im talking about an almost 10 year old cheap SB Live Value , which i assume is far from top-notch hardware.

Maybe you use some generic soundfont, or your card is just too good
Here is another SF file. The only drawback for me is that, foo_midi puts whole SF in memory, so you can sometimes see half GB memory usage just for MIDI playback
ATOH as you can't tag or manage MIDIs with foobar, maybe using another software isn't bad idea

foobar MIDI support using system default device

Reply #9
Also note that under Windows Vista and newer, the system MIDI driver defaults to the Microsoft DLS synthesizer, using the supplied 4MB Roland patch set. Reconfiguring Windows to use anything else requires one of several third party applications for modifying a registry key to point to a different MIDI device. Of course, this doesn't affect you, since you're using XP.

I could implement a driver which uses winmm streaming, or the DirectSound hack, and it would probably work with your sound card. And thanks to changes to the foobar2000 input API from 0.9, it could also reject attempts to use that driver for anything but straight playback. I refuse to implement a sound recording path just to capture the audio for visualization or conversion, though.


... Wait a minute. You're using a hardware synthesizer that just happens to be a SoundFont device? Why not just assign your favorite SoundFont to FluidSynth? I'm sure FluidSynth even works with the 4MB or 8MB or whatever sized banks that Creative bundles with their drivers, just as well as the gigantic banks that are recommended by various users.

Actually, FluidSynth works better with giant banks, because unlike the Sound Blaster Live! and Audigy cards, FluidSynth is not limited to mapping only 32MB worth of samples at once. You'll notice this limitation kicking in with a large bank either with dropped notes, or in the case of earlier Creative drivers, a BSOD with IRQL_NOT_LESS_OR_EQUAL or similar error.

foobar MIDI support using system default device

Reply #10
Maybe you use some generic soundfont, or your card is just too good


Generic soundFont? Possible. Im new to this world, so i really dont know how or where to look for good SoundFonts.

Card too good? Very unlikely. As i said, its an almost 10-yr-old PCI SB Live Value. Notice the "Value" there... meaning "budget".  No SPDIF, no 5.1, nothing, just a plain SB card.  It costed like 30 bucks at that time, so it cant be that good.

Here is another SF file. The only drawback for me is that, foo_midi puts whole SF in memory, so you can sometimes see half GB memory usage just for MIDI playback


Cool, thanks! Downloading it right away! Wow, 200 MB *zipped*? That is huge indeed.

ATOH as you can't tag or manage MIDIs with foobar, maybe using another software isn't bad idea


I know. Thats no biggie though. My proposed (no mine actually) solution would be even more restrictive (no DSPs, RG, maybe not even volume control). All i want is basic playback control (play, pause, next track) and playlist. For MIDIs thats more than enough, if playback quality is the same (or compatible) with what im used to.


foobar MIDI support using system default device

Reply #11
Glad to read feedback from you, kode!

Also note that under Windows Vista and newer, the system MIDI driver defaults to the Microsoft DLS synthesizer, using the supplied 4MB Roland patch set. Reconfiguring Windows to use anything else requires one of several third party applications for modifying a registry key to point to a different MIDI device.


Wow, really??? That sucks! One more issue to add to my personal "Why I would never use Vista" list. Why would MS do this, to completely ignore and bury so deep the hardware synths provided by the soundcard? Anyway, thats off-topic, but im really shocked.

What about Windows 7? If it is the same as Vista, it kinda defeats my purpose. Would make no sense to develop a feature that would only benefit a legacy OS. While many like me still use XP, i know its a dead-end. With no "future-proof" its not worth the effort.


I could implement a driver which uses winmm streaming, or the DirectSound hack, and it would probably work with your sound card. And thanks to changes to the foobar2000 input API from 0.9, it could also reject attempts to use that driver for anything but straight playback.


Simply put, You would be my personal hero!

I refuse to implement a sound recording path just to capture the audio for visualization or conversion, though.


Fair enough, and not a problem. Im aware of the trouble of trying to do so, its not worth it. We all know DSP, RG, Conversion, DW, Visualization, etc, would not be not possible for MIDIs. Foobar would act like merely as a passthrough. Its a trade-off, and IMHO, a worthy one. Plain playback would be fine.


... Wait a minute. You're using a hardware synthesizer that just happens to be a SoundFont device? Why not just assign your favorite SoundFont to FluidSynth? I'm sure FluidSynth even works with the 4MB or 8MB or whatever sized banks that Creative bundles with their drivers, just as well as the gigantic banks that are recommended by various users.


Err... what do you mean? 'My favorite SooundFont'? You mean the one inside the soundcard? Can i somehow download (or even better, extract) the bundled synth samples that ship with my card? Is that even possible??? WOW!!!  Can i extract or convert it to a SF2, FluidSynth-compatible file? Would it then sound exaclty the same as the hardware synth? Man, that would be PERFECT! And it would change everything!

How can it be done? Ill start googling right away, but any hints or how-tos would be greatly appreciated!

foobar MIDI support using system default device

Reply #12
There is a SoundFont control panel bundled with Creative's drivers, which should show you which SoundFont you are using. It should be located in the %systemroot%\System32 folder.

With the X-Fi drivers for Vista/7, this is the 2MB bank, which just screams quality. No doubt, most people won't even notice, due to the aforementioned MIDI device setting being obscured.

Under XP, though, you're probably using the 4MB bank, which is a little better. Again, dig in the System32 folder.

foobar MIDI support using system default device

Reply #13
Hello MestreLion, kode54 and everyone , I have installed the new foo_midi component today which supports FluidSynth & Munt, and was pretty happy to see that I actually had a chance of gaining Foobar2000 to get back to being my universal player! But then it turned out to be a bit not-too-easy...

I've spent several hours trying to configure FS and MUNT, Munt is done successfully but the quality of the output is way below average, and I'm currently downloading the SF file that 2E7AH has posted earlier *thanks !* though not still sure of how i'm going to proceed with it, but anyway, I was just wondering if the MIDI data passthrough approach suggested by MastreLion could be possible with 64 bit Os'es, specifically Win Vista & 7? and I would honestly agree with the compromise in all the features that Foobar2000 offers if we get a good quality and decent MIDI playback in return.

and just to clarify a bit, I'm a musician using Guitar Pro to for music composition, and as the RSE engine is quite buggy with my PC, I've been using Winamp with Microsoft Synth or GS Wavetable for MIDI playback since 2003, and that is what I'm looking forward to seeing changed with a some added support to the current foo_midi plugin. And then I'll have Foobar2000 as the ultimate audio player at last!! and get rid of all the software I'm forced to use now (that includes Winamp, WMP, Jet Audio and all the other software I tried to get a decent MIDI playback!)...

In the meanwhile, I'll try a bit more of exploration with SF, and thanks to Kode and everyone making Foobar2000 the beautiful piece of work it has ever been !

foobar MIDI support using system default device

Reply #14
though not still sure of how i'm going to proceed with it, but anyway, I was just wondering if the MIDI data passthrough approach suggested by MastreLion could be possible with 64 bit Os'es, specifically Win Vista & 7? and I would honestly agree with the compromise in all the features that Foobar2000 offers if we get a good quality and decent MIDI playback in return.



No. I guess you didn't read what Peter says. Doing so will downgrade the user experience. Plus, you can use a XG VST. That's more than enough for MIDI playback.

foobar MIDI support using system default device

Reply #15
If you are using the Microsoft DLS synthesizer as your system synthesizer, there really is no point to using the system MIDI output, since you can achieve similar or better quality by equipping a nice SoundFont with the FluidSynth driver.

In fact, you can use a really huge SoundFont like I do sometimes. Namely, the SF2 conversion of the 44100Hz Colossus GM bank, sans the buggy drum kit. 4.5GB. It would be impossible to load all of that with even an X-Fi card, I think, and I don't think Creative's drivers support dynamically loading SoundFonts on a per-sample basis, without any interruption to the playback. (Well, depending on the output buffer size, really. If it takes a whole 5 seconds to load one sample to memory, you're going to feel the burn.)

Really, unless you have some $500 external MIDI module, there's not much you can do to top the built-in FluidSynth driver and a decent GM SoundFont bank. Well, other than using either the S-YXG2006LE XGLite VSTi (bundled with the latest Yamaha MidRadio, requires a patch I won't link to so it will work properly with this player) or S-YXG50 VSTi for full XG support. (Available with Yamaha SOL 2, or stand-alone in some questionable third party installers. Requires patch or pre-patched version so it won't fade the sound out and back in every minute outside of Yamaha VSTi hosts.)

Yeah, full XG support is about the only thing I can think of that FluidSynth lacks. That, and MT-32 support for old game soundtrack rips, but that's what MUNT is for. (And that will enable automatically for MIDI files which contain MT-32 SysEx messages. The manual selection option is only there so you can also play General MIDI files through MUNT with the General MIDI support patches pre-loaded.)