Hardware Recordings with S5B Chip

Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music.

Moderator: Moderators

tadashibashi
Posts: 25
Joined: Tue Nov 04, 2014 4:36 pm

Re: Hardware Recordings with S5B Chip

Post by tadashibashi »

ImATrackMan wrote:Your problem seems worse than mine. I use a Youkai Dochuuki cart for my N163, and I get a similar nasty hum, however it goes away permanently upon playing any N163 NSF.
I don't think the cartridge is an issue concerning the low 55Hz A, because I made an 8-channel N163 NSF that works fine without that buzzy pitch.

Here's what I mean by 'buzzy' King of Kings NSF - TNS (Buzzy)
Sorry the volume's kind of loud b/c I think it normalized when I exported these. (Also it's not PCM but you can hear the frequencies fine.)
And here is the quick test NSF that I made using all 8 channels simultaneously 8CH N163 NSF TNS

Edit: Hey, do you think you can make a recording of the NSF I attached? It's the same one that I recorded. I want to hear if there is a difference in cartridges. I have an AV Famicom, but I don't think that should make too big of a difference, right?
rainwarrior wrote:I seem to recall that both the NSFs for the 8 channel N163 games King of Kings and Erika to Satoru no Yumebouken are broken. The problem seems subtle on emulators (e.g. muted channels) but it might be worse in a hardware situation?
I think you're probably right.
Attachments
N163 8-Ch Test.nsf
(8 KiB) Downloaded 222 times
tadashibashi
Posts: 25
Joined: Tue Nov 04, 2014 4:36 pm

Re: Hardware Recordings with S5B Chip

Post by tadashibashi »

ImATrackMan wrote:I might have bumped the volume of the YMZ just a tad (for preference, it's still way under what it would sound like on an AV Famicom)
Hey TrackMan, I think your settings on the YMZ294 is based on how FamiTracker and NSFPlay mixes SS-5B. I just wrote a piece for the 5B and noticed that the balance of the 5B used in Gimmick! is proportionally much higher than how Famitracker/NSFPlay mixes it. When I turned it down to about your mixing level in the image (bumped down a tad), it matched what Famitracker was outputting.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Hardware Recordings with S5B Chip

Post by rainwarrior »

NSFPlay matches measurements I made from my own Gimmick cartridge. 2A03 output levels vary, and on top of that in-cart mixing varies from cart to cart, so it's not easy to get an authoritative "correct" mixing. We might be talking about a 10% resistor tolerance, but the variation is compounded at each stage of the mixing, so it can accumulate to much more than that.
tadashibashi
Posts: 25
Joined: Tue Nov 04, 2014 4:36 pm

Re: Hardware Recordings with S5B Chip

Post by tadashibashi »

Ah I see, so there really isn't a set standard :shock:
What is FT's mixing based off of?
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Hardware Recordings with S5B Chip

Post by tepples »

Use the source, Luke! Here are relevant snippets from Mixer.cpp:

Code: Select all

/*
 Mixing of internal audio relies on Blargg's findings

 [Mixing levels of]
 N163 & 5B are still unknown
*/

inline double CMixer::CalcPin1(double Val1, double Val2) {
  if ((Val1 + Val2) > 0) {
    return 95.88 / ((8128.0 / (Val1 + Val2)) + 100.0);
  }
  return 0;
}

inline double CMixer::CalcPin2(double Val1, double Val2, double Val3) {
  if ((Val1 + Val2 + Val3) > 0) {
    return 159.79 / ((1.0 / ((Val1 / 8227.0) + (Val2 / 12241.0)
                        + (Val3 / 22638.0))) + 100.0);
  }
  return 0;
}
And from Mitsutaka Okazaki's emu2149.c, the volume levels are thus:

Code: Select all

{0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x07, 0x09,
   0x0B, 0x0D, 0x0F, 0x12,
   0x16, 0x1A, 0x1F, 0x25, 0x2D, 0x35, 0x3F, 0x4C, 0x5A, 0x6A, 0x7F, 0x97,
   0xB4, 0xD6, 0xFF, 0xFF}
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Hardware Recordings with S5B Chip

Post by rainwarrior »

That doesn't answer tadashibashi's question. The question is what the relative level of 5B to 2A03 in Famitracker is based on. This was some decision made by jsr, so you'd have to ask him (unless there is a comment about it in the source). You might try the Famitracker Forums, as I don't know if he'll see this thread.

What you posted, tepples, is part of the nonlinear mix for each of those chips separately. The 2A03's is following Blarrg's nonlinearity formula (which is a rough approximation), and the 5B's is an 8-bit approximation of the log output of the YM2149, which is described in the YM2149 datasheet. Neither of these describes the relative level of their output, or more importantly why that relative level was chosen.
User avatar
ImATrackMan
Posts: 37
Joined: Thu Mar 26, 2015 6:34 pm
Contact:

Re: Hardware Recordings with S5B Chip

Post by ImATrackMan »

I based my 5B mixing on Rainwarrior's Gimmick! cart and bumped the volume a tad (maybe .4 dB) for preference, but besides that, all expansions are based on the NSFs vs. actual gameplay on games that I physically own. Every cartridge and FC has its own mixing variance. For example, any expansion game when used on an AV Famicom will have its expansion mixed much louder than on any RF Famicom.
tadashibashi
Posts: 25
Joined: Tue Nov 04, 2014 4:36 pm

Re: Hardware Recordings with S5B Chip

Post by tadashibashi »

ImATrackMan wrote:I based my 5B mixing on Rainwarrior's Gimmick! cart and bumped the volume a tad (maybe .4 dB) for preference


Yeah I had to bring mine to the same level since I had been playing back my FTM in FT and NSF in NSFPlay. Both levels seem pretty similar.
For example, any expansion game when used on an AV Famicom will have its expansion mixed much louder than on any RF Famicom.
Then wouldn't the pots of HFX4 on both AV and RF need to be about the same position (comparing our levels) to produce the levels of cartridge recordings produced by each respective system? Or is it b/c the TNS outputs audio on its own and doesn't come out of the Famicom? Or could it be that each TNS-HFC/HFX has its own variances in mixing levels? haha.. argh
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Hardware Recordings with S5B Chip

Post by lidnariq »

tadashibashi wrote:Or is it b/c the TNS outputs audio on its own and doesn't come out of the Famicom?
That one.
jsr
Posts: 42
Joined: Thu Oct 07, 2004 2:47 am
Contact:

Re: Hardware Recordings with S5B Chip

Post by jsr »

tadashibashi wrote:Ah I see, so there really isn't a set standard :shock:
What is FT's mixing based off of?
The mixing in FT is based on rainwarrior's NSFplay at the moment since I haven't done my own measurements yet.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Hardware Recordings with S5B Chip

Post by rainwarrior »

tadashibashi wrote:
For example, any expansion game when used on an AV Famicom will have its expansion mixed much louder than on any RF Famicom.
Or is it b/c...
The situation is even worse that you might hope. Because each of the two channels coming from the 2A03 has its own resistor adding variance, not only does the overall 2A03 mix level vary between machines, but so does the mix between the squares channel and the tri/noise/dpcm channel.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Hardware Recordings with S5B Chip

Post by lidnariq »

rainwarrior wrote:Because each of the two channels coming from the 2A03 has its own resistor adding variance [...] the mix between the squares channel and the tri/noise/dpcm channel [varies between machines]
But that should only be a decibel or so...

12kΩ×1.05 ÷ (12kΩ×1.05 + 20kΩ×0.95) ≈ .399
12kΩ×0.95 ÷ (12kΩ×0.95 + 20kΩ×1.05) ≈ .352
.399 ÷ .352 ≈ 1.13 ; 20×log₁₀(1.13) ≈ 1.09dB

Which ... I guess, given that ImATrackMan mentioned fiddling with a volume adjustment of 0.4dB, I guess that's comparatively huge.

But that's "absolute highest possible error" to "absolute lowest possible error"; in practice 5% carbon-film resistors like those used in the NES have the correct value within a gaussian distribution with 3σ ≈ ±5%.

(Unlike 10% or worse resistors, 5% resistors are approximately "as good as it gets" for the technology, so it actually is gaussian (q.v.) while it's moderately-well-accepted that lower-precision resistors have the sweet spot cut out in the middle from a measure-and-bin stage.
tadashibashi
Posts: 25
Joined: Tue Nov 04, 2014 4:36 pm

Re: Hardware Recordings with S5B Chip

Post by tadashibashi »

Sorry to sway the conversation, but I just used a breadboard to connect Gimmick! to the YMZ294 port and my set up didn't work. I put D0-D7 in the right places, the Gimmick Audio to RF (pin46) to YMZ Sound Out (pin5), Gimmick M2 to YMZ Master Clock (pin7), the ROMSEL to CS and WR to R/W. I also put the 5v to 5v but removed it when nothing changed. There was a loud hum with static happening in rhythm so it seems like the data from D0-D7 was doing something? But I just gave up since have no clue what else I could do. Would the A0-A14 pins need something inputted to them? As a side note, my cartridge connector is stuck inside my Gimmick cartridge : P
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Hardware Recordings with S5B Chip

Post by lidnariq »

Yeah, you need to tie Gimmick's CPU A14 (pin 35) input high and connect Gimmick CPU A13 (pin 34) to YMZ294 A0.

You "should" tie the other input pins high or low, but that might not be necessary.
tadashibashi
Posts: 25
Joined: Tue Nov 04, 2014 4:36 pm

Re: Hardware Recordings with S5B Chip

Post by tadashibashi »

lidnariq wrote:Yeah, you need to tie Gimmick's CPU A14 (pin 35) input high and connect Gimmick CPU A13 (pin 34) to YMZ294 A0.

You "should" tie the other input pins high or low, but that might not be necessary.
Sorry, what does 'high' and 'low' mean?

Edit: and 'tie'? Just want to make sure I understand accurately.
Last edited by tadashibashi on Sun Jun 14, 2015 10:25 pm, edited 1 time in total.
Post Reply