Wohlstand / OPL3BankEditor

A small cross-platform editor of the OPL3 FM banks of different formats (Downloads in README below)
GNU General Public License v3.0
141 stars 12 forks source link

DOSBox raw importer issues #126

Closed jpcima closed 10 months ago

jpcima commented 5 years ago

There remain some elements to fix in the DRO file importer.

SBTimbre has a reset command on the Fb/Alg register C0. Despite this, the note sounds as if these have not been reset by the command. It's validated by DOSBox and also by replaying the dro file in adplay.

It seems not a misinterpretation of DRO format; I logged register writes from libadplug linked to adplay, and it also showed the sequence.

[CH00] C0: 3D   // set Con=1 Fb=6
[CH00] C0: 30   // set Con=0 Fb=0 (?)
[CH00] B0: 31   // key-on
[CH00] B0: 11   // key-off

sbtimbre-sample.tar.gz

Quoted from @gnidorah:

@jpcima Thank you! Here is the issue I've got. Lets take a single-instrument track from ultima6 as most simple case. I've tried to grab it on windows and linux dosbox multiple times (using dosbox 0.74-2 everywhere), and by some reason OPL3BankEditor always read linux capture incorrectly, while windows capture is read ok (4 instruments which don't match original versus 1 matching instrument). If I however convert linux capture into imf by dro2imf utility, OPL3BankEditor reads instrument from that imf correctly. Here are the files for demonstration: 1.zip

Apparently libadplug shows there is a header extension of DOSBox files which permits tagging. It may be needed to handle this case.

jpcima commented 5 years ago

I posted a fix and I just merged it, to make quick testing possible. It's needed to ignore the upper register bank on OPL2, which wasn't done before. I think the instruments are way better now.

ghost commented 5 years ago

@jpcima Yay, that helped, thank you! Another issue is that some instruments have no sound. Here is the zip dro+imf to compare. Setup tune from Flight of The Amazon Queen. ins 3, channel 6 ins 4, channel 7 ins 1, channel 8 As you see some ADSR values are not filled. 2.zip

jpcima commented 5 years ago

i guess it's needed to increase the total level of the carriers. I saw an implementation of this in IMF import (and in OPN2). In IMF, only 2-op algorithms are supported. In this case, I should add support of all 6 possible algorithms, because dro can also encode 4-op instruments.

jpcima commented 5 years ago

@gnidorah this is fixed in the latest, the file attached is now working.

jpcima commented 5 years ago

About the music tag format, I link the information about it. It's not required to implement it, because the format has it at the end of file, and the OPL register payload has a size field in the header.

https://github.com/adplug/adplug/blob/master/src/dro2.cpp#L91-L126 https://github.com/adplug/adplug/blob/master/src/dro.cpp#L99-L135

ghost commented 5 years ago

@jpcima That works good, thank you much! Will try more things with it later.

jpcima commented 5 years ago

That works good, thank you much! Will try more things with it later.

@gnidorah Did it work? let us know, so we can close the issue.

ghost commented 5 years ago

@jpcima Still works fine! Thank you much for the hard work!

Wohlstand commented 5 years ago

Question: does this understands rhythm-mode percussions? I guess, there are rhythm-mode percussions may exist, and there are has different way of use, I even can explain how, but, after when I'll come to my home, but in short words: in 0xBD register is the rhythm-mode bit and 5 bits are key on/off per each slot:

ghost commented 5 years ago

@Wohlstand In 2.zip/queen_000.dro "Ins 0, channel 1" is percussion (and all notes sound the same).

jpcima commented 5 years ago

Captures of SBTimbre instruments using rhythm-mode channels. They use register BD, and they are not currently recognized by the importer.

BassDrm1.dro.gz Cymbal1.dro.gz HiHat1.dro.gz Snare1.dro.gz TomTom6.dro.gz

Wohlstand commented 5 years ago

The off topic note: make rhythm mode drums for CMF importer, it's easy but I'll need to scan music tracks to identify which instruments are rhythm mode

jpcima commented 5 years ago

What's a good reference documentation on rhythm channel operation? I still try to figure out how this stuff works precisely.

Wohlstand commented 10 months ago

Closed because of no response for a long time.