Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPM core support #88

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

OPM core support #88

wants to merge 8 commits into from

Conversation

jpcima
Copy link
Collaborator

@jpcima jpcima commented Mar 6, 2019

Support the basis of YM2151. Can play back on 8 FM channels.
LFO possibly needs more work to enable.

Detune2 could be had in WOPN without a format update, becase it's stored in unused bit space of decay2_70.

#87

@jpcima
Copy link
Collaborator Author

jpcima commented Mar 8, 2019

Found here the likely source of the issue for tuning problems. It's in the resampler.
It's needed for OPM to have 64 not 144 as the scaling factor.

m_rateratio = (int32_t)(uint32_t)((((uint64_t)144 * rate) << rsm_frac) / m_clock);

In these emus (of which I just tried MAME 2151) you can't usually set clock and sampling rate in independence. Neither can we in OPN as you see, as it sets a fixed factor 144.

So I thought it's wise for chip APIs to set only the clock, and provide the appropriate native sample clock for the chip family according to the fixed divisor value.
(having nativeClockDiv and nativeClockRate, as opposed to current nativeRate and nativeClockRate)

In the future, if we'd want to match a MSX extension board, OPM would need clock 3.58 MHz; and a clock at 4 MHz which matches X68k. Native sampling rates will vary in linear relation.

@Wohlstand
Copy link
Owner

Please pull to your side my "opm" branch to fix conflicts.

@freq-mod
Copy link
Contributor

freq-mod commented Jan 7, 2021

Is it still being considered?

@Mike77154
Copy link

yeah, ading YM2151 support to this will enchace the library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants