VRC7 and 5B amplifier investigation, also VRC7 LFO reset!

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: VRC7 and 5B amplifier investigation, also VRC7 LFO reset

Post by FrankenGraphics »

The question is... did someone initially think it was a great idea, and then, did the composer/SFX programmer just not care? I guess the mapper was developed for Gimmick! especially, but maybe rather Gimmick! was made to fit their plan for a new mapper.

Besides, doesn't Gimmick! omit using the envelope feature?

There's a bit of an additional problem to this theory though. 5B being very loud to begin with sort of counteracts its usefulness as a voiceover-ducker a bit. The margin for practical use of this technique has got to be pretty narrow because of this. (On one hand, this could explain why it wasn't used as such, ultimately).
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: VRC7 and 5B amplifier investigation, also VRC7 LFO reset

Post by rainwarrior »

Relative to the APU, the 5B is not the loudest expansion. It has a logarithmic volume control, and a wider range, but its pre-compression output for a single channel only really goes up to maybe 8 db louder than an APU square can go? VRC7 can go more like 11 dB, and N163 carts might be as much as 20 dB louder in single channel mode.

The 5B is known as the "loudest" expansion because the actual output from the console is the loudest. The other expansions use passive mixing, so the APU volume is reduced to passively mix with the expansion. With the 5B it's fed into the amplifier so the output levels are kept high.

So, in terms of output it is the loudest, but it's not really the loudest from mixing/relative viewpoint (where the idea of compression and contrast should matter).


Another theory might be that Sunsoft thought the output should be as loud as is allowed, so the higher volume will have better fidelity on various televisions, and the compressor was maybe a safety device on top of this, to keep it from accidentally going too far? The end result though ended up putting a lot of squash on the Gimmick! soundtrack (...which I will soon be able to emulate somewhat faithfully, I hope).

Where other companies thought the APU volume reduction was an acceptable compromise, Sunsoft felt it was a thing to correct? This solution seems a bit overcooked to me, but I could see it happening that way. At least, it feels like a more realistic reason than the idea that someone thought it would make the mix of Gimmick!'s soundtrack better.
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: VRC7 and 5B amplifier investigation, also VRC7 LFO reset

Post by FrankenGraphics »

thanks for clarifying it. Yeah, like you said, a somewhat hot signal has the benefit of a better signal to noise/interference ratio with the risk of being overdriven at the input stage. This would depend on the output impedance, too. But that seems plausible. Is the signal hotter than consumer audio?

Lots of useful stuff here to mind for composing for the synth. The logarithmic control should mean it lends itself well to instruments with a bit of percussion or swell, but also echo/faux bucket brigade effects, quiet layers and additive sounds better than the APU.

Best of luck on the implementation! I'm looking forward to hear what the Gimmick! soundtrack sounds like with the compression in place. I always thought it was a little messy in the mix (seems a common problem with expansion soundtracks - lots of things competing for the same space both on the dynamic and spectral plane makes it a bit muddy), and now wondering if this compression might make it a bit better or a bit worse, or whether the effect is "meh" on the notability scale.
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: VRC7 and 5B amplifier investigation, also VRC7 LFO reset

Post by rainwarrior »

I don't really know what the actual voltages are, and how that compares to TV audio input specs. I've only really been concerned with stuff that's relevant to reproducing the audio in emulation.

If you want to hear it straight from the cart, I recorded the sound test a long time ago for reference:
https://forums.nesdev.com/viewtopic.php?p=90245#p90245

Actually, there's a reference recording in there where I threw a bunch of different carts in my famicom without stopping. You can see there that Gimmick's peak levels are only a little louder than the un-expanded Famicom's? (SMB / Ninja Gaiden are the plain APU reference carts used, RMS of these vs Gimmick seems about 3dB louder for Gimmick)


I think the biggest advantage of log volumes for chiptune is just that you the CPU doesn't have to multiply to lower the volume proportionally. Very natural sounding exponential decay envelopes are easier, etc. The big disadvantage is that it's hard to find a tradeoff between too wide an exponential step and a good range, especially if you've only got 4 bits to represent it like the 5B and VRC7.
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: VRC7 and 5B amplifier investigation, also VRC7 LFO reset

Post by FrankenGraphics »

Hm, if there's a difference in clarity derived from changes in the dynamics, i'm not sure i can hear it. I like it more, but it seems to stem from that there's a lowpass that i think improves it, by removing all the noisy whispers that i find a little bit interfering with the emulation based soundtrack i've been listening to. If there is an effect, it downs out for me in an a/b test because of the perceived overall improvement.

Also, even the emulated songs i listened to sounds more clear than i remembered it. I take back what i wrote.
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: VRC7 and 5B amplifier investigation, also VRC7 LFO reset

Post by rainwarrior »

You know, after all that, maybe this isn't so much a compressor as just a nonlinearity in the amplifier. (...is it still a compressor if the attack/release is instant? A waveshaper?) I think a highpass filter followed by the curve I already described is enough to more or less duplicate the effects seen.

What looked like recovery of the triangle (see earlier picture) was probably just the property of them passing back in from the flatter part of the output range. I did some more tests like playing the triangle through a louder square tone and then stopping that square in the centre rather than high or low, and the effect basically disappears. Still working on the parameters but my emulated output is already demonstrating a pretty reasonable facsimile.

Though, I think I actually do need to model a soft knee curve here after all. ;) Without a filtered delay to smooth it out that sudden discontinuity makes some pretty audible harmonic distortion. (...though maybe not that noticeable in the usual context of square waves.) Presumably the same kind of curve an analog compressor should produce, just with a less complicated control computation component since it's immediate?


Now that this seems to be on the right track, It looks like there's a different, weaker highpass applied to the compression control than actually applies to the final output. I think this threw me off for a while, because I was seeing compressed stuff with centred DC due to this disparity. Unraveling a stack of filters through this black box might be a bit tough...

On a related note, the APU channels get their own highpass before the 5B, so they have 2 (or is this 3) layers of highpass by the time they get out of the 5B? The APU Mixer page on the wiki says that a Famicom has a much weaker highpass than the NES, but in my recordings (AV mod tapping the audio return) it has a stronger one? I've been confused about this. Is there a buffer when it goes to the RF modulator, or would it still being connected have an effect... maybe I need to review my audio mod. :(
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: VRC7 and 5B amplifier investigation, also VRC7 LFO reset

Post by FrankenGraphics »

(...is it still a compressor if the attack/release is instant? A waveshaper?)
I'd still call it a compressor (in effect). Or simply nonlinear, rolled off response curve just to promote the idea of it being unintentional. It could maybe still be a measure to counteract the limited utility of the highest volume settings or to solve a loudness/clipping problem they had with their speaker setup, but i don't feel so sure about that at this point.

The use of the word may mean more than i know, but usually waveshaping is associated with the extrapolation of overtones, or just plain distortion. (BTW Digital waveshaping risks sounding harsh because of aliasing artifacts, to which you might want to add countermeasures. But that's a whole other territory).
What looked like recovery of the triangle (see earlier picture) was probably just the property of them passing back in from the flatter part of the output range
omg, yeah, that should be it. I expect it to look a bit samey even without the triangle - centering back to the resting position. Else, i think we'd be able to hear a click/pop.
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: VRC7 and 5B amplifier investigation, also VRC7 LFO reset

Post by rainwarrior »

Yes, that's why I wouldn't really want to call it a waveshaper. It's intended function doesn't appear to be distortion, that's just a side effect. Also with most of the inputs being square waves there's not much opportunity for it to act in that way. I suspect it's implemented like a compressor to, just with with a control signal that has no filter. Also I feel like waveshaper is exclusively a term for a digital effect... but anyway the semantics don't matter so much to me as the actual function. ;)
omg, yeah, that should be it. I expect it to look a bit samey even without the triangle - centering back to the resting position. Else, i think we'd be able to hear a click/pop.
The resting position is 0, all of the signals the 5B generates go from 0 to negative before the highpass. The centering test I was done by leaving the channel output held at 50% on after driving it up and down so the highpass doesn't need to shift the DC when it stops. There's a click either way but this particular test helped understand the effect of the highpass by suppressing it and seeing what its absence produces.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: VRC7 and 5B amplifier investigation, also VRC7 LFO reset

Post by lidnariq »

If this is really just a highpass filter followed by a soft-clipping amplifier ...

The time constants should be a function of the RCs present. Both for compression (which should be due the RC before the amplifier, (10kΩ//1kΩ)·C3 ) and for the DC offset return (C4·{the input impedance from the cart to whatever's recording})...
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: VRC7 and 5B amplifier investigation, also VRC7 LFO reset

Post by FrankenGraphics »

Also I feel like waveshaper is exclusively a term for a digital effect...
Funny, I immediately think of the various analog timbre manipulating effects available to synthesizer musicians. :D Reason being, analog waveshapers got popularized* for musical use in the Serge Tcherepnin synthesizer from 1973, and others followed suit, even if it has mostly been seen as a side dish, and most stage friendly synths just followed the simple VCO->VCF->VCA formula. Analog waveshapers in different configurations naturally have a renaissance in the new wave of modular synthesizers.

Here you can hear (and see) the waveshaping by that 1973 module in action.


*if that's the correct word, considering that apparently only 20 of the system sporting a three-stage waveshaper module was produced that year.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: VRC7 and 5B amplifier investigation, also VRC7 LFO reset

Post by tepples »

Analog waveshapers remained popular on electric guitar effect boxes.
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: VRC7 and 5B amplifier investigation, also VRC7 LFO reset

Post by rainwarrior »

FrankenGraphics wrote:Funny, I immediately think of the various analog timbre manipulating effects available to synthesizer musicians. :D Reason being, analog waveshapers got popularized* for musical use in the Serge Tcherepnin synthesizer from 1973, and others followed suit, even if it has mostly been seen as a side dish, and most stage friendly synths just followed the simple VCO->VCF->VCA formula. Analog waveshapers in different configurations naturally have a renaissance in the new wave of modular synthesizers.

Here you can hear (and see) the waveshaping by that 1973 module in action.
Ah, that's interesting. Having an oscilloscope built in to see the shaping is a really cool touch.

I don't remember encountering the word waveshaper outside of DAW programs, or in e.g. DSP modelling of distortion. Didn't realize it had been in use earlier like that. (...and of course obvious that there are analog ways to do it; do guitar "rectifier" pedals count as a simple one?)
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: VRC7 and 5B amplifier investigation, also VRC7 LFO reset

Post by FrankenGraphics »

Ohh sorry, that's not the module itself - only its waveform representation on an old phillips oscilloscope. I could've been more clear on that! I use something similar to that guy when testing my DIY projects 'cause i got one for free off a neighborhood garage cleanout. Lately, there have been specific oscilloscope modules for synths coming onto the market, but they're LCD based.

Here is a faithful replica description. https://www.cgs.synth.net/modules/cgs85_tws.html
If you filter out the components needed for supply and other practical measures*, the actual waveshaping is basic. Mostly, you have a bunch of diodes - most notably the diode between the + and - input of the OpAmp, and on the feedback loop you can see a diode helped by a cap in parallel to it, and regulated by a trimpot. I can see why this would be a popular guitar stompbox circuit.



Emulating this in the digital realm gets more complex since primarily, the digital resolution presents aliasing problems, and secondarily, the characteristics of the sound stem in part from the components not being ideal but having lots of little real-world quirks that comes "for free".
do guitar "rectifier" pedals count as a simple one?
I suppose so! i mean, rectification is definitely shaping the wave in an equally literal way.

The reason why these wave shapers work so well in synths is because in direct connection to the tone generation block, you have a known, constant amplitude to match against before going to a mixer or amplitude shaper. You can of course put that waveshaper somewhere else in the chain in a modular synth which opens up other interesting, often equally controllable options, but this is one of the big benefits.


*For example, having separate ac/dc coupled outputs like you can see on the module makes little sense outside the world of modular. the dc coupled one is mostly a bonus feature for using the module to experimentally modify control voltages.
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: VRC7 and 5B amplifier investigation, also VRC7 LFO reset

Post by rainwarrior »

Yeah, it's interesting to consider as part of a modular analog synthesizer. I'd seen "shape" on a knob controlling a simple oscillator before (i.e. pulse width, or square to triangle, stuff like that), but not something more arbitrary than that.

I don't collect or use analog synthesizers though, I much prefer digital synthesizers. I've played with some in the past, but if I'm interested in them it's more of a historical thing than something I want to try and make music with.

Especially I hadn't considered a waveshaper being used directly on an oscillator, before envelope/filter/etc. I'm used to it as an effect that comes later on, typically for a distortion effect, but in that situation the timbral effect is very amplitude dependent. For making the base waveform, though, I wouldn't really have considered it. Changing the shape of a wave like that, it at least has a continuous sound, but in terms of being able to dial up what you want to hear, it seems pretty terrible? In a similar way that drawing a waveform freehand tends to create a lot of mediocre buzzes. The ideal waveform creation tool for me was an FFT of that, letting you draw the spectrum you want, rather than the actual wave shape. That's something that's easy in a software synthesizer, not so practical on an analogue one, though.

So I get it, and I can see how cool a tool it is for a modular synth, but it wasn't something I'd ever encountered in my more casual experience with analog synthesizers. The oscilloscope output adds some interesting visual appeal to the process too, which would be a good reason to use it in a performance context, or even just to look at for fun. ;) On the other hand, I'd seen the term waveshaping in lots of DAWs, primarily used for distortion (and multi-band waveshaping seemed to be a huge turning point for tube distortion simulation when it happened)... so that's the semantic association I always had for that word.
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: VRC7 and 5B amplifier investigation, also VRC7 LFO reset

Post by FrankenGraphics »

Yeah having a multi-stage waveshaper like this for timbral manipulation is sort of a bit like having several daisychained operators in fm synthesis. It takes a while to get oriented and it is easy to get lost in the woods again. And if you'd stack enough stages, you'll reach a slope of diminishing returns for all your fiddling.

A practical application of waveshaping like this in analog synths is automate a pretty narrow slide or from point a to b to animate the timbre over the course of some function/low frequency oscillation. Going full range of the units' capability is effectful when you're just sitting and having some fun with all the parameters, but it isn't very practical, musically.
the ideal waveform creation tool for me was an FFT of that, letting you draw the spectrum you want, rather than the actual wave shape.
Yeah just drawing the time-amplitude function for each harmonic, like on the fairlight synthesizers (which i've never seen in real life and probably never will), seems like a very intuitive way to make nice, changing pads etc.

I haven't used DAW:s for synths in a while but probably should. When i quit, my computer back then was not near capable of complex forms of synthesis and emulated studio effects at the same time, unless i froze vst channels, so i just switched to modular at that point which was starting to become more affordable, especially if you're prepared to do some DIY stuff. Also, there's something to say about all the direct, tactile interface options (my favorite being pressure sensitive ribbons and plates) and the "start from scratch each time" method - not always helpful, but it forces me to get creative.

Another circuit that's mindbogglingly simple (hardware or software) - rather than having a sub-oscillator that you might spend time and effort on tracking perfectly, you can just pass the wave through a comparator (optionally) and then through a flip-flop and there you have it. If someone would want to add a perfectly working suboctave effect to a nes/fc cartridge, it could be had for under 50 cents. Well, you probably want to at least be able to gate it, control its volume, and/or as a third-option, envelope-follow the analog volume of the source channel.
Attachments
cou1.gif
cou1.gif (9.12 KiB) Viewed 12605 times
Post Reply