Closed freq-mod closed 6 years ago
The thing I must to make is processing emulation in 53267 Hz, but resample the output into 44100 hz as requested on initialization of the emulator. But thanks for noting the internal sample rate value now I finally know :wink:
But thanks for noting the internal sample rate value now I finally know
I took it from this thread: https://forums.nesdev.com/viewtopic.php?f=23&t=12772 I'm not as familiar with OPN2 as I'm with OPNA; which I know has 55466 Hz sample rate :wink:
Just now I made a small test: I have installed in my VLC properties to output OPNMIDI with 53267 hz, and sounding of my ride cymbals in a same MIDI file now is matching Nuked OPN2!
@jpcima , as you just now have made the improved resampler on Nuked OPL3, it's also needed to be made here too, BUT, also, implement the simple resampler that will be used by default. It's need to output from MAME the 53267 hz, but do post-resampling. Then, emulator will almost-match by sounding with Nuked OPN2 and real chip.
Yeah let's do it. For the normal case i'll copy-paste linear resampling code of Nuked OPN in fixed point integers.
EDIT Nuked OPN does not have a well separate resampling like there is in its OPL3 friend. I should rearrange this at some point later.
It's not all that straight-forward because MAME is not possible to drive by single frame generation. An attempt to do that is likely to make the processing cost go through the roof. So, it is obligatory to introduce an intermediate buffering, and ideally a computation to know in advance how much frames to feed in the input to obtain N frames of output. And that with zita resampling, I don't know of a full reliable way to determine it.
MAME now does native sample rate! :fox_face: :+1: So, next stuff is optional HQ Zita Re-sampler work from @jpcima which he recently made into libADLMIDI :wink:
Do you consider the drums to be now fixed? It's a note to myself, I should also also add the resampling option to Nuked like it was done in ADLMIDI.
Just checked out, it's alright now. Thanks to both of you! P.S.: about zita-resampler library; is there a windows version/build of that?
I think, it's can be easily built on MinGW since I have inspected the tarball with the resampler here: http://kokkinizita.linuxaudio.org/linuxaudio/downloads/zita-resampler-1.6.0.tar.bz2 I'll try to research the ability to build it on MinGW at my home. The only in the code is in use is PThreads thing which is available on MinGW but not on MSVC except of some ports or possible wrappers...
Yes building on MinGW is a triviality, but there isn't a ready build system for it in the source archive. Also, I think Fons Adriaensen is no longer active on his projects, so one of us can fork this and make a build system for Windows, and release a set of binaries.
That probably can be made via CMake, and yeah, I'll even can make the repo and put zita-resampler into it with the CMake builder
I'll close this as the task has been completed and confirmed! I'll copy the work over chips into OPN2 Bank Editor when I'll be at my home...
Oh, I wasn't closed it by mistake on a button... But okay that you did that by yourself :wink:
@Wohlstand I did the Zita-resampler work so you just have to pull this in your repo. The Pthread requirement was also removed so MSVC should be able to build. https://github.com/jpcima/zita-resampler
Turns out it's not so trivial:
@papiezak, std::mutex
needs for C++11 turned on. The CMake config @jpcima made uses the default behavior of given compiler as you can see.
Pull the very latest
still pretty much the same
Ok I'm going to backpedal and implement another strategy. I don't need c++11.
I've rewritten master with a version which is normally c++98 compatible. I can build it.
thanks @jpcima, pulled the very latest, now it compiles
As I reported (Wohlstand/OPN2BankEditor#7), turns out that internal sample rate doesn't match YM2612's real sample rate (53267 Hz?). Therefore many instruments such as hi-hats, cymbals, triangles, etc don't sound as they should.