Author Topic: XMPlay MIDI plugin  (Read 706117 times)

Nukkels

  • Posts: 47
Re: XMPlay MIDI plugin
« Reply #1000 on: 1 May '21 - 06:15 »
I'm not sure how the soundfonts got removed initially, but it's most likely something I did. They seem to have stuck since I re-added them, so everything in XMPlay seems to be working as intended.

saga

  • Posts: 2748
Re: XMPlay MIDI plugin
« Reply #1001 on: 16 Aug '21 - 15:29 »
Quick question on the loopStart/loopEnd cue markers - as far as I'm aware those are not standardized, so I'm not exactly sure how loopEnd is defined - is the tick on which the loopEnd marker occurs inclusive or exclusive, i.e. should it be placed on the last tick to be played as part of the loop, or one tick after that?

Ian @ un4seen

  • Administrator
  • Posts: 26095
Re: XMPlay MIDI plugin
« Reply #1002 on: 16 Aug '21 - 17:20 »
The XMPlay MIDI plugin treats it as exclusive, ie. the end tick is not played.

saga

  • Posts: 2748
Re: XMPlay MIDI plugin
« Reply #1003 on: 24 Aug '21 - 22:39 »
Some non-standard updates have been made to the SF2 format by various tools to support compressed samples. I know there's already sf2pack, but that requires the entire sample stream to be compressed as one long sample, and this new "SF3" format has the advantage that samples are compressed individually, allowing for easier partial extraction. The changes to the format have been documented here: https://github.com/FluidSynth/fluidsynth/wiki/SoundFont3Format
In summary:
- ifil chunk major version bumped from 2 to 3
- Sample data chunk no longer padded to even size (including the LIST chunk it's contained in)
- Sample type 0x10 indicates a compressed sample
- Currently supported are Vorbis and FLAC samples (the latter obviously being more interesting).

Here's a tool that can write these files: https://github.com/KKQ-KKQ/sf2convert/releases/tag/v2.0.1
Note that there's also an "SF4" option in that tool, which is probably not too important and should be ignored. Initially SF3 only supported Vorbis, so someone went ahead and added FLAC support by bumping the major version to 4. Obviously that's not a very nice solution, so as documented on the FluidSynth wiki, it's preferable to use SF3 for FLAC samples instead.

Would it be possible to add support to xmp-midi (and BASSMIDI) for SF3? As BASSMIDI already supports arbitrary codecs through sf2pack, I suppose there's not much holding back this integration on the technical side.

Ian @ un4seen

  • Administrator
  • Posts: 26095
Re: XMPlay MIDI plugin
« Reply #1004 on: 25 Aug '21 - 15:20 »
There would be a few things to work out regarding decoder initialization but it seems like it should be possible. I'll look into it.

Ian @ un4seen

  • Administrator
  • Posts: 26095
Re: XMPlay MIDI plugin
« Reply #1005 on: 30 Aug '21 - 16:12 »
I started working on this but then I remembered that XMP-MIDI doesn't have access to XMPlay's Ogg Vorbis decoder. Unlike BASS, XMPlay doesn't currently have a centralised decoder system that plugins can use to access the decoders in XMPlay and other plugins, so XMP-MIDI instead has a hardcoded list of plugins (XMP-FLAC/WV/MPC/OPUS) that provide access to their decoders via a private extension to the XMPIN_GetInterface function. So XMP-MIDI would need to include its own Ogg Vorbis decoder, which isn't ideal and I'm not sure it's really worth adding that (and the other changes) for SF3 support. It looks like the sf2convert tool can be used to convert SF3 files back to SF2, so any such soundfonts could be used with XMPlay that way?

saga

  • Posts: 2748
Re: XMPlay MIDI plugin
« Reply #1006 on: 30 Aug '21 - 17:58 »
Personally I'd like to save some space and keep the larger soundfonts compressed as FLAC. They do add up quickly in size. :) I think FLAC is much more relevant here, so even though SF3 was initially Ogg only I'd be perfectly happy with an XMP-MIDI version that only supports FLAC.

Ian @ un4seen

  • Administrator
  • Posts: 26095
Re: XMPlay MIDI plugin
« Reply #1007 on: 31 Aug '21 - 17:30 »
Using SF2PACK instead will reduce the size even more :)

The only significant difference between SF3 and SF2PACK is that SF3 compresses the samples individually, while SF2PACK compresses them all as one. The advantage of compressing individually is that it technically permits mixing different compression (inc. no compression), which could be useful when using a lossy codec if it makes some samples sound bad, but that's not a concern when using a lossless codec like FLAC. The disadvantage of compressing individually is that each compressed sample will have its own headers, which means a larger end result. That's less of a disadvantage with FLAC than Ogg Vorbis (which has larger headers) but still some.

saga

  • Posts: 2748
Re: XMPlay MIDI plugin
« Reply #1008 on: 31 Aug '21 - 17:45 »
Well, in the interoperability is also an important point here, not just getting the file size down. :) SF2PACK mostly seems to be supported by BASS-based software, but I would like to be able to keep using those compressed soundfonts also in other softsynths that already support SF3. SFZ would be the only other option supported by all software that I want to use those soundfonts with, but it's a bit unwieldly for storing complete GM-compatible soundfonts.
I did in fact try to add SF2PACK support to OpenMPT a while ago, but the main challenge - not making the decoder always decompress the single, very large waveform but rather just small chunks required to extract a single region - turned out to be rather complex, considering that the FLAC decompression code in OpenMPT was never designed for this. SF3 on the other hand was very simple to implement, so in the end that's what I went with in OpenMPT.

Ian @ un4seen

  • Administrator
  • Posts: 26095
Re: XMPlay MIDI plugin
« Reply #1009 on: 1 Sep '21 - 17:40 »
OK, here's something for you to try:

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

It still only supports the codecs/plugins mentioned earlier (FLAC/WV/MPC/OPUS), so no Ogg Vorbis currently. Let me know if you encounter any other issues.

Regarding SF2PACK sample decoding, what XMP-MIDI/BASSMIDI does is initialize the required decoder once (with the file's "smpl" chunk content) and then use that for all decoding: loading a sample involves seeking to the sfSample dwStart position (eg. via FLAC__stream_decoder_seek_absolute in the case of FLAC) and decoding up to the dwEnd position. Unlike SF3, no changes are required to the sfSample values, so they are the same as in the original SF2 file.

saga

  • Posts: 2748
Re: XMPlay MIDI plugin
« Reply #1010 on: 1 Sep '21 - 18:15 »
Thanks, I've tested it a bit and it's working without any issues so far with my FLAC-based test SF3s. :) I guess the only obvious thing missing right now would to add the .sf3 extension to the file browser extensions.

Ian @ un4seen

  • Administrator
  • Posts: 26095
Re: XMPlay MIDI plugin
« Reply #1011 on: 2 Sep '21 - 13:00 »
Because Ogg Vorbis isn't currently supported, I thought it best not to add the SF3 extension to the soundfont file selector, to avoid confusion. It's just a secret bonus feature for now :)

saga

  • Posts: 2748
Re: XMPlay MIDI plugin
« Reply #1012 on: 2 Sep '21 - 21:45 »
Alright then. :) I'll report back if I see any issues coming up with the FLAC-based SF3s.

Duwindu Tharinda

  • Guest
Re: XMPlay MIDI plugin
« Reply #1013 on: 13 Oct '21 - 03:57 »
Hey guys!
Recently I have posted a suggestion on DSP Variation units on some other forum on this site.
As I'm used to use BASSMIDI based synths such as VMS And Falcosoft, XMPlay may not be my cup of coffee. But my ColomboGMGS2 SoundFont works fine with any XG Drumkit on BASS. In fact, apart from the standard GM/GS/XG sets, I have created my own custom drumsets in it (I mean a whole lot.)
I have renamed the XG Orchestral drum kit as XG Classical having discovered that what has to be the Orchestra kit turns out to be such a different kit in XG Mode of Yamaha S-YXG50. In fact, The GS Orchestra kit as we know don't have the High hats at the common position, instead there is a massive array of Timpanis. But the S-YXG50's Classical kit brings it up but staying in the Standard architecture putting the high hats, crashes and rides where they have to be in the standard drum map.
Anyway, sorry for bothering you with stuff may not make much sense here.
What I'm trying to ask is that whether you are trying the latest version of my SoundFont. Do the Orchestral/Classical kit sound right on XMPlay now? Also I'm so anxious to know how are other XG kits working on it...

winner

  • Posts: 305
Re: XMPlay MIDI plugin
« Reply #1014 on: 14 Oct '21 - 19:17 »
Anyway, sorry for bothering you with stuff may not make much sense here.
What I'm trying to ask is that whether you are trying the latest version of my SoundFont. Do the Orchestral/Classical kit sound right on XMPlay now? Also I'm so anxious to know how are other XG kits working on it...
Duwinda, thanks for the update. I am testing version 10.6. Note that the archive ColomboGMGS2.zip at https://musical-artifacts.com/artifacts/1234 contains version 7.5 of the soundfont and not 10.6.

Alex Mortar

  • Guest
Re: XMPlay MIDI plugin
« Reply #1015 on: 22 May '23 - 13:04 »
Is it possible to do possibility to swith sounds on soundfont, for example to swith guitar to piano, etc? It would be really good

Ian @ un4seen

  • Administrator
  • Posts: 26095
Re: XMPlay MIDI plugin
« Reply #1016 on: 23 May '23 - 13:49 »
The MIDI plugin doesn't currently have that option, but I'll check if something can be added.

Alex Mortar

  • Guest
Re: XMPlay MIDI plugin
« Reply #1017 on: 23 May '23 - 16:32 »
It would be really cool because it is very easy to work with MIDI listen via XMPlay and with bank swithing feature no DAW even needed

Ian @ un4seen

  • Administrator
  • Posts: 26095
Re: XMPlay MIDI plugin
« Reply #1018 on: 26 May '23 - 14:36 »
Here's an update for you to try:

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

It adds a row of buttons to the MIDI mixer window that display the current program numbers and give the option to override when clicked. The settings can carry over between tracks if "Reset on new track" isn't enabled, but they don't currently carry across sessions, ie. they aren't saved in the plugin's config.

Alex Mortar

  • Guest
Re: XMPlay MIDI plugin
« Reply #1019 on: 27 May '23 - 11:31 »
Thanks a lot, now it is really cool to use. File write also works fine

Firebrand

  • Posts: 30
Re: XMPlay MIDI plugin
« Reply #1020 on: 25 Jun '23 - 18:46 »
The new features it's pretty interesting, but I found a bug when you change the volume of some instruments and apply the change while MIDI files are playing, sometimes note on events get stuck and keep notes playing indefinitely, happens 80% of the time, would be nice if this could be fixed  :).

Ian @ un4seen

  • Administrator
  • Posts: 26095
Re: XMPlay MIDI plugin
« Reply #1021 on: 26 Jun '23 - 16:25 »
Do you mean that when you move a channel's volume slider in the plugin's "MIDI mixer" window, sometimes the notes in that channel don't get released? Or is it even notes in other channels? That's strange in either case, as the volume shouldn't affect whether a note is released. If there's a particular MIDI file (and channel in it) that the problem often happens with, please upload that file to try here:

   ftp.un4seen.com/incoming/

If you have a video of the problem happening, please upload that too.

redneonglow

  • Posts: 12
Re: XMPlay MIDI plugin
« Reply #1022 on: 21 Oct '23 - 01:24 »
Revision 19 completely broke MIDI playback!

Tracks freeze for 5-30 seconds before playback, and some files refuse to play at all.

EDIT: Unchecking "Preload samples" in the plugin settings seems to fix it. But I never had to do that before Revision 19.
« Last Edit: 21 Oct '23 - 01:29 by redneonglow »

Ian @ un4seen

  • Administrator
  • Posts: 26095
Re: XMPlay MIDI plugin
« Reply #1023 on: 23 Oct '23 - 11:53 »
Oops! The "Preload samples" option was indeed broken. A rev.19a update to fix that is on the XMPlay page now.

JDK88

  • Guest
Re: XMPlay MIDI plugin
« Reply #1024 on: 20 Dec '23 - 00:20 »
Using 19a. It crashes the moment it starts playing.  There seems to be a problem loading large soundfonts.