aaronsgiles / ymfm

BSD-licensed Yamaha FM sound cores (OPM, OPN, OPL, and others)
BSD 3-Clause "New" or "Revised" License
259 stars 40 forks source link

Alternative for missing set__volume() API? #53

Closed stuerp closed 11 months ago

stuerp commented 1 year ago

I'm looking to upgrade an old version of ymfm in my foobar2000 plugin. The set__volume() API has been removed. The volume parameter has also disappeared from the calculations.

When I play a song with the latest version it frankly sounds wrong.

Can anybody point me to an alternate API, please?

aaronsgiles commented 1 year ago

Where did you see a set_volume() API? I don't remember one, but thought maybe my memory was faulty so I just checked out the initial version of the code and still don't see it.

Applying volume to the final output is trivial, so I can see why there's no API for it. Also, some chips have multiple outputs, and how they are mixed is dependent upon circuitry in the specific system you are emulating, so a general set_volume doesn't make sense in that context either.

Which emulators are you using that sound "wrong"?

stuerp commented 1 year ago

I started from a copy of (PMDWin) that uses 'a' copy of ymfm. I assumed the set___volume() calls were part of some older version of the ymfm code.

PMDWin uses the OPNA driver and tweaks the volume. I can leave those calls out and the songs play. However I'm not ready yet to adapt your lastest version to have the same behavior.

aaronsgiles commented 1 year ago

I took a look at PMDWin and it's a pretty hacked up version of my code. The files opna.* are not by me (despite the copy/paste of the license header), so if you were using that as a basis, you might have trouble. You'd be better off taking the current ymfm version and using the ym2608 class directly (defined in ymfm_opn.h).