Update 11/10/2012: Version 1.1.
What's new:
- Portamento (try it with the noise generator)
- Master volume control
- Pitch bend (fixed range of 2 semitones)
- Velocity sensitivity
- Legato mode (doesn't retrigger step sequencers)
- More colors
Audio Samples
Super Mario Brothers
Steps Ahead
Project Notes and Documentation

Overall module graph in SynthMaker
The NES VST is designed to emulate the 8-bit sounds of the Nintendo, remaining faithful to the specifications of the 2A03 chip. The plugin was built in Outsim SynthMaker to allow for an advanced user interface, and sounds were evaluated against the output of FamiTracker, which uses the Blip Buffer library to generate "perfect" alias-free primitive waveforms. In our project, aliasing is minimized with conventional techniques available in SynthMaker.
The following is a discussion of each 2A03 chip sound channel (Square, Triangle, Noise, and DPCM) and their implementation in SynthMaker.
Square
Our square wave was initially constructed by summing two saw waves limited at half bandwidth, which really means 1/4 of the sample rate or 11,025 hz. This was unsatisfactory and we switched to a construction from saw waves limited at nyquist. The test signal was a square wave with pulse width modulation cycling across 25%, 50%, 75%, and 12.5% pulse width. The results are compared here:

Linear sonogram of PWM square wave. The first tone is produced by SynthMaker before correction. The second and fourth tones are produced by FamiTracker. The third tone is the corrected full-bandwidth square wave produced by SynthMaker. Notice the first tone produces undesirable full bandwidth clicks when the pulse width changes. The corrected tone masks this effect.
Triangle
The Nintendo triangle wave has a distinct sound. It is produced by quantizing a triangle waveform to 16 discrete amplitudes. It also has an asymmetrical rise and fall. The falling segment of the waveform is slightly curved and the rise is linear. The triangle wave normally contains only odd harmonics, but this irregularity causes the signal to gain even harmonics, characteristic of the saw wave.

One period triangle waveform output of FamiTracker
Sample 1
4 bit quantized triangle wave, no anti-aliasing
Sample 2
4 bit quantized triangle wave, 2x oversampling, aliasing still audible
Sample 3
Nintendo triangle wave (produced by FamiTracker) vs. aliased triangle from SynthMaker.
Sample 4
Wavetable triangle vs. Nintendo triangle wave (produced by FamiTracker) This first attempt at band-limited wavetable synthesis used only 32 sample points as input. The resulting waveform does not have the high quantization harmonics.
Sample 5
Nintendo triangle wave (produced by FamiTracker) vs. band-limited wavetable triangle from SynthMaker. This time, the wavetable used 512 sample points. The sample points were also tweaked to create an asymmetric wave shape.
Triangle Oscillator Block Diagram

The final block diagram of the triangle oscillator in SynthMaker
Noise
The noise channel in the Nintendo is not noise in the usual sense, where amplitude or frequency would be modulated randomly. Instead, the NES sends a random sequence of bits directly to audio out. This is analagous to a square wave with a continuously-varying random pulse width. The NES produces noise in repeating sequences of 32767 or 93 bits. The pitch or color of the noise is variable at 16 modes. These modes are mapped to MIDI notes in our VST plugin.
The noise sequence produced by code is heavily aliased with a great deal of harmonic content above 22,050 hz. To solve this problem we subdivide time and create 8 unique output samples at every tick. These samples are merged and lowpass filtered to produce an 8x oversampled anti-aliased output.
Noise Oscillator Block Diagram

Noise oscillator in SynthMaker. Creates a new noise buffer every time a note is triggered, allowing every note to produce a unique noise pattern, characteristic of the Nintendo.
DPCM
Delta pulse code modulation is achieved by either increasing or decreasing the amplitude of the signal by a fixed interval at every sample. The signal never maintains a steady amplitude, and the amplitude climbs at a limited rate. The NES uses DPCM to play sampled audio, and does so with an amplitude resolution of 6 bits or 64 levels. We achieve realtime DPCM in code. We allow the user to select 4 custom WAV file samples and attach the samples to MIDI notes C4, D4, E4, and F4.
DPCM Oscillator Block Diagram

DPCM code section. This represents the DSP behind each "NES DPCM" module in the graph below.
Filter Section
The output is filtered by custom highpass- and lowpass-shelf filters. The filters attenuate unwanted ultra low frequency and high frequency content that may be produced by the DPCM.





Matt
/ May 3, 2013Shirley Phelps, can you elaborate a little? Did you try monophonic and turning on Legato for stacked notes/pitch slides? Also, lay off the bigotry.
MSG
/ May 11, 2013Great sounding plugin! One weird thing I noticed tough is that the pitch zeroes out at the twelfth partial which Isn't an octave (equivalent C to F#). To match my other VSTs I have to go full 12+ or -. Thanks for the free plugin!
Timaeus
/ May 22, 2013Gee, thanks for trollin, Shirley Phelps. Velocity response works just fine, and legato works as well.
BONKERS
/ May 24, 2013Hey, I LOVE this synth. But I am having a weird issue with the latest version.
Every note is offset by a Tri-tone for some reason. So a C will be an F# instead. O_O