Skip to main content

Topic: foo_midi (Read 16042 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • deus-ex
  • [*][*][*][*]
foo_midi
Hi Kode54,

I was checking out the newly introduced ADLmidi emulator lately and I have a few comments/suggestions:

1. Suggestion to rearrange the foo_midi decoder configuration page in order gain more space for the FM patch drop down list, thus the entire FM patch strings are readable.
    I.e. exchange the location of the BASSMIDI and MUNT options with ADLmidi options. This way the width of the FM patch drop down list can be greatly increased.

2. Shouldn't the ADLmidi options be grayed out unless ADLmidi is the selected output plug-in?

3. Suggestion to sort the FM patch entries in alphabetical order, i.e. sort first by AIL, OP3, SB, TMB, Bisqwit, then by the game titles.
    Even better would be to have a list made of the game titles only, omitting the leading AIL, OP3, SB etc.. This list would be alphabetical sorted, showing only one game title per row which makes it quite easier to find a particular game entry.

4. Could an logic be implemented to predefine which FM patch is to be used for certain MIDI files? Like via an optional setting stored to the foobar playlist, or a config file (like <soundfont>.sflist) stored with the MIDI files.

5 AIL (Star Control 3, Albion, Empire 2, Sensible Soccer, Settlers 2, many others) = standard bank: This was the default patch file used in the AIL/MSI setup distributions (Fatman.opl).
   I suggest to add "default" in front of the game titles (default, Albion, Empire 2, ...). Also was used for the game Time Commando (developer of Little Big Adventure).

6. AIL (Kasparov's Gambit) = file15: This was also used for the game GateWorld.


Q1: Shall I provide you with additional FM patches currently not available in Foo_MIDI?
Q2: What is the file programs.txt used for? Does it belong to the recently added FMmidi emulator?

BTW, the Foo_MIDI component download page still holds a reference for FluidSynth to be built-in. And the link to the GIT hub is missing.
  • Last Edit: 16 January, 2013, 06:15:06 AM by deus-ex
Best regards
deus-ex

  • kode54
  • [*][*][*][*][*]
  • Administrator
foo_midi
Reply #1
1. Suggestion to rearrange the foo_midi decoder configuration page in order gain more space for the FM patch drop down list, thus the entire FM patch strings are readable.
    I.e. exchange the location of the BASSMIDI and MUNT options with ADLmidi options. This way the width of the FM patch drop down list can be greatly increased.

I'll look into this.

2. Shouldn't the ADLmidi options be grayed out unless ADLmidi is the selected output plug-in?

And this.

3. Suggestion to sort the FM patch entries in alphabetical order, i.e. sort first by AIL, OP3, SB, TMB, Bisqwit, then by the game titles.
    Even better would be to have a list made of the game titles only, omitting the leading AIL, OP3, SB etc.. This list would be alphabetical sorted, showing only one game title per row which makes it quite easier to find a particular game entry.

And this. You can take a look at my adlmidi repository and poke around in gen_adldata.cc, to see how to reorder the banks. Please do note that the Bisqwit 51 bank is hard coded to assume the instrument numbers that come from inserting all 51 of the previous banks in the exact order they're already in. The instruments are pruned for duplicates as they are inserted.

4. Could an logic be implemented to predefine which FM patch is to be used for certain MIDI files? Like via an optional setting stored to the foobar playlist, or a config file (like <soundfont>.sflist) stored with the MIDI files.

I can look into this, but it does sound complicated, like I would need to define how certain settings can be stored in tag presets. I would probably implement it as something that is inserted into the tag database and read back on file open, and provide context menu options to save the current playback settings to the file, load settings from the file, and also clear the tagged settings.

5 AIL (Star Control 3, Albion, Empire 2, Sensible Soccer, Settlers 2, many others) = standard bank: This was the default patch file used in the AIL/MSI setup distributions (Fatman.opl).
   I suggest to add "default" in front of the game titles (default, Albion, Empire 2, ...). Also was used for the game Time Commando (developer of Little Big Adventure).

Yes, and I also included another copy of the Fat Man set, both 2 and 4 operator versions, as bundled with Skunny 32-bit, among those OP3 sets. Yes, the generator does label that bank as a "standard" GM bank.

6. AIL (Kasparov's Gambit) = file15: This was also used for the game GateWorld.

You're welcome to add that to the generator, or I can add it.

Q1: Shall I provide you with additional FM patches currently not available in Foo_MIDI?

That would be great. If they're in formats already supported by the gen_adldata.cc in that repository, you only need to supply the bank files and information about them. If they're in different formats, it would be helpful if you could supply the format information so I can more easily write translators for them. Or you can write your own translators.

The preferred data order a translator needs to load to is, first, 11 bytes of instrument data per 2 operator voice, in this register order:

{0x20,0x23,0x60,0x63,0x80,0x83,0xE0,0xE3,0x40,0x43,0xC0};

Optionally, a semitone finetune offset per 2 operator voice.

Then, applying to the whole instrument, be it two operator, coupled two operator, or four operator, an optional note number. Per Miles banks, the note number is treated as a positive offset if in the range of 0 - 19, a fixed note if 20 - 127, or a negative offset of 128 or greater. (Negative is applied as wanted note - offset - 128.)

It is best that the banks be supplied in their original format, or at least the smallest extracted files that contain them, with instructions or C++ code for extracting them from those files as necessary. See gen_adldata.cc, it contains a bunch of LoadSomeFormat() functions, which take relative paths to the bank files, bank numbers, and bank name prefixes, and load the data into the big table of instruments and instrument map.

Q2: What is the file programs.txt used for? Does it belong to the recently added FMmidi emulator?

Yes, it's for fmmidi, which was lifted with very little modification from this program. The synthesizer does not actually appear to be designed after any particular FM chip, but rather implements a high level four operator sine wave based FM synthesizer, which is designed around a synthesizer class, containing instances of a channel class, which creates FM note generators from a note generator factory class. At initialization, the synthesizers are assigned a single note generator, and the instrument presets are loaded into the note generator.

BTW, the Foo_MIDI component download page still holds a reference for FluidSynth to be built-in. And the link to the GIT hub is missing.

Fixed.

  • deus-ex
  • [*][*][*][*]
foo_midi
Reply #2
Thank you for the update and taking my suggestions into account.

You can take a look at my adlmidi repository and poke around in gen_adldata.cc

I already looked into bisqwit's adlmidi source before raising this thread, mainly to be able to read the entire FM patch strings.

I can look into this, but it does sound complicated, like I would need to define how certain settings can be stored in tag presets. I would probably implement it as something that is inserted into the tag database and read back on file open, and provide context menu options to save the current playback settings to the file, load settings from the file, and also clear the tagged settings.

1. I understand this is not trivial to implement, thus my alternative suggestion was to just use a simple text file. Upon loading a MIDI file foo_midi would need to check if such an text file, e.g. by the (hardcoded?) file name foo_mid.fmlst, does exist and load a predefined FM patch accordingly overriding current Foo_MIDI preferences. Each entry simply would look like this:

Code: [Select]
descent.mid, intmelo.bnk
credits.mid, rickmelo.bnk
...

2. In order to derive the internal FM patch filenames a meta field containing the currently used FM patch could be made available, which would be accessible from the file properties dialog upon playback . And/or simply provide the FM patch filenames in a documentation for the foo_midi plug-in.

3. Speaking of documentation I created one myself which I include in the foo_midi archive made available on MODLAND. Please have a look and let me know your thoughts, corrections, rejections and what not.
If you think it is good enough to be included with your main distribution please fell free to do so.

Code: [Select]
MIDI Synthesizer Host, for Foobar2000 v1.1x
(c) Chris Moeller, http://kode54.foobar2000.org
https://github.com/kode54/foo_midi/commits/master
https://github.com/kode54/adlmidi
Emu de MIDI alpha by Mitsutaka Okazaki, VST Plug-in Technology by Steinberg.


Adds decoding support for General MIDI files and RIFF MIDI files as well as several
proprietary MIDI formats.


Plays through either one of the following:

· Emu de MIDI, a built-in "Chip tune"-like synthesizer (default).
   Does not require any soundfont.

· BASSMIDI, a BASS.DLL extension included with the plugin.
   Supports SF2 soundfonts. Additional soundfonts may be defined with a text file
   named <filename>.SFLIST, to be stored in the soundfonts folder. The text file
   is assumed to be UTF-8 encoded unless it contains an UTF-16LE byte order marker.
   You may copy the soundfont file names from Explorer and paste them into any
   unicode capable text editor (e.g. Notepad). The first defined soundfont is the
   base font, any following soundfonts add or replace instruments of the base font.

· Super MUNT GM, a built-in MT-32 emulator.
   Requires the PCM and control ROMs for either MT-32 or CM-32L to be located in
   the directory configured in preferences. The emulator will automatically be used
   to play any MIDI file containing MT-32 system exclusive messages, you don't need
   to select MUNT from the synthesizer list. Selecting MUNT only has an effect when
   playing non-MT-32 files in which case it automatically uploads a General MIDI
   emulation instrument set and enables an extended channel and polyphony mode to
   support the full 16 MIDI channels as well as 256 voices worth of polyphony.

· ADL MIDI, a built-in OPL3 emulator.
   Supports four-operator mode (FM synthesis) for playback of the proprietary MIDI
   formats AIL = Miles Sound System (MSI), DMX (Doom MIDI Extension), HMI (Human
   Machine Interfaces) and Creative IBK. Several built-in FM patches from a number
   of known PC games are selectable from the MIDI decoder configuration page.

· FM MIDI, a built-in Frequency Modulation emulator.
   Does not require any soundfont.

· VST instrument host.
   Plays through VST instruments installed to %programfiles%\Steinberg\VstPlugins,
   e.g. Edirol Hyper Canvas DXi VSTi. VST Instrument support requires a path to be
   configured in the Advanced section of Foobar2000's preferences before opening
   the regular MIDI decoder configuration page. It is recommended to only include
   instruments you may wish to use in this directory.


Supported formats:
.GMF .HMI, .HMP, .KAR, .LDS, .MDS, .MID, .MIDS, .MUS, .RMI, .XMI


Q1: Btw, the drop down list still isn't wide enough preventing several strings from being fully visible, so why not use the full width of the MIDI preferences screen?

Q2: What does the adlmidi setting Chips exactly do?

Q3: What do you think of my suggestion to omit leading text AIL, OP3, SB etc from the drop down list and provide an alphabetical sorted list just made of the game titles, showing one title per row/entry only? Each entry would be linked internally to the appropriate FM patch. Do you think it is feasible and convenient? If so I could edit the file gen_adldata.cc accordingly and send it to you.

Q4: Thankfully you often provide the latest release of bassmidi.dll with foo_midi (where do you get it from?). Then again included bass.dll is rather old, v2.4.7 from 2012-10-02. Is this for a reason? Btw, latest release of bass.dll I could get hold of is v2.4.9.16 from 2012-12-18.
Best regards
deus-ex

  • kode54
  • [*][*][*][*][*]
  • Administrator
foo_midi
Reply #3
1. I understand this is not trivial to implement, thus my alternative suggestion was to just use a simple text file.

I actually find the tag database easier to work with than searching for settings files on disk. The hard part is actually going to be interfacing a settings preset into the input. It would probably just involve either translating the global settings into a preset of variables, with overrides read from a binary tag structure.

You may be right that it would be a good idea to store a string or substring name for the bank, as the bank names and order could change. Well, maybe not. I was thinking that any bank additions would simply be appended to the existing list. Names could change, but bank numbers will not.

The new sorted bank list stuffs the bank numbers and their names into a list, then sorts it by the names. The configuration stores the internal bank number, not the sorted bank number.

3. Speaking of documentation I created one myself which I include in the foo_midi archive made available on MODLAND. Please have a look and let me know your thoughts, corrections, rejections and what not.
If you think it is good enough to be included with your main distribution please fell free to do so.

Cool, let's see here.

· FM MIDI, a built-in Frequency Modulation emulator.
  Does not require any soundfont.

Currently requires the programs.txt file, which is bundled. I may add an option to configure an alternate presets file, or even include an editor based on the one in fmmidi.

· VST instrument host.
  Plays through VST instruments installed to %programfiles%\Steinberg\VstPlugins,
  e.g. Edirol Hyper Canvas DXi VSTi. VST Instrument support requires a path to be
  configured in the Advanced section of Foobar2000's preferences before opening
  the regular MIDI decoder configuration page. It is recommended to only include
  instruments you may wish to use in this directory.

The program files path is misleading, as it no longer supports automatically reading VST instruments from that path. It explicitly requires a path to be configured before it will search for any instruments. It is not advised to use a path which will include too many DLL files, as it searches the entire path recursively, and a path containing a lot of files could take a long time to process.

Q1: Btw, the drop down list still isn't wide enough preventing several strings from being fully visible, so why not use the full width of the MIDI preferences screen?

Sure, I could do that.

Q2: What does the adlmidi setting Chips exactly do?

That controls how many emulated OPL3 chips are used per instance of the synthesizer. Each OPL3 chip supports 18 voices in 2 operator mode, but are actually configured for 4 voices in 4 operator mode and 10 voices in 2 operator mode. This limits the total polyphony of the synthesizer, depending on the types of instruments used.

4 operator instruments use 4 operator voices. 2 operator instruments use 2 operator voices. Pseudo 4 operator instruments (really pairs of 2 operator voices) like DMX banks use pairs of 2 operator voices.

And then full panning mode doubles the chip count and uses one set of chips for the left channel and another for the right channel.

Q3: What do you think of my suggestion to omit leading text AIL, OP3, SB etc from the drop down list and provide an alphabetical sorted list just made of the game titles, showing one title per row/entry only? Each entry would be linked internally to the appropriate FM patch. Do you think it is feasible and convenient? If so I could edit the file gen_adldata.cc accordingly and send it to you.

Actually, separate/multiple individual titles per bank should probably be handled separate from gen_adldata.cc, or at least separately from the original bank list. It should be handled as a separate list, indexed with bank numbers and game/bank titles. It could also be pre-sorted in some arbitrary order.

I think the original bank list should remain as it is, or at least in the same order, so that Bisqwit 51 still works without modification. Or you can reorder things and remake that bank.

Quote
Q4: Thankfully you often provide the latest release of bassmidi.dll with foo_midi (where do you get it from?). Then again included bass.dll is rather old, v2.4.7 from 2012-10-02. Is this for a reason? Btw, latest release of bass.dll I could get hold of is v2.4.9.16 from 2012-12-18.

I usually get it from http://un4seen.com/stuff/bassmidi.zip. As for BASS itself, I don't actually use many of the features of BASS, and I hadn't known there was a new version to update to.

  • deus-ex
  • [*][*][*][*]
foo_midi
Reply #4
The program files path is misleading, as it no longer supports automatically reading VST instruments from that path.

Right, I understand. I got that bit of information from the foo_midi component download page here on Hydrogenaudio. Looks like that page requires some more maintenance.
Here's the updated documentation for your convenience.

Code: [Select]
MIDI Synthesizer Host, for Foobar2000 v1.1x
(c) Chris Moeller, http://kode54.foobar2000.org
https://github.com/kode54/foo_midi/commits/master
https://github.com/kode54/adlmidi
Emu de MIDI alpha by Mitsutaka Okazaki, VST Plug-in Technology by Steinberg.


Adds decoding support for General MIDI files and RIFF MIDI files as well as several
proprietary MIDI formats.


Plays through either one of the following:

· Emu de MIDI, a built-in "Chip tune"-like synthesizer (default).
   Does not require any soundfont.

· BASSMIDI, a BASS.DLL extension included with the plugin.
   Supports SF2 soundfonts. Additional soundfonts may be defined with a text file
   named <filename>.SFLIST, to be stored in the soundfonts folder. The text file
   is assumed to be UTF-8 encoded unless it contains an UTF-16LE byte order marker.
   You may copy the soundfont file names from Explorer and paste them into any
   unicode capable text editor (e.g. Notepad). The first defined soundfont is the
   base font, any following soundfonts add or replace instruments of the base font.

· Super MUNT GM, a built-in MT-32 emulator.
   Requires the PCM and control ROMs for either MT-32 or CM-32L to be located in
   the directory configured in preferences. The emulator will automatically be used
   to play any MIDI file containing MT-32 system exclusive messages, you don't need
   to select MUNT from the synthesizer list. Selecting MUNT only has an effect when
   playing non-MT-32 files in which case it automatically uploads a General MIDI
   emulation instrument set and enables an extended channel and polyphony mode to
   support the full 16 MIDI channels as well as 256 voices worth of polyphony.

· ADL MIDI, a built-in OPL3 emulator.
   Supports four-operator mode (FM synthesis) for playback of the proprietary MIDI
   formats AIL = Miles Sound System (MSI), DMX (Doom MIDI Extension), HMI (Human
   Machine Interfaces) and Creative IBK. Several built-in FM patches from a number
   of known PC games are selectable from the MIDI decoder configuration page.

· FM MIDI, a built-in Frequency Modulation emulator.
   Requires the file programs.txt, included with the plugin.

· VST instrument host.
   Plays through VST instruments, e.g. Edirol Hyper Canvas DXi VSTi. Requires a
   path to be configured in the Advanced section of Foobar2000's preferences BEFORE
   opening the regular MIDI decoder configuration page. Because the entire path is
   searched recursively it is recommended to only include instruments you may wish
   to use in this directory. A path containing a lot of files may take a long time
   to process.


Supported formats:
.GMF .HMI, .HMP, .KAR, .LDS, .MDS, .MID, .MIDS, .MUS, .RMI, .XMI


I usually get it from http://un4seen.com/stuff/bassmidi.zip

Ah, I see. I didn't have this ZIP file on my radar, I was only checking for updates of the EXE/DLL files in Ian's stuff folder. Bassmidi.dll was updated recently (2012-12-28), too.

And here is a small archive containing a few FM patches currently not available in adlmidi.
Best regards
deus-ex

  • Nahkranoth
  • [*][*]
foo_midi
Reply #5
Hi kode54!

I'd like to request such a thing:


If midi file is detected as XG then (if available) use Yamaha S-YXG50 .dll for playback (as in case with MT-32 midi files).

It's quite a hassle to switch between different player plugins as for now.


  • kode54
  • [*][*][*][*][*]
  • Administrator
foo_midi
Reply #6
I'm sorry, Dave, I'm afraid I can't do that.

Perhaps you can be satisfied with preset saving. Configure the synthesizer you want to use, select all the MIDI files you want it to be used with, then right click and select Save synthesizer preset, under the Utilities submenu. Remove preset will restore the selected files to using the configured default synthesizer.

  • Nahkranoth
  • [*][*]
foo_midi
Reply #7
I'm sorry, Dave, I'm afraid I can't do that.

Perhaps you can be satisfied with preset saving. Configure the synthesizer you want to use, select all the MIDI files you want it to be used with, then right click and select Save synthesizer preset, under the Utilities submenu. Remove preset will restore the selected files to using the configured default synthesizer.


That's even better in my case  Thanks a bunch!

  • kolen734
  • [*]
foo_midi
Reply #8
Hello.

I just installed and trying to use this plugin.
When I try to open *.kar file I get "Unable to open item for playback (Unsupported file format):" message.
Am I missing anything? Could you please direct me to more information about this plugin?

Thanks in advance.

  • kode54
  • [*][*][*][*][*]
  • Administrator
foo_midi
Reply #9
Yeah, I fixed that. Stupid of me to amend the change log without actually applying the necessary changes.

  • Ligushka
  • [*]
foo_midi
Reply #10
After updating to 1.209 automatically through foobar (1.2.6), I get: Failed to load DLL: foo_midi.dll, reason: The specified procedure could not be found. 

The same appears after trying to manually install the plugin again.

  • kode54
  • [*][*][*][*][*]
  • Administrator
foo_midi
Reply #11
It would help if you could use this to indicate which libraries it is missing. Besides shared.dll and apparently ieshims.dll. It should be located under %appdata%\foobar2000\user-components\foo_midi, or under the same user-components directory inside the foobar2000 directory if you are using a portable installation.

  • Ligushka
  • [*]
foo_midi
Reply #12
According to Dependency Walker, only SHARED.DLL and IESHIMS.DLL are missing for me.

  • grimes
  • [*][*][*][*]
  • Developer
foo_midi
Reply #13
I want to report a bug with new foo_midi 1.215.
In nearly all of my midi files the last seconds were cut off during playback.
foobar2000 1.2.9, Win7

  • kode54
  • [*][*][*][*][*]
  • Administrator
foo_midi
Reply #14
This should be fixed with 1.216.

  • romor
  • [*][*][*][*][*]
foo_midi
Reply #15
Hello.

I just installed and trying to use this plugin.
When I try to open *.kar file I get "Unable to open item for playback (Unsupported file format):" message.
Am I missing anything? Could you please direct me to more information about this plugin?

Thanks in advance.


Kode54, is this really fixed, as I get error while playing karaoke midis, with latest to date, and prior version of foo_midi?
MidiBar and everything else that supports midis, plays them fine

This is the error I get in console:

Code: [Select]
Opening track for playback: "G:\income\media\karaoke\Necu_Necu_Dijamante.kar"
on_endofplayback
Decoding failure at 0:00.000 (Unsupported format or corrupted file):
"G:\income\media\karaoke\Necu_Necu_Dijamante.kar"

  • kode54
  • [*][*][*][*][*]
  • Administrator
foo_midi
Reply #16
Then it is obviously not just a renamed .MID file.

  • romor
  • [*][*][*][*][*]
foo_midi
Reply #17

  • kode54
  • [*][*][*][*][*]
  • Administrator
foo_midi
Reply #18
That file works here.

Are you sure you even have basic MIDI support working? If you have BASSMIDI selected but no working SoundFonts configured, it will pop that decode error on file start. The same goes for using MUNT or an MT-32 MIDI file without the MT-32 or CM32-L patches configured.
  • Last Edit: 22 October, 2013, 12:21:46 AM by kode54

  • romor
  • [*][*][*][*][*]
foo_midi
Reply #19
That was it. I use Windows bassmidi driver that you and mudlord prepare and wasn't aware that it has no impact on foo_midi settings, where bassmidi groupbox was set in the past to now non-existing soundfont. So, not even regular midis were playable, which I assumed it's not the case.

Sorry

  • kode54
  • [*][*][*][*][*]
  • Administrator
foo_midi
Reply #20
Yeah, foobar2000 components can't really use system synthesizers, because they usually direct their own audio output to the system in real-time. foobar2000 inputs need to be able to generate sample data internally, and on demand.

Actually, foo_midi came out before the drivers did.

Tip: If you want to keep foo_midi in sync with the SoundFont settings you use with the driver, point it to C:\Windows\bassmidi.sflist for port A, or C:\Windows\bassmidi_b.sflist for port B.

  • n99
  • [*]
foo_midi
Reply #21
Huge error in the latest update. I guess you changed the bass DLL and triggered its inbuilt anti-tampering mechanism.

It now gives this message: "This file has been tampered with and MAY BE INFECTED BY A VIRUS!"

This stops foobar2000 from working.


  • kode54
  • [*][*][*][*][*]
  • Administrator
foo_midi
Reply #22
Update it again.

  • johnsonlam
  • [*][*][*]
foo_midi
Reply #23
Just want to report ver 1.223 still have some MID file report as invalid, they can be played in my last version (should be 3 months ago).
Hong Kong - International Joke Center (after 1997-06-30)

  • kode54
  • [*][*][*][*][*]
  • Administrator
foo_midi
Reply #24
I had a little problem with my new range checking code. I repeatedly made backwards range comparisons of if ((end - it) > the_size) return fail;, instead of checking < the_size. I caught most of them before committing the final work, but missed one in the Standard MIDI track processor, where it handles System Exclusive messages. Fixed now.
  • Last Edit: 27 October, 2013, 09:28:38 AM by kode54