theramin synyh sketch problems - not working right, maybe prob w/ping unit?

got the plans from this at http://blog.wingedvictorydesign.com/2009/06/20/arduino-thereminsynth-final-walkthrough/all/1/ . built it, it works some times, have gon over the schematic many times - no mistakes! I believe the problem is with the sketch; I know there are a lot of you masterminds out there that know this stuff inside out, would REALLY appreciate it if you could look at the attached schematic & sketch! i am thinking the problem lies with the ultrasonic ping sensor programming - but then I'm no expert like you people! please , please give this a whirle for me...

You want help with the sketch, right? How about posting it? Inside code tags please.

I attached the sketch & schematic - don't know why it didn't work - i'll try again...

Schematic-Rev0.pdf (111 KB)

sketch.txt (10.3 KB)

Nick Gammon - posted properly this time!