You could try DDS - Direct Digital Synthesis. A lot of the simple synths I have put together recently generate square waves with independent frequency control. Its very simple to modify this for a common frequency but variable phase.
This post I published last night has two oscillators which can be set to squarewave, the code is quite readable so you should quickly figure out how to (big clue here) add a phase offset to the phase accumulator.
http://rcarduino.blogspot.com/2013/02/arduino-notes-frequencies-and-scales.htmlDuane B
rcarduino.blogspot.com