OPN2BankEditor icon indicating copy to clipboard operation
OPN2BankEditor copied to clipboard

Support for other instrument formats part 2

Open freq-mod opened this issue 6 years ago • 23 comments

Since OPN instrument format support was brought back, it seems that there are more formats that could be supported here:

  • [x] VGI (created for VGM Music maker, very close to TFI, specs: https://vgmrips.net/wiki/VGI_File_Format
  • [X] S98 (info and specs: https://vgmrips.net/wiki/S98_File_Format, supports both 2608 and 2612) BambooTracker formats, specs are provided with a source code:
    • [x] BTI
    • [x] BTI 1.4.0+
    • [ ] BTM
    • [ ] BTB
  • [x] YM2608 VGMs
  • [x] YM2151 VGMs and S98s
  • [x] MML text formats
  • [ ] PMD .FF file format
  • [ ] YM2203 VGMs
  • [ ] YM2608 Tone Editor .bank files
  • [ ] PMD .M(2) song data files

examples.zip

freq-mod avatar Mar 27 '19 18:03 freq-mod

S98 is already supported in the importer, having 2612 and 2608. In principle it supports OPL chips too, let me know if you have some.

EDIT and OPM, for which we can implement OPN2BankEditor its own support

jpcima avatar Mar 27 '19 19:03 jpcima

Ah, I forgot that there is a support for S98 already, sorry about that.

EDIT and OPM, for which we can implement OPN2BankEditor its own support

Isn't OPM supported already? Do you rather mean, in context of YM2151 chip support?

freq-mod avatar Mar 27 '19 19:03 freq-mod

Isn't OPM supported already? Do you rather mean, in context of YM2151 chip support?

YM2151 instruments have a potential to translate to the OPN because of similarity. What I mean: it's an idea to import YM2151 from the VGM and S98.

Btw, @Wohlstand has just merged the VGM for YM2608.

jpcima avatar Mar 27 '19 19:03 jpcima

As for 2151, I can't find any .s98 log of any OPM music, only VGMs. Right now, YM2151 VGMs are actually recognized by a bank editor (i.e. no error comes up) but editor doesn't see any instrument inside it

freq-mod avatar Mar 28 '19 19:03 freq-mod

For this, the VGM importer needs to handle the opcode 0x54, and transmit this to a simulated OPM chip. It's similar to RawYm2612ToWopi in the principle, except not implemented at the moment.

jpcima avatar Mar 28 '19 20:03 jpcima

BTI works fine (as of now it reads FM instruments only) but it would be neat to support BTM modules import as banks, if it would be possible.

freq-mod avatar Apr 15 '19 07:04 freq-mod

Yes definitely, I've wanted to do this too after BTI was added. Also Rerrah has released the new specification 1.2.0 which makes it needed to update BTI for this.

jpcima avatar Apr 15 '19 08:04 jpcima

I forgot about it, but YM2151 VGM/VGZs now work! The only things left are BTI v1.2 and BTMs, that will also solve "Add support for OPNA-specific bank / instrument file formats are also can be used here" task from #46 I think.

freq-mod avatar May 02 '19 15:05 freq-mod

MML support would be great to be able to use OPN2BankEditor as a sound editor for this format.

This tool (dmf2pmd.py) https://gist.github.com/Pigu-A/a51a4f3b83a238579e225e06098ba4e7 can already convert from a Deflemask module into MML, including instrument support.

farvardin avatar Aug 05 '19 07:08 farvardin

I have some problems with importing FM instruments from a certain batch of YM2151 VGMs - bank editor recognizes them as legit VGMs, but doesn't see any instruments in it, yet they're clearly there. example - 07 Easy To Go [Stage 1 Manhattan City].zip

freq-mod avatar Aug 31 '19 07:08 freq-mod

@papiezak Correct, it seems this VGM is incorrectly read. I'm going to check it.

@farvardin I totally forgot of MML also because of doing other things. Are there collections of samples of these? (and the other text formats)

jpcima avatar Aug 31 '19 11:08 jpcima

@papiezak Fixed VGM at commit a0126bc

jpcima avatar Aug 31 '19 11:08 jpcima

Are there collections of samples of these? (and the other text formats)

mmltexts.zip Here are examples of several mml formats:

  • PC-9801 PMD (OPN/OPNA)
  • PC-9801 FMP (OPN/OPNA)
  • Sega Mega Drive XPMCKC (OPN2)
  • Sharp X68000 MDX NOTE.X (OPM)
  • Sharp X1 NRTDRV (OPM)
  • FMDrive VST's own text format (OPN2)

P.S: thanks for the fix.

freq-mod avatar Aug 31 '19 11:08 freq-mod

It's neat, thanks for these. I've got to check if my parser is able to handle the whole set of these.

jpcima avatar Aug 31 '19 12:08 jpcima

Nice samples papiezak!

Here is also a working example of one of my tune, with full source and compilation process, if you need to try with pmd98, just type make compile and make play (there is also a player, using wine):

http://garvalf.online.fr/var/upload/temp/pmd98_201907.zip

farvardin avatar Aug 31 '19 17:08 farvardin

just type make compile and make play

@farvardin, yeah, but DOSbox is needed to compile the track... but it works nevertheless.

freq-mod avatar Aug 31 '19 17:08 freq-mod

It's very interesting. Thanks for sharing it.

Another thing about VGM I just remembered; it's the support of dual FM chips. It's an element of VGM specification which @Wohlstand has implemented in OPNMIDI-based midi2vgm: there exist a secondary opcode which calls the second chip, and this VGM import doesn't handle it.

VGMrips has some arcade systems with dual chip configuration.

jpcima avatar Aug 31 '19 17:08 jpcima

Many text formats are implement in the PR #82. I am apparently able to load PMD instruments from all of the samples.

The functionality is found under the "Convert" drop-down. It adds the conversions in both directions, and it uses the system clipboard.

jpcima avatar Sep 01 '19 11:09 jpcima

Thanks for all the great work @jpcima! There is one small catch though - in some .mmls there are PMD instuments of following format: @12 4 7 21 4 2 4 2 40 0 12 3 0 0 24 12 4 6 2 0 0 4 7 0 1 21 4 2 4 2 35 0 6 7 0 0 24 12 4 6 2 0 0 2 3 0 1 They aren't imported properly in bank editor, paramenters are wrongly interpreted. OPNI of how this instrument should be - @12.zip

freq-mod avatar Sep 01 '19 11:09 freq-mod

@papiezak it has 4 excess numbers in comparison to PMD samples I examined. Is this another variant? maybe it's a OPM form of PMD ?

jpcima avatar Sep 01 '19 12:09 jpcima

@jpcima, no, it's from an OPNA song

freq-mod avatar Sep 01 '19 12:09 freq-mod

@jpcima, sorry to report, but .BTI instruments import don't work anymore. Newest .bti spec is 1.4.0, trying to import it throws error about bad file format.

freq-mod avatar Jun 03 '20 09:06 freq-mod

At MML (the MML2VGM) the instrument name is supported:

'@ L4 0 "<Instrument Name Here>"

Wohlstand avatar Jan 10 '21 14:01 Wohlstand