libADLMIDI icon indicating copy to clipboard operation
libADLMIDI copied to clipboard

Question - How is the dos version detect FM

Open ratix98 opened this issue 9 months ago • 9 comments

I seem to have come across an odd bug while trying different sound cards. I have a soundblaster Pro2 with an authentic ymf262 chip and it plays only half the instruments during most if not all midi's I've played. the soundblaster is a CT1600 version of the card. I had tried a few things like reset the blaster variable to T5 and even T6. "SET BLASTER=A220 I5 D1 T5"

It seems to be playing in mono as i get the exact same results on a card that has an opl2 chip installed. It will also not properly play my silly instrument set I created and even drops instruments when using the regular opl2 instrument set I have made. Is this because the card is being detected improperly?

These results are also present when strictly using a card that has YM3812-F and this is expected since the opl2 has less channels and can't access the other 4 waveforms.

https://www.youtube.com/watch?v=GjSy6vebj9c

https://www.youtube.com/watch?v=WISngQyi8aI

ratix98 avatar Mar 28 '25 10:03 ratix98

Hello! In the DOS version of ADLMIDI is no detection at all, it accesses chip via constant address right now. Let me check some and allow address override... At me it worked on SoundBlaster 16, on ESS cards, on AZTech too.

Wohlstand avatar Mar 28 '25 10:03 Wohlstand

I guess, two last arguments are useless. Number of chips on hardware is always 1, even you specify explicitly, and 4ops better to don't override, otherwise you just break the behaviour if bank has 4operator voices.

Wohlstand avatar Mar 28 '25 10:03 Wohlstand

Also, if card has YM3812, then I need to slightly tweak my code to make it detect OPL2 and OPL3 and play with correct behaviour. In a case, ADLMIDI tool played like on OPL3 but on OPL2, and of course result is so messy. Also, OPL2 chip doesn't supports 4-operator voices at all, so they will play silence here.

Wohlstand avatar Mar 28 '25 10:03 Wohlstand

P.S. You wrote me in a time, in two recent days I spent on adding the proper OPL2 support, so, I only should slightly tweak the ADLMIDI tool to make it properly detect between OPL2 and OPL3 or just let user manually tell is OPL2 or OPL3 should be used.

Wohlstand avatar Mar 28 '25 11:03 Wohlstand

OK, the program works fine on the sb16, ESSFM cards, aztech soundgalaxy 16, even the OPTiFM synthesis cards and a few cards that are using creatives own implementation that I have tried. it seems to be the earlier cards give issues. This is also good news to hear that supporting opl2 is in the works.

ratix98 avatar Mar 28 '25 11:03 ratix98

Hello! Just now I made an update e92a4d7285197ab2868aa36f975d73ceee915bea where I refactored the whole logic, and additionally I added arguments:

--type [opl3|opl2] - You can specify type of chip, OPL2 or OPL3 manually
--addr <0x388>  - You can specify the address. If you run SoundBlaster Pro with dual OPL2, you can set address to 0x220, and then specify TWO chips, and... it will play on both, but not for stereo, for the extended polyphony.

Wohlstand avatar Mar 28 '25 21:03 Wohlstand

@ratix98, Please test the update once you can.

Wohlstand avatar Mar 28 '25 21:03 Wohlstand

Note: the most fresh DOS build can be taken from here: https://builds.wohlsoft.ru/dos/adlmidi-dos32.zip (built by CI, cross-compiled with DJGPP toolchain built on Linux)

Wohlstand avatar Mar 28 '25 21:03 Wohlstand

@ratix98, Please test the update once you can.

I am testing it right now. I can tell you the good news. its auto detecting my sbpro2 as an opl2 chip and its plays all the instruments it can so my regular midis that i know are adlib compatible work like how they should. After a few trial and error attempts it is working how it should. I unfortunately do not have a dual opl2 card so I cannot test.

I whipped up a few videos to show it. The second video shows that the stereo effect works and after reading up on I realized that I was typing the WRONG addr because I am terrible at reading what you wrote and kept assigning the address wrong.

The third video shows that the opl3 is indeed working as it should.

The fourth video i disabled my config.sys and autoexect.bat files and swapped out the pro2 with my I38-SGBX21 card. an 8-bit isa card that only has opl2.

Video 1 - https://youtu.be/RxFfENv8Z6c Video 2 - https://youtu.be/V9y8wEBM9DY Video 3 - https://youtu.be/o-Cm9ZmUKwc Video 4 - https://youtu.be/4tfeTsHJiNM

ratix98 avatar Mar 29 '25 13:03 ratix98

I guess I forgot to close this.

Wohlstand avatar Aug 27 '25 17:08 Wohlstand