Author Topic: XMPlay MIDI plugin  (Read 511670 times)

Ian @ un4seen

  • Administrator
  • Posts: 21130
Re: XMPlay MIDI plugin
« Reply #850 on: 27 Oct '15 - 15:27 »
Understood, thanks! But still there's tons of midi (most from games, meeted more than 40 of examples with such "bad method") which is broken on listening on that way it now dealing with noteoffs in r14, but other synths - deal perfectly with them, only r14 method now loops some of them eternally.
 I think it's important option you must add (NoteOffAll=1) to Midi plugin that must be enabled by default (or disabled if you really think r14 method are really right) and everyone can easyly disable/enable it in midi plugin GUI menu. Everybody who listen to midi (X-Midi conversions mostly have such troubles) music from Games REALLY need it, and would be gratefull.

Here's another update for you to try with those MIDI files:

   www.un4seen.com/stuff/xmp-midi.dll

It will automatically enable the "NoteOffAll" option on MIDI files that have more note-ons than note-offs, so that it should automatically get enabled for those that need it enabled and disabled for those that need it disabled. "NoteOffAll=1" can currently still be used in XMPLAY.INI to force it to be enabled always, but I might remove that option if the auto-detection works well enough to make it unnecessary.

raygrote

  • Posts: 28
Re: XMPlay MIDI plugin
« Reply #851 on: 2 Nov '15 - 09:12 »
Hi Ian,
Once again I'm coming in late with another bug report.
A few months ago I tried midi plug-in revision 13A, which had a bug where release envelopes wouldn't always play properly, and certain samples were worse than others. I temporarily switched back to Rev. 12 and reported this bug. You promptly fixed it, though I didn't get to try it until now because I was busy with other commitments and forgot. So, now that we're on Rev. 14, and this should be long forgotten as so many bugs are, I have to bring this one back. 90 percent of the time, everything sounds fine. However, the bug still manifests.
To put it simply, while release envelopes start out fine, they sometimes terminate prematurely. Some will make it all the way to what I would consider the minimum level, while others stop while the sound is still quite audible. You notice it especially during long rests, or with instruments like pianos which have undamped strings at the top end, and so will sometimes have long release envelopes put on those samples to emulate that. Also, the cutting of notes is sample dependent, I.e. just because it happens on one sample under certain conditions doesn't necessarily mean it will happen on other samples under those same conditions. That's all I can say with confidence.
To simplify this as much as I could, I've made a very small zip file which shows my experiments in trying to pinpoint this issue myself and what triggers it, and I've got something that's obvious enough to clearly hear and see, though I still am stumped as to what the root cause is. Here is a link: https://dl.dropboxusercontent.com/u/5406787/releasetests.zip
Now I'll explain what these files are attempting to show so you can hopefully pin this down.
Releasetest.mid simply contains two notes, each a second in length. The notes also have a second gap between them. Piano.sf2 and sine.sf2 are two different sound fonts I made for the pure purposes of testing for this issue. Both sound fonts are exactly the same, they each contain one sample with loop points, one instrument and one preset. They both have identical release envelopes. However the midi plug-in treats them differently.
If you play releasetest.mid using sine.sf2, you will hear two obnoxious beeps, with a second of fading in between. You can also see in the channel mixer that for a while, both notes overlap.
Now, try playing releasetest.mid with piano.sf2, which has exactly the same settings in the font, just with a piano sample instead of a single cycle sine loop. Not only can you hear a gap of pure silence in between the two notes, but you can also see it in the channel mixer. It didn't do this in Rev. 12. Decay envelopes are also unaffected to my knowledge, only releases are.
My only explanation as to what could be going on is that Perhaps the plug-in is trying to listen to each voice to determine when it is sufficiently quiet enough to be inaudible? If this is the case, it's a good concept but I think I have a case for it not to be necessary, as the release envelopes in Bass don't seem to go down ridiculously low. With loud samples you can always hear the ADSR envelopes cut after a certain point, and it's always been that way. If it were like those synths which will happily ramp down to -100 dB or lower, then I can possibly see the need for such a feature to mute voices which were potentially inaudible, but the voice limit to my understanding already knows to cut voices from quietest to loudest in terms of how much they've been attenuated. With 500 voices in Rev. 12, I rarely had voice cutting problems that were audible, with 1000 in later versions I suspect I will have even fewer problems.
Otherwise it's a great plug-in, and I see improvement in every version, even though I was being lazy and not checking in here frequently when the revisions were being made. I like the new stereo alternative panning, and what you describe about its working does make sense if that's indeed how the spec defines it. While I haven't tested SFZ support, I think I could help out a lot with that since Plogue Sforzando has a pretty good implementation of the spec, and I do use that a lot as well. I wouldn't expect Bass to quite match what Sforzando does but there's nothing saying we can't keep getting better.
Thanks for reading.

Ian @ un4seen

  • Administrator
  • Posts: 21130
Re: XMPlay MIDI plugin
« Reply #852 on: 2 Nov '15 - 17:54 »
The MIDI plugin does indeed use the level of the sample data when calculating when to stop playing a released sample, so that all samples should get stopped at around the same level. That only applies to looped samples. In your case, the piano sample reaches a low level before the sinewave sample does. I will see if it can be tweaked a bit, eg. a lower level when there aren't many samples playing.

raygrote

  • Posts: 28
Re: XMPlay MIDI plugin
« Reply #853 on: 2 Nov '15 - 20:37 »
Thanks for clearing that up, it's the only thing that made sense. Maybe there should be an option to adjust how sensitive that is, or to just turn it off altogether like it was in older versions? Maybe it's just me but I don't like envelopes cutting prematurely unless there's a reason for it, like poly limits being reached etc. Anything beyond that and I start to get worried that it'll mess up as shown here and cause problems.

Ian @ un4seen

  • Administrator
  • Posts: 21130
Re: XMPlay MIDI plugin
« Reply #854 on: 3 Nov '15 - 16:12 »
The release is lograthmic, which means it never actually reaches 0 and needs to be cut-off at some point. That point is currently at around -70 dB, but here's an update for you to try, which will lower it on a sliding scale down to around -90 dB when there are few samples playing:

   www.un4seen.com/stuff/xmp-midi.dll

Let me know how you get on with that.

raygrote

  • Posts: 28
Re: XMPlay MIDI plugin
« Reply #855 on: 3 Nov '15 - 20:25 »
Hi,
Thanks for the prompt response and update! If I understand you correctly, this version of the plug-in terminates the release envelopes slightly lower than they otherwise would be, when there are few samples playing, and so scues things down a little bit? I do notice a difference in this version, the envelopes do seem to cut a little later, but I am still confused.
I get that the releases are logarithmic and need to be cut at some point of attenuation. But my impression of the older versions of the plug-in is that they would just go down and cut when they reached that minimum attenuation, say, -70 dB since that's what you said it was. If the voice limit was reached, those samples which were closest to that -70 dB attenuation would be cut first. This makes logical sense.
But the later versions of the plug seem to go one step further and try to cut samples based on the waveform or something, before the voice limit or minimum attenuation is hit. I guess what I'm confused about is why this is necessary, since the voice limit setting which has been in the plug all along and will cut quiet samples first anyway seems sufficient.
Sorry to be so picky, I'm just a curious cat. Was there a specific scenario or reason which prompted this to be done, or am I not understanding things right?

Ian @ un4seen

  • Administrator
  • Posts: 21130
Re: XMPlay MIDI plugin
« Reply #856 on: 4 Nov '15 - 17:20 »
To clarify, there are actually several things included in the release cut-off level calculation/test: the volume envelope, the level of the sample's data, the samples's "initial attenuation" setting (in the soundfont), the note velocity. When those things combined reach -70 dB (or up to -90 dB with the update), then the sample is stopped. No sample will be stopped before reaching that level, unless the plugin runs out of voices. As an example, if the combined level of the other things is -20 dB, then the envelope has to reach -50 dB for a total of -70 dB. If you use the "WAV Writer" device to convert your test MIDI file to a WAV file with rev.14 and then inspect it in a sample editor, you should find that the piano was indeed at around -70 dB when it was stopped.

In the past (around 2.5 years ago), only the envelope was considered, and the sample would stop when that reached -40 dB. The reason for the change was to improve efficiency (no point wasting CPU on a sample that has become inaudible) but also to improve sound quality as a -40 dB cut-off was noticeable with loud samples.

nicorac

  • Posts: 40
Re: XMPlay MIDI plugin
« Reply #857 on: 5 Nov '15 - 07:23 »
Will this update be ported to bassmidi.dll too?

Ian @ un4seen

  • Administrator
  • Posts: 21130
Re: XMPlay MIDI plugin
« Reply #858 on: 5 Nov '15 - 12:31 »
Yes, yesterday :)

You can get it here:

   www.un4seen.com/stuff/bassmidi.zip

ELP

  • Posts: 22
Re: XMPlay MIDI plugin
« Reply #859 on: 17 Nov '15 - 02:25 »
Is there a chance, that
maybe GS Tone Number SysEx change also to be  ported to XMplayMidi?

I mean the same as within newer bassmidi Vxx , which work BTW. very well.

F0: Exclusive status byte
41: Manufacturer' s ID (Roland is 41)
10: Device ID (default to 10)
42: Model ID (GS message is 42)
12: Command ID (12 is Device Transmit)
40: Parameter byte
1n: Part (Channel) n 0=CH10 | 1-9 CH 1-9|A-F CH 11-16
00: Tone Number
BS: Bank Select (00 to 7F)
PC: Patch Select (00 to 7F)
XX: Check Sum
F7: End of Exclusive

Greetings
« Last Edit: 17 Nov '15 - 02:28 by ELP »

Ian @ un4seen

  • Administrator
  • Posts: 21130
Re: XMPlay MIDI plugin
« Reply #860 on: 17 Nov '15 - 13:51 »
Yep, here's an updated MIDI plugin with support for the GS "tone number" sysex message:

   www.un4seen.com/stuff/xmp-midi.dll

ELP

  • Posts: 22
Re: XMPlay MIDI plugin
« Reply #861 on: 17 Nov '15 - 19:58 »
Wow........ :)
 8)

PSXGamerPro1

  • Posts: 258
Re: XMPlay MIDI plugin
« Reply #862 on: 24 Dec '15 - 22:47 »
Now I wish there was a build of this plugin that allows you to play MIDI files the way Windows Media Player does when they do not have SoundFonts (AKA Duke Nukem's MIDI files).

Jace

  • Posts: 825
Re: XMPlay MIDI plugin
« Reply #863 on: 25 Dec '15 - 14:58 »
Downloading/making Windows' default soundfont as .sf2 file would be the best course of action.

This ought to get you on the right tracks.

captaincavern

  • Posts: 7
Re: XMPlay MIDI plugin
« Reply #864 on: 27 Dec '15 - 06:26 »
Check those out:

http://www.aimp.ru/forum/index.php?topic=38501.0 (link in post 1)

http://forum.cockos.com/showthread.php?t=62535 (link in post 5)

Using the latter since years now.  ;)

Ferb

  • Posts: 1
Re: XMPlay MIDI plugin
« Reply #865 on: 29 Dec '15 - 23:56 »
Check those out:

(link in post 1)

(link in post 5)

Using the latter since years now.  ;)

Those sound fine for some songs, but a lot of other tracks sound "off" for have weird instrument things going on with them. I've tried a lot of different versions of it but they never sound "right" compared to WMP. A good option would be to support .dls alongside .sf2 etc. I can get a recording if anyone is interested but a good example is 10004.mid from Sim City 2000. Load it up in xmplay with a converted gm.dls and compare it to this:

https://www.youtube.com/watch?v=7E2zRkgxwQU

saga

  • Posts: 2262
Re: XMPlay MIDI plugin
« Reply #866 on: 30 Dec '15 - 12:54 »
Differences in sound do not necessarily come from the conversion between DLS and SF2 but rather the different playback engines used in XMPlay and DirectMusic.

Alex M

  • Posts: 3
Re: XMPlay MIDI plugin
« Reply #867 on: 30 Dec '15 - 18:39 »
Absolutely happy to play midi using this plugin with with Musyng Kite 990MB GM/GS soundfont

Corak

  • Posts: 22
Re: XMPlay MIDI plugin
« Reply #868 on: 24 Jan '16 - 22:57 »
Yep, here's an updated MIDI plugin with support for the GS "tone number" sysex message:

   www.un4seen.com/stuff/xmp-midi.dll

Another case where r14 sounds much worse than r13 was:
http://files.leraux.ru/Corak/Temp/Bugreport/XmPlay/xmp-midi/desmond_take_five.zip

Compare the transition of sax notes. On r13 it's smooth. On r14 it's too chopping...


http://files.leraux.ru/Corak/Temp/Bugreport/XmPlay/xmp-midi/xmp-midi_r13a.zip
http://files.leraux.ru/Corak/Temp/Bugreport/XmPlay/xmp-midi/xmp-midi_r14.zip

Ian @ un4seen

  • Administrator
  • Posts: 21130
Re: XMPlay MIDI plugin
« Reply #869 on: 25 Jan '16 - 13:17 »
Oops! Rev.14 introduced a bug in mono mode (CC#126), resulting in overlapping notes being choppy as in your example file. Here's an update that should fix it:

   www.un4seen.com/stuff/xmp-midi.dll

Let me know if it still has trouble with any other files.

Corak

  • Posts: 22
Re: XMPlay MIDI plugin
« Reply #870 on: 25 Jan '16 - 13:45 »
Oops! Rev.14 introduced a bug in mono mode (CC#126), resulting in overlapping notes being choppy as in your example file. Here's an update that should fix it:
   www.un4seen.com/stuff/xmp-midi.dll
Let me know if it still has trouble with any other files.

Thanks! Now seems it fixed. If there will be some other bugs i will send trouble midi files.

kode54

  • Posts: 102
Re: XMPlay MIDI plugin
« Reply #871 on: 1 Feb '16 - 04:13 »
Should volume controller be affecting released notes? I have some old MIDI files ripped from the original PC release of Final Fantasy VII, and they play with the volume controller continuously, and ramp it back up instantly before starting new notes, which causes the tail ends of existing notes to pop up audibly before they fade out. This doesn't seem to affect some commercial synthesizers, such as Roland's Sound Canvas VA.

Ian @ un4seen

  • Administrator
  • Posts: 21130
Re: XMPlay MIDI plugin
« Reply #872 on: 1 Feb '16 - 14:03 »
I believe released notes should be affected by volume (CC#7) changes, but it's possible that some synths will stop a released note once its volume hits 0 as an optimization. I checked what a Creative soundcard and an XG synth do just now, and the Creative soundcard did stop the note when the volume was lowered to 0, but the XG synth kept playing the note so that it could be heard again when the volume was raised. The latter behaviour seems more correct to me (it's what the XMPlay plugin does), but perhaps there are some MIDI files (like the ones you've found) that depend on the former behaviour. I'm not sure there's any way to auto-detect what's best for a particular MIDI file, but perhaps an option could be added. Please upload some affected MIDI files to have a look at here:

   ftp.un4seen.com/incoming/

piovrauz

  • Posts: 970
Re: XMPlay MIDI plugin
« Reply #873 on: 2 Feb '16 - 21:24 »
If I remember it correctly, I think there are 2 version of the same ff7 midi pack, and one is for use with creative soundcards.
I'll see if I can find them again and they can help.

Edit: found them, hope it helps. FF7.7z - 406 KB
« Last Edit: 2 Feb '16 - 22:02 by piovrauz »

quanta

  • Posts: 16
XMPlay MIDI plugin: Performance regression
« Reply #874 on: 5 Feb '16 - 10:52 »
Tested system
=============
OS: Windows 98SE
Memory: 384MB
CPU: Intel Pentium II 400
Sound: ESS Solo-1
Video: Neomagic MagicMedia 256AV
XMPlay version: 3.8.0.16

When changing XMPlay MIDI plugin's performance decreases when updating from rev.12a to rev.14. Specifically, the amount of active voices in MIDI mixer can reach 107 without going red in rev.12a plugin, but the active voices value reaches red in rev.14 plugin with as little as 90 voices.