Cleaning up NES audio output

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderator: Moderators

m00dawg
Posts: 22
Joined: Wed Jan 12, 2011 8:53 pm

Post by m00dawg »

Holy crap that was extremely helpful and informative - thank you very very much! I now understand what the clamp is doing. Electrically, I am not sure how large voltage goes to the resistors over the pin directly? I mean I understand the concept there just physically not why that's the case. But I'll take your word for it. I tried to answer those questions by Googling and noticed that voltage clamps are similar to the design you provide.

Last night I got the bug to play with Eagle so I took parts of the Cmoy and made a 3 channel pre-amp using a quad Op-Amp. Dunno if I am going to use it or not but I found it enjoyable. I could add the protection circuit to the front of that.

That said, either way, should I also use DC blockers to bias the signal to 0V as well shouldn't I? I didn't notice any bias when recording off the pins directly so I did not think it was something to worry about, but given what you mentioned, I am wondering what to do there. I thought the CMoy might be good since it has a virtual ground thing which I assume would be seen by my sampler as 0V?

Sorry for digging deep. I'm decent some some electronics but this is the first time I have had to build an audio circuit :)
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Post by lidnariq »

m00dawg wrote:Electrically, I am not sure how large voltage goes to the resistors over the pin directly? I mean I understand the concept there just physically not why that's the case. But I'll take your word for it.
You mean, what happens without the diode clamps? If there were static electricity, its discharge would cause dielectric breakdown of some part of the cpu. Try asking Youtube. :D
I could add the protection circuit to the front of [the cmoy circuit]
Shouldn't be necessary; the opamp will give its life to protect the cpu.
That said, either way, should I also use DC blockers to bias the signal to 0V as well shouldn't I? I didn't notice any bias when recording off the pins directly so I did not think it was something to worry about, but given what you mentioned, I am wondering what to do there. I thought the CMoy might be good since it has a virtual ground thing which I assume would be seen by my sampler as 0V?
Your sampler almost certainly also has a DC blocker on its input. Adding another one wouldn't hurt. You could replace the 1kohm resistor I specified above with a 1uF capacitor and 1.8kohm resistor — then that will recreate the 90Hz highpass in the normal NES audio path.
m00dawg
Posts: 22
Joined: Wed Jan 12, 2011 8:53 pm

Post by m00dawg »

lidnariq wrote:
m00dawg wrote:Electrically, I am not sure how large voltage goes to the resistors over the pin directly? I mean I understand the concept there just physically not why that's the case. But I'll take your word for it.
You mean, what happens without the diode clamps? If there were static electricity, its discharge would cause dielectric breakdown of some part of the cpu. Try asking Youtube. :D
Haha no I mean how do the diodes prevent the static form getting to the CPU if they are not in front of the pin directly? Like why does the electricity want to be fed through the resistors and diodes instead of just going back to the CPU pin?

As far as the other suggestions, those were great - thank you for that clarification! I'm not sure if I'm going to go for the op-amp or not but either way I assume I can apply the same hi-pass filter and looks like I have a few solutions in place, which is awesome!

Thanks again! I didn't see a "buy me a beer" link in your sig. You should add one :)
m00dawg
Posts: 22
Joined: Wed Jan 12, 2011 8:53 pm

Post by m00dawg »

I still have some things to think about (such as if this is all worth it over the simpler protection circuit that lidnariq specified. Or if I should add the hi-pass filter on either the protection or op-amp design, but wanted to share my work in case anyone found it useful.

Here is a quad-op-amp design based off the Cmoy. I removed the volume pot from the schematic since this might be off board (I haven't found a 3-pole trim pot to easily mount on board for instance).

Actually I am thinking I can probably omit it entirely since purpose is really for a pre-amp / protection circuit. Anyone have any thoughts on that?

I tried to keep everything on a single layer, but realized I had a ground plane anyway so I have one wire run on the underside. I think I found a match for the phono plug specs provided by Eagle out of the box, but I may change that to pin headers and use panel mount. Oh and I also forgot to include screws but don't think that would make much sense inside an NES anyway.

Anyways here there are:

board

Eagle files
User avatar
Super-Hampster
Posts: 185
Joined: Fri May 12, 2006 4:40 pm

Post by Super-Hampster »

lidnariq wrote: One, you're assuming a circuit topology different than I specified above — I never wanted the audio to go through the diodes.
Yeah, I though he was asking you why you didn't want the audio going through the diods.

But a bunch of sufficiently large resistors should have worked fine.
I was thinking about that actually. Maybe like this crudely drawn MS Paint diagram ? :

Image

I left the values off because I was just trying to draw a quick diagram, and I'll have to play with the resistor values. I don't want them so large it's too quite, but so small they don't prevent mixing. A little mixing would be ok though.
My other option would be to simply mix it in with one of the left or right channels.
Two, putting a diode in series likely won't work even out of the NES CPU itself, because most diodes have a minimum forward voltage of 0.6V and the NES audio is probably less than that.
I figured this might also be an issue.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Post by lidnariq »

m00dawg wrote:Haha no I mean how do the diodes prevent the static form getting to the CPU if they are not in front of the pin directly? Like why does the electricity want to be fed through the resistors and diodes instead of just going back to the CPU pin?
Well, first off the resistor is physically in the way, so it's obvious why it has to go through the resistor. As to the diodes...

There's no real place for an external voltage applied to the CPU pin to go. So if it's too high or too low, dielectric breakdown, magic smoke, suffering and woe. The diodes simply provide any path for the too-high voltage to go at all, rather than making a (tiny invisible) hole through your NES.
Thanks again! I didn't see a "buy me a beer" link in your sig. You should add one :)
:D
Super-Hampster wrote:
lidnariq wrote:But a bunch of sufficiently large resistors should have worked fine.
I was thinking about that actually. [...]I left the values off because I was just trying to draw a quick diagram, and I'll have to play with the resistor values. I don't want them so large it's too quiet, but so small they don't prevent mixing. A little mixing would be ok though. My other option would be to simply mix it in with one of the left or right channels.
Try this-
stereo.png
stereo.png (1.19 KiB) Viewed 6173 times
Maximum stereo separation is going to only be -20dB with 1k resistors and 10k pots, but everything I've read about it implies you don't want the NES outputs panned too hard left or right. Using 1k and 10k reflects expecting a 50k input impedance on the amp. This schematic will also let you put all three of the channels anywhere, left or right. Feel free to increase or omit the capacitors but not decrease.

edit: uploaded image instead of off-site hosting
Last edited by lidnariq on Sun May 05, 2013 6:40 pm, edited 2 times in total.
User avatar
Super-Hampster
Posts: 185
Joined: Fri May 12, 2006 4:40 pm

Post by Super-Hampster »

Try this- .... Maximum stereo separation is going to only be -20dB with 1k resistors and 10k pots, but everything I've read about it implies you don't want the NES outputs panned too hard left or right. Using 1k and 10k reflects expecting a 50k input impedance on the amp. This schematic will also let you put all three of the channels anywhere, left or right. Feel free to increase or omit the capacitors but not decrease.

It's disappointing that I can't use a data: URI for that image.
Perfect! I already have the resistors. I don't have any capacitors that small so not decreasing shouldn't be a problem. I just have to get some 10k pots because all I have are 2 50k pots and a 1k pot.
User avatar
Super-Hampster
Posts: 185
Joined: Fri May 12, 2006 4:40 pm

Post by Super-Hampster »

I just finished the circuit you suggested and tested it out. It works perfectly. Sounds great.
m00dawg
Posts: 22
Joined: Wed Jan 12, 2011 8:53 pm

Post by m00dawg »

I finished my circuit as well and it sounds amazing! Come to find out, the PowerPak may be causing actually a good bit of noise by itself so it may not be suitable to record and I may just have to rely on software emulation for that.

I haven't been able to really confirm that though since I killed 2 of my op-amp channels it looks like. I did that while trying to hook up all 3 channels and think it happened when I bridged pins 3 and 4 (accidentally) on the external connector. At least the CPU is still good.

My first few board designs weren't perfect so I am going to give it another go with a brand new board and parts. Part of the problem was that my first design was double sided though I was able to make a single-sided board by being a bit creative (the two 4.7k resistors are bounded on the bottom of the board instead of the top and each straddle one of the filtering caps).

One issue that would make this solution non desirable to many is that I needed to power the op-amp with batteries as the +5V off the regulator inside the NES is not enough to power the op-amp.

So I am thinking about using a panel mounted power connector to rig up to the back of the NES (where the other audio-outs will go). I was also thinking about using my own transformer (18V CT) as well because then I could create a true bipolar power supply. If I built it correctly, it could power both the NES and the audio board. The only problem I see there is that the NES probably cannot handle half-phase by itself so I might need to pass it a clean 9VDC signal instead - or perhaps 5VDC directly and bypass the regulator on board.

I think all that is a bit much so, for now, I think using 2 9V's should work well for my purposes. Ultimately the whole goal was good clean audio while also protecting the chip and I've done more than necessary already for that.
m00dawg
Posts: 22
Joined: Wed Jan 12, 2011 8:53 pm

Post by m00dawg »

W00! Finally it works!

I'll post the working schematic and board tomorrow but I thought I would share my findings. The design is based upon the CMoy Amplifier, as noted previously. The difference is that I am using 3 channels so I can record the PowerPak output if I so desire.

Turns out that the PowerPak is noisy as shit compared to the NES outputs which sound beautiful. So I'm not sure how feasible the PowerPak will be over using software emulation, but I do like the grungy sound of the PowerPak better than FamiTracker *shrug*
m00dawg
Posts: 22
Joined: Wed Jan 12, 2011 8:53 pm

Post by m00dawg »

Here it is, as promised! I've included parts list, Eagle layouts and some pics. Thanks for all the help! Couldn't have done it without the help!
User avatar
Jeroen
Posts: 1048
Joined: Tue Jul 03, 2007 1:49 pm

Post by Jeroen »

Can we have some recordings?
m00dawg
Posts: 22
Joined: Wed Jan 12, 2011 8:53 pm

Post by m00dawg »

Yep I plan on adding some, specifically an example of emulation sounds like over the real thing. Just haven't gotten around to it yet. I'll also see about doing a noise comparison but that might not work out very well audibly and I don't have an oscope or anything to show it visually.
m00dawg
Posts: 22
Joined: Wed Jan 12, 2011 8:53 pm

Post by m00dawg »

tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Don't worry too much about buying a scope. Anyone with a copy of Audacity can scope audio-frequency signals.
Post Reply