-
Notifications
You must be signed in to change notification settings - Fork 8
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Check out the OPNA chip #46
Comments
Regarding YM2608, one thing to remember: there were two versions/revisions of it.
There were rhythm channels derived from YM3301 drum machine. 6 samples, somewhat terrible quality, stored in built-in ROM. YM2608 relied on external DAC, so there were no distortions. Also, sampling freq. was higher at 55466 Hz (hi-hats sound much more convincing on 2608 IMO 😉 ) |
There is now a WIP for OPNA on my work branch. This adds "Neko Project II Kai OPNA". It plays with some glitches. This is what I know so far.
Other than this, I cleaned up warnings, I've marked code by |
I have tried to play random music on a quick hand, and I can say next:
|
I have found something related, will research the stuff after sleep: |
I converted the shift-jis encoding. Also I agree that some chip-related information be abstracted through chip-base's interface, taking precaution of avoiding virtual calls at the audio rate. I'm interested to see your handling of channels which improves playback situation, and also I forgot how is computed the frequency coefficient formula. I will look again after some rest. |
I scaled the pitch coefficient, and this fixed the frequency. |
Found ! It needs to set bit SCH "six channels" of register 0x29. |
Oh, neat! 🦊 👍 |
So, there is only some questions about ABI difference: which features are different between OPN2 and OPNA related to FM synth |
One thing I forgot, OPNA has some sort of PSG in place as I know... |
And, which sense of SSG-channels? |
It does. It's built-in YM2419 core, the same that was in ZX spectrum, Amstrad CPC, Atari ST... |
Looks like an easy solution of this: Wohlstand/libOPNMIDI#6 |
SN76489 doesn't have ADSR, just a simple 4-bit volume control. YM2419 SSG chip sounds slightly different as it's noise generator is much more sophisticated than SN crap. 2419 also has 4-bit volume control but it's just an addition to envelope generator. |
Neat! |
Anyway, I have checked out the CPU load by opnmidiplay, and loos NP2's OPNA is a bit faster than MAME 🦊 |
Yeah but it's a bit like Gens also. It's not faster in full use, but it's good at saving CPU usage from the inactive parts. MAME is a stabler CPU usage. |
I also hearing that percussions are sounding differently than on OPN2 chips, due different clock and oscilators. But also means, need to tune a bit the frequency coefficient... |
Yeah, that is because sampling frequency is different, 55466 rather than 53267 hertz. That's the reason percussion used to sound different on Gens core compared to Nuked. |
Hmmm... i checked out OPNA emulation, SSG-EG based instruments sound completely off |
Yeah it has the SSG and I reproduce the problem. Gotta debug into this. |
I'm not certain but there can be a problem with detune values... I tried porting hi-hat from some PC-9801 game and it sounded off until i (blindly) played around with detune parameters... weird. |
In BambooTracker, 8 "hard" steps means using hardware envelope which is controlled by EG frequency, C, ATT, ALT and HLD. The other 16 steps use software envelope controlled by writing volume to its level register for each tick. The volume resolution of hardware envelope is 32, finer than software envelope that it is 16. But hardware envelope cannot change envelope shape more flexible and volume scale (volume level operation is not reflected during hardware envelope execution). |
So, looks like I need to make that SW envelope for here also, like for SN which is totally lacks any envelope support. Also, @rerrahkr , can you better explain how to convert MIDI tone into SSG's tone frequency? Code I have made in my sketch branch is crap and makes completely wrong tone for now. I have the valid stuff for FM. |
Thanks for the info @rerrahkr! Looking at sketch I think there should be also an option for noise or combined noise/square wave output; that's going to be crucial for many instruments. Also, Bamboo Tracker supports arbitrary waveforms for SSG produced by hardware envelope manipulation (sawtooth, triangle), it would also be neat if possible |
SSG tone is defined as: hertz = master_clock / (64 * TP) uint32_t tp = static_cast<uint32_t>(clock / 64.0 / hertz);
WriteReg(0, 0x00 + cc * 2, static_cast<uint8_t>(0x0ff & tp));
WriteReg(0, 0x01 + cc * 2, static_cast<uint8_t>(tp >> 8)); |
Implemented the tuning. Thanks for the information. |
@rerrahkr , @jpcima , thanks you both for correction of the tone formula! Just now tested the thing, and it works! 🦊 😃 I have made few tweaks on that branch, and will continue the work that needs a deep refactoring, otherwise, current code is a mess... I have some idea to make, will try this possibly tomorrow or later... |
These are some findings about the PMD envelope generator.
It describes a variation of level over time for 2 envelope kinds, where length of steps are allowed to be controlled by a clock setting defined by user. A fitting description may be as such:
Other:
|
I noticed that chipset wasn't updated with a Neko Project 2 SSG-EG fix (Wohlstand/libOPNMIDI#81), would it be possible to backport these changes into editor? |
@Papiezak , oh, forgot, gonna to sync that change now! |
Please note, I took Nuked OPN2 as basis for comparison as I made this; This was a full rewrite of this broken part of Neko OPN, based on black-box comparison of emulator's respective curves, measured in a few different cases. |
@Papiezak , Took those changes just now |
I've taken a listen.
So could it be that these changes are wrong in context of YM2608 and resulted in "hybrid OPNA-OPN2 chip"? |
I'm pretty much sure that SSG-EG behaves same at least within YM2608, YM2610 and YM2612(and possibly YM3438) |
Anyway, when I compared SSG-EG on all emulators, in my xg.wopn, the telephone is acting slower on OPNA chips than on OPN2 |
It's not only just slower, take the "Car Engine SFX" instument from my GS bank. @nukeykt is most likely right, but if to examine SSG-EG capabilities completely, best way would be to compare emulation to real chip. |
There is a glitch on PMDWin emulator.
Even when instrument is blank/null (AR=0) loud noise will be heard that will last forever. Hitting "Shut up" button helps only a bit, you can still hear the crap, it's only much more quiet. |
I had same while experimented with Also, about Rhythm, PMDWin is totally not responds on volume levels and panning bits, and plays all instruments quite about silent, but hearable. Good that NP2 has good Rhythm implementation, so, I have completed my test 🦊 |
It's the same envelope problem as always, which makes it stuck forever at the current level. |
It also likes to cut short decay and release phases too... |
Hello. New version of PMDWin is released, with greatly improved SSG-EG emulation and few other fixes: pbarfuss/PMDWinS036#1 |
@freq-mod , uh ty, klawo! Muszę natychmiast sprawdzić, co tam jest... 👀 |
@jpcima , can you remind me, did you some own fixes on current PMDWin thing? In my memory, you did some fixes here to make it work independently if I'm not mistaken. |
Hi, I did usual things that we apply, like custom panning, but also you can check There is this one which is notable.
|
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
https://www.vogons.org/viewtopic.php?p=704730#p704730
If the OPNA chip has compatible ABI, we can try to use it as an alternative chip together with existing OPN2 chips. For the case of DAC-equipped chips, they are all will have the sample-streamer on the side of ChipSet base backend, and necessary to do that from outside. The only exception would be for OPNA that does support of ADPCM.
The text was updated successfully, but these errors were encountered: