Author Topic: XMPlay MIDI plugin  (Read 710805 times)

kode54

  • Posts: 124
Re: XMPlay MIDI plugin
« Reply #775 on: 7 Apr '15 - 02:47 »
Regarding the above posts about the sflist format, everything looks in order now, and I'd love to see your design for an .sflist to SoundFont loader tool. Something which loads all the presets into SoundFont handles, BASS_MIDI_FONTEX structures with the instrument/channel presets in the correct priority order, and a list of handles with their gain adjustments to be applied.

You may like to take a look at the two implementations I have of a caching loader here:

https://github.com/kode54/foo_midi/blob/master/BMPlayer.cpp

and here:

https://bitbucket.org/kode54/cog/src/2f0c1b31f3014daa4cf59d64e2f402d349a0d3d9/Plugins/MIDI/MIDI/BMPlayer.cpp?at=cog

I will amend these to not perform per-path caching of handles, but rather per-path plus gain offset. I mainly do this so that track switches or restarts will not incur an unload and reload penalty, since those tend to occur in separate threads.

A Win32 version of this loader would use Win32 functions to translate the file paths from UTF-8 to UTF-16, while OS X, Linux, and most other platforms would be using the paths as-is, since they're mostly UTF-8 native. I used MSVC's own stdio translator on Windows because I was lazy. Opting to use otherwise may help in the case where the sflist is already read entirely to memory, or if it is read from a custom file API.

Ian @ un4seen

  • Administrator
  • Posts: 26172
Re: XMPlay MIDI plugin
« Reply #776 on: 9 Apr '15 - 17:40 »
Here's an updated MIDI plugin that includes the option of saving and loading the soundfont config in SFLIST format...

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

It should work as described in my previous post (except that the list order is reversed), so the supported options are: "p[target bank #,]<target patch #>" (bank is 0 if not specified), "b<target bank #>", "g<dB gain>". The plugin doesn't currently support different target and source bank/patch numbers, so any source settings (eg. the "=[source bank #,]<source patch #>" part) will be ignored, and if the target patch isn't present in the soundfont then the first patch that is present will be used instead. In the case of the "b" option, it will try bank 0 (or 128 if drums) if the target bank isn't present in the soundfont. Multiple patch/bank settings per line should be supported, although it doesn't make use of that when writing an SFLIST file. Please report any conflicts with existing SFLIST stuff or any other problems (it hasn't been tested much yet).

If all is well, I will look into adding a more complete SFLIST parser (including support for the source settings) to the MIDITEST example in the BASSMIDI package.

yoba

  • Guest
Re: XMPlay MIDI plugin
« Reply #777 on: 9 Apr '15 - 23:50 »
Something strange happen with this version
When close XMPlay - programm closed, interfase disappear, but process xmplay.exe still continue running un background, kill it through Task Manager
Maybe problems on my side, but nothing changed, just updated xm-midi from 13f to 13g, never have any troubles before
XMPlay 3.8.1.11, Win XP x32

winner

  • Posts: 306
Re: XMPlay MIDI plugin
« Reply #778 on: 10 Apr '15 - 01:33 »
Something strange happen with this version
When close XMPlay - programm closed, interfase disappear, but process xmplay.exe still continue running un background, kill it through Task Manager
Maybe problems on my side, but nothing changed, just updated xm-midi from 13f to 13g, never have any troubles before
XMPlay 3.8.1.11, Win XP x32
I've been trying xmp-midi 13g with Win7 x64. XMPlay closes fine for me and does not remain as a process in memory.

Ian @ un4seen

  • Administrator
  • Posts: 26172
Re: XMPlay MIDI plugin
« Reply #779 on: 10 Apr '15 - 12:47 »
The update does indeed appear to have a problem closing on XP. Here's another update that should fix that...

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

Let me know if you still get the problem with that.

kode54

  • Posts: 124
Re: XMPlay MIDI plugin
« Reply #780 on: 14 Apr '15 - 03:08 »
Uploaded NorfairWarfarealpha.mid, a very confused MIDI file. It includes a GS reset, then an XG reset, then some XG presets. It seems to fail to set its extra drum channels, even though they are clearly being set to bank MSB=127.

Ian @ un4seen

  • Administrator
  • Posts: 26172
Re: XMPlay MIDI plugin
« Reply #781 on: 14 Apr '15 - 14:24 »
That file seems to be playing OK here, as far as I can tell. I'm seeing channel 10 using drum kit #0 and channel 12 using drum kit #16. Should I be seeing something different? Please also confirm what soundfont you're using, in case that is having a bearing on it.

kode54

  • Posts: 124
Re: XMPlay MIDI plugin
« Reply #782 on: 14 Apr '15 - 18:47 »
Oops, I thought channel 4 was a drum, but instead it's a heartbeat or something, on the correct bank #64.

ELP

  • Posts: 22
Re: XMPlay MIDI plugin
« Reply #783 on: 7 May '15 - 22:44 »
XMPlay Midi 2 Ports:

Meta Event
Device (Port) Name

FF 09 "len" "text"

text=The name of the MIDI device (port) where the track is routed.
For example "MIDI Out 0" or "MIDI OUT 1, ....
0xFF 0x09 0x0A 0x4D 0x49 0x44 0x49 0x20 0x4F 0x75 0x74 0x20 0x30
0xFF 0x09 0x0A 0x4D 0x49 0x44 0x49 0x20 0x4F 0x75 0x74 0x20 0x31

XM MIDI dont noted these Meta Event Type for different ports.

Only the obsolete Meta-Event
for MIDI Ports

0xFF 0x21 0x01 pp 

Ok there are lots of old files with the obsolute Meta Event but also newer files with the Device Name Meta Event...
The Bass Midi plugin for Foobar from Kode54 recognize both Meta Event types for ports ;)
I think this is the best way.. if its also possible for XMplay Midi. :)

Greetings ELP
« Last Edit: 7 May '15 - 22:48 by ELP »

Ian @ un4seen

  • Administrator
  • Posts: 26172
Re: XMPlay MIDI plugin
« Reply #784 on: 8 May '15 - 14:20 »
Please upload some example MIDI files to have a look at here...

   ftp.un4seen.com/incoming/

ELP

  • Posts: 22
Re: XMPlay MIDI plugin
« Reply #785 on: 10 May '15 - 13:34 »
Ok i just create and  upl. 4 very simple examples ( and stupid :D) and one Readme for that.
BassMidi for Foobar use for the four simple Midifiles(all the same just the Meta is different) two BassMidi devices(ports) .
I dont know if there are really incoming at your ftp.... :D
So i attached the same as *7z

If its play correct you can hear two different sounds at the same time (one piano and one sitar patch both ch1, but on different ports

Greetings

BTW BassMidi do the job for different port Meta Events(standard since i was young - a long time ago :D)
in MIDIfiles much better than near all "modern big" DAWS do.
So i have to say that your BassXX is really, really great and the modern big "named" DAWS are children,
if they should load/import MIDI Files with port or devise name events. Mostly all modern DAWS simply ignore that...
and at the end you have to set the ports manually, based on the Meta Events..........



« Last Edit: 10 May '15 - 14:08 by ELP »

ELP

  • Posts: 22
Re: XMPlay MIDI plugin
« Reply #786 on: 10 May '15 - 16:16 »
3 more longer(compl.) examples created and attached:

A.Chopin op66 with R-Hand channel 1 (0x21)Port 1 L-Hand channel 1 Port 2
B.Chopin op66 with R-Hand channel 1 (0x9, len)DeviseName BassMidi 1; L-Hand channel 1 DeviseName BassMidi 2

C:and the same one(B) with Piano for R-Hand and Sitar for L Hand

both 0x9 and 0x21 meta works with FooBassMidi


----------
0x21 Meta was never official MIDI Standard.
It was(is) the cakewalk implantation for Midi ports(before there was 0x9...).
The official Meta Event for different ports is normally only 0x9; len ;  Devise Name.

But as i said, there are lots of files that use 0x21 meta messages.
So the best solution would be really to accept both metas for the BassMidi ports.

Thank you and greeting....
it´s time for a beer now ^^ :D
« Last Edit: 10 May '15 - 16:38 by ELP »

kode54

  • Posts: 124
Re: XMPlay MIDI plugin
« Reply #787 on: 11 May '15 - 02:43 »
Beware of hitting more than 2-3 devices in some files. I've encountered files where every single track is a different device name, along the lines of:

Track 1 - Channel 1 - (0x9, len)GM Device 1
Track 2 - Channel 2 - (0x9, len)GM Device 2
Track 3 - Channel 3 - (0x9, len)GM Device 3

...

Track 10 - Channel 10 - (0x9, len)GM Device 10

You get the idea. Some people don't really seem to know what they're doing with that spec.

With nonsense like that, I opted instead to check for unique device names on the same channel, and then split them into up to 3 "ports".

The real fun comes with how to properly send SysEx messages to one or all ports. I still have no idea how to do that correctly, so I just send them to all ports and hope for the best. Feel free to save us some time in citing manuals about how this mess should handle the division of SysEx messages, and it would help if that included info on GS and XG messages.


Sidestepping that topic, I really wish someone other than gmsoundfont.com had sampled the SC88, since they're charging a small fortune for individual access to their obscenely huge bank that is really just not quite optimized sampling of another vendor's sound module. Who knows if they're paying Edirol for the privilege of distributing their samples commercially?

ELP

  • Posts: 22
Re: XMPlay MIDI plugin
« Reply #788 on: 11 May '15 - 13:10 »
"Some people don't really seem to know what they're doing with that spec"
lol yes that´s true.
today much more than ever...... ;)

"The real fun comes with how to properly send SysEx messages to one or all ports."

XG Levels and the sending of SysEX to different "port" devises are spect.
XG Level 1 16 Parts(Channels) 1 Port
XG Level 2 32 Parts, 2 Ports
XG Level 3 64 Parts (Channels) 4 Port (Devises) ;)

One example for a correct SYSEX string (in an MIDI File) to XG Level 1 Devises with only 16ch one port
Reverb Send:
F0,43,10,4C,08,NN,13,XX,F7    
NN= Part No(Channel ) 0x0-0xF) 0-15
XX=Value (Data Range)

Reverb Send to Channel 1 Port 1 Value 64:
F0,43,10,4C,08,01,13,40,F7    

And the same if the SYSEX should adress an XG Level 2 Devise on Part 17= Port 2/Channel 1 if the SYSEX String is correct in the XG MIDI File!!

Reverb Send to Channel 1 Port 2 Value 64:
F0,43,10,4C,08,10,13,40,F7

The range for NN in all possible SYSEX Messages for XG Level 2 is 0-31(Channel) instead of 0-15(Channel) for XG Level 1 and
0-63(Channel) if the devise is XG Level 3 compatible.

For now if XMplay Bass Midi has 2 Devises(Ports) it could be the same like XG Level 2 gear.. ;)
So with XG SYSEX params i would -with your really great BassMIDI plugins- act like the specs and simply ignore 0x21 or 0x9 if this adress maybe Port 2 and the sysex in that track adress Port 1.
Of course as an example....

For XG no need to send SYSEX to all ports. But i am not such a great DEV like you, guys...
I am simply only an old german musican with a bad english. :D
Maybe to much Jever in my life. :D

EDIT:

And for GM/GS general SYSEX to spez. port, I would evaluate the DEVICE ID.
0x7F Device ID (Broadcast) to all ports
0x01 Device ID Address Bass Midi Device 1
0x02 Device ID Address Bass Midi Device 2
...
...
That would be completely within specification.
Also for XG general..

EDIT 2
In addition to Rolands GS ,the SYSEX and the SC-88 which has also two ports:
Not so easy to adress the ports as in XG Level 2-3 but near much the the same.
The SYSEX patch part parameter - for example- increase from 0x40-0x4F for "port 1" channel 1-16
to 0x50-0x5F for device 2 channel 1-16(17-32) ;) if you use only one MIDI IN/OUT.
Like from one MIDI File with 32 channels that splits into two BassMIDI Ports  .... ;)
Of course, just as a note.
 
« Last Edit: 11 May '15 - 15:24 by ELP »

Ian @ un4seen

  • Administrator
  • Posts: 26172
Re: XMPlay MIDI plugin
« Reply #789 on: 11 May '15 - 13:27 »
Thanks for the example files and additional info. I will look into this this week.

ELP

  • Posts: 22
Re: XMPlay MIDI plugin
« Reply #790 on: 11 May '15 - 13:56 »
Thank you Ian. :)

Ian @ un4seen

  • Administrator
  • Posts: 26172
Re: XMPlay MIDI plugin
« Reply #791 on: 12 May '15 - 17:56 »
Here's an updated MIDI plugin that should support the port/device name meta-events.

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

Note the ports/devices are ordered by their appearance in the MIDI file rather than by any numbers that may be in their text. For example, if track 1 has "midi out 2" and track 2 has "midi out 1", then "midi out 2" will be channels 1-16 and "midi out 1" will be channels 17-32. Whenever possible, multiple ports will be merged, to address the "every single track is a different device name" scenario that kode54 brought up. For example, if only channel 1 is used in port 1 and only channel 2 is used in port 2, then port 2 will be merged with port 1 so that channels 1 and 2 are used in port 1.

Let me know if there are any problems.

ELP

  • Posts: 22
Re: XMPlay MIDI plugin
« Reply #792 on: 13 May '15 - 10:37 »
This do the job for 0x21 and 0x09 Meta
Works perfect, Ian.
 8)

winner

  • Posts: 306
I've found a soundfont stacking problem introduced by xmp-midi.dll somewhere in versions 1.0.13.5 to 1.0.13.7.

I keep most incremented versions of xmp-midi.dll, but I don't have them all. By substituting dll's, I've determined that version 1.0.13.4 works properly but versions 1.0.13.7 and 1.0.13.8 do not.

Here you can see my main soundfont stacking order, showing Merlin Symphony as the first fallback soundfont.


And here you can see that I have no soundfont or presets for bank 56.


When I play a song invoking bank 56, the plugin does not use my priority Merlin Symphony soundfont, but the the next soundfont in the stack, Timbres of Heaven.


With version 1.0.13.4 of the midi plugin, the priority soundfont is properly used.


Please try to restore proper functioning. Thanks!









Ian @ un4seen

  • Administrator
  • Posts: 26172
Re: XMPlay MIDI plugin
« Reply #794 on: 15 May '15 - 18:06 »
That's strange. Please upload your soundfont config (use the "Export" option) and the MIDI file that you're playing to produce the problem...

   ftp.un4seen.com/incoming/

winner

  • Posts: 306
Re: XMPlay MIDI plugin
« Reply #795 on: 15 May '15 - 19:49 »
That's strange. Please upload your soundfont config (use the "Export" option) and the MIDI file that you're playing to produce the problem...

   ftp.un4seen.com/incoming/
The files are uploaded.

winner

  • Posts: 306
Re: XMPlay MIDI plugin
« Reply #796 on: 15 May '15 - 23:06 »
The files are uploaded.
Ian, I realized that I had temporarily assigned the Merlin Symphony soundfont to bank 56. The configuration with bank 56 unspecified has now been uploaded as "Winner Soundfont List (Corrected).sflist". This is the configuration that doesn't seem to work correctly.

Ian @ un4seen

  • Administrator
  • Posts: 26172
Re: XMPlay MIDI plugin
« Reply #797 on: 18 May '15 - 16:57 »
Thanks. I see the problem now after trying your soundfont config, and here's an update that should fix it:

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

winner

  • Posts: 306
Re: XMPlay MIDI plugin
« Reply #798 on: 18 May '15 - 23:52 »
Thanks. I see the problem now after trying your soundfont config, and here's an update that should fix it:

   www.un4seen.com/stuff/xmp-midi.dll
Thanks again, Ian! The midi files are playing correctly now with the unspecified bank 56 configuration.

brycco

  • Posts: 41
Re: XMPlay MIDI plugin
« Reply #799 on: 20 Jun '15 - 20:06 »
Can you add support for FLAC? I downloaded a fairly large SFZ file (5 GB "Ivy Audio - Piano in 162") for a piano soundfont, and it won't work. I get this error when I try to load it:

Quote
---------------------------
Missing samples
---------------------------
The following samples can't be found/loaded:

R:\Chrome Downloads\Ivy Audio - Piano in 162 sfz\Ivy Audio - Piano in 162 sfz\Piano in 162 Samples\Close\PedalOffClose\01-PedalOffPianissimo1Close.flac
R:\Chrome Downloads\Ivy Audio - Piano in 162 sfz\Ivy Audio - Piano in 162 sfz\Piano in 162 Samples\Close\PedalOffClose\01-PedalOffPianissimo2Close.flac
...
---------------------------
OK  
---------------------------
Also, possibly a bug in the Lyrics/Karaoke display:

XMPlay:


Vanbasco's:


MIDI found here: http://www.trachtman.org/rollscans/RollListing.php
« Last Edit: 20 Jun '15 - 20:41 by brycco »