VOGONS


my own OPL player - a bit weird?

Topic actions

First post, by deeped

User metadata
Rank Newbie
Rank
Newbie

Good evening,

Im here with my OPL problems again =)

firtly it succeed to "compile" fmopl to DLL so I can use it with delphi 😊
second, some simple test program sounded very good.

And the problem is now when Im trying to make my own DRO player. I attached the sample what my program produced, sadly its rubbish. Very bad result 🙁

still, DOSBO)( emulates it perfectly. Lets see what I do:

YM3812Init (2, 3600000, 44100);

YM3812UpdateOne (0, buffer, length / 2);

void WriteReg(port, val: byte);
{
YM3812Write(0, 0, port);
YM3812Write(0, 1, val);
}

if I just use "YM3812Write(0, port, val);" nothing sounds. Whats wrong? 😖

Attachments

  • Filename
    rec2.ogg
    File size
    305.36 KiB
    Downloads
    230 downloads
    File comment
    this is what my program generates
    File license
    Fair use/fair dealing exception

Reply 1 of 23, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Well there's sound, so it does something.
At some places it sounds like the delay between the commands is wrong,
but hard to tell without any code, without any comparison how it should
sound and everything.

Reply 2 of 23, by deeped

User metadata
Rank Newbie
Rank
Newbie

I thought everyone know the Doom's music =)

http://pastebin.com/f4ab8a0de

ok I attached the original song (what DosBOX produces, and not from an original chip).

Attachments

  • Filename
    doom_original.ogg
    File size
    325.85 KiB
    Downloads
    198 downloads
    File license
    Fair use/fair dealing exception

Reply 5 of 23, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

How shall i derive what is wrong in your code listening to one example?
The only thing i noticed i've already written above:

At some places it sounds like the delay between the commands is wrong

Reply 6 of 23, by deeped

User metadata
Rank Newbie
Rank
Newbie

Okay, then here is all code: http://pastebin.com/f47aff5e3 written in MVS 2005.

And some new records: DOTT - which sounded a bit accuracly, 90% DNUKEM2 - whics is a bit worser, 60% and dont forget DOOM wich was catastropha 😮

So, it do works with some songs but DOSBOX does it almost 100% with all games. I hope I could help 😀

Attachments

  • Filename
    recs.zip
    File size
    863.45 KiB
    Downloads
    199 downloads
    File comment
    records
    File license
    Fair use/fair dealing exception

Reply 8 of 23, by deeped

User metadata
Rank Newbie
Rank
Newbie

Well could be that the timers are simply not precise, check the delphi docs.

sadly not, its laggy in C++ too, but its not matter yet.

Is WriteStream called at millisecond resolution with appropriate parameters?

No and its not predictable when its called. Its called when the stream can accept "lenght" amount of data. "Lenght" is never the same, each calling its got another value.

Reply 10 of 23, by leileilol

User metadata
Rank l33t++
Rank
l33t++

For reference here's a rather noisy recording of Doom E1M1, ymf262. The waveforms in this should be your target 😀

A bigger challenge is Heretic E1M5, which no emulator gets right ever!

apsosig.png
long live PCem

Reply 11 of 23, by Sephiroth

User metadata
Rank Member
Rank
Member

I have all of the Doom, Doom II, Heretic, and Hexen MIDIs extracted right out of the original WADs if you want a recording of any of them. I can also fire them up on one of my old systems if you want the original sound.

486 Launcher v2.0 is now under development!

Reply 12 of 23, by leileilol

User metadata
Rank l33t++
Rank
l33t++
Sephiroth wrote:

I have all of the Doom, Doom II, Heretic, and Hexen MIDIs extracted right out of the original WADs if you want a recording of any of them.

Playing them externally wouldn't use Doom's GENMIDI lump for defined opl instruments.

apsosig.png
long live PCem

Reply 17 of 23, by deeped

User metadata
Rank Newbie
Rank
Newbie

we dont understand each other 😢

I see dosbox uses M3812UpdateOne, YM3812Init... in cases of OPL2. Thats why I only use them too. Still, it sounds different for me

EDIT: and since the ADPLUG+WINAMP plays it perfectly back, and DRO cant even record opl3 music, Im sure the mistake is not with it

Reply 18 of 23, by Grom PE

User metadata
Rank Newbie
Rank
Newbie

deeped, I think you would be interested in my opl2wav, dro/raw/imf/got player written in Delphi.
Source included, feel free to adapt it to your needs (and tell me if you make anything cool with it).