The NESIZER

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
The NESIZER
by on (#145361)
Hi :)

It's been a while since I was here last time, but I thought I'd post a project I've been working on for the last year or so: The NESIZER. It's basically a little synthesizer module using the 2A03 (or a 2A07 or Dendy clone). It has buttons and a display for programming patches / sounds and battery backed memory to store them. It can be played via MIDI, or sequences and tracks can be made using an in-built sequencer (not finished writing the software for that yet).

The hardware is basically centered around a microcontroller (Atmel ATmega328) doing all the work, with the 6502 just idling and updating APU registers. The idea was inspired by the TSUNDERE project which takes a similar approach which I simplified to a way that requires no external logic except for latch. Basically the ATmega328 keeps the opcode for STA zero page ($85) on the 2A03's databus to keep the 6502 busy. When an APU register is to be updated, the ATmega waits for the 6502's R/W line to go low, in which case the 6502 is in its last cycle of the STA instruction and the next cycle will be the fetch of the next opcode. The ATmega then outputs the necessary stream of instructions to load a value and store it in the desired APU register. Doing this glitch-free is achieved by having both the ATmega and 2A03 running off the same 20 MHz clock so that the two are always phase locked and there is a known and constant number of ATmega cycles for each 6502 cycle.

The hardware is pretty much completed, and I have made a few prototype PCBs. The software is still work in progress, but I'm getting there (I don't have much time to work on it now). So far I have implemented rudimentary MIDI support, three envelope generators, three LFOs, glide/portamento and coarse and fine tuning. It can also play back PCM samples at 16 kHz (samples can be sent via MIDI and stored in memory).

You can see a little demo video of it here.
The hardware and software is open source and can be found here.

I don't know what you guys think? There is a bit of interest in the synthesizer (especially DIY) community. I'm thinking of maybe making this into a DIY kit when it's finished, and maybe making an enclosure for it too.
Re: The NESIZER
by on (#145366)
How do you keep the program counter from drifting into the readable APU ports at $4015-$4017?
Re: The NESIZER
by on (#145367)
A JMP opcode is sent each time a sequence of APU updates is done. It is immediately followed by the STA zero page opcode, so the 6502 jumps to $8585 and then continues executing STA.

I initially thought it was unnecessary, as it seemed to work fine without jumping, but that was until I tried disabling all channels except SQ2 (in which case $4015 reads as an illegal opcode).
Re: The NESIZER
by on (#145373)
You might be able to fix those phase reset clicks by using the APU sweep units. From what I understand there can be 3 different sequences: when the high bits increment, decrement, or stay the same.
Re: The NESIZER
by on (#145392)
43110 wrote:
You might be able to fix those phase reset clicks by using the APU sweep units. From what I understand there can be 3 different sequences: when the high bits increment, decrement, or stay the same.


Wow, I searched around about this problem and came to the conclusion that I couldn't do anything about it! Thanks a bunch :D. I'll try it out soon.
Re: The NESIZER
by on (#145403)
Your project looks and sounds awesome.
Re: The NESIZER
by on (#145914)
Thanks :)

I fixed the phase reset clicking now, thanks 43110!