Monday, December 17, 2012

VGA Synth Review

I made a VGA Video Synthesizer for a class I took this term at uni. Drawing inspiration from works like Brian McKenna's VGA Expropriator and Phillip Stearn's Apeiron I threw my hat into the ring. Since this a post about a project I half-finished a few days ago I'll do my best to describe it's operation (intended and actual) from memory.

 The Research
Timing Signals
After scouring the web for any information I could find on video synthesis, I realized I was going to have to figure out most of this on my own. The first thing was to decide on which format, NTSC or VGA. I picked VGA because I had a bunch of monitors laying around. The next step was to understand how VGA works. Since this post is more about my project, and not about the well established display protocol, I'll leave it to you to figure out. The main thing is that VGA monitors expect a specific combination of HSYNC and VSYNC timings. If it doesn't receive these exact timings, it might not display anything at all. So the first problem to solve was how to generate these timings.

At first I tried using an Arduino to generate the timings necessary for the VGA format, but for reasons I'm about to explain, I stopped using it. Most hardware implementations for generating VGA signals use a clock of 25.175, which allows you to output at a resolution of 640 x 480. Now the Arduino with it's Atmega328 has a 20 MHz clock. While the Arduino is a little under powered for this task, there are certain programming tricks and optimizations you can do to use it for generating the VGA timings. So after borrowing someone else's code, I got a mostly stable signal. I was dissatisfied with "mostly stable" and went back to see if there was anything else I could do to get a better signal. It was at this point that I stumbled across this blog post . 

I was dumbstruck at how easy it was, using a simple VGA cable, I could just use the timing signals coming out of the computer and throw whatever I want onto the RGB color lines.

Synthesis
In my mind I break down the problem of "Visual Synthesis" into two parts: affecting already made material/signals and generating new stuff. Since I had a handful of logic ICs, and no information on how to achieve certain visual results, I was mostly just plugging things in and seeing what happened. It was vaguely circuit bendy and most times didn't make a lot of sense. I did find a few that I could reproduce which made it to the final build, these were:
  • Horizontal line producer, with the option of fixed or scrolling 
  • VCO (driven by audio input)
  • Some sort of color inverter
With the exception of the last one on that list, these effects worked the same on the protoboard as they did on the breadboard. I'm not quite sure why the inverter didn't work the same, but I'll get around to figuring it out later.

Recorded output of one of the test builds

The final signal chain looked like this for each color channel:
Filters
Since there was an element of audio reactivity in this project I wanted to split up the audio with filters so this would be more noticeable. I used some simple passive low and high pass filters with a potentiometer in each so that the pass range could be changed.

Effects
The effects used were selected by a 3 position rotary switch, which directed where the filter audio was going to.
Intensity
A simple potentiometer allowed me to change the brightness of each color.
Color Swapping
Finally I wanted to be able to do some color swapping, so each channel had a 4 position rotary switch that allowed me to select what the output color was. The fourth stage was "output nothing"

The Build
For this class we would demonstrate our finished project during a concert. So I had a hard deadline when I needed this to be done by. I started constructing a finalized version of my synth about 24 hours before the concert and I greatly underestimated how long it would take.
It was a mess

 One of the issues I ran into was power. Originally I had been using the regulated 5V output from the arduino, but since I wouldn't be able to fit this into my case, I had to use another power source. I found a wall wart in the lab that said it put out 12V DC, on measurement it was closer to 18V DC. I dropped it to 5V with a voltage divider, but I found out later than the voltage from the wallwart wasn't regulated, so I wasn't really getting the 5V I thought I was.

I orignally planned for the synth to fit in that silver case in the photo, but I had about 40 minutes before the show. With the time counting down, I decided to use a cardboard box instead.




The final layout

Unfortunately, in the 20 minutes it took me to move my protoboarded version into the case, it stopped working. Since I had no time to trouble shoot it before the show, I attempted to trouble shoot it during the show. I have since figured there is a short somewhere in that mess of wires. This is definitely due to my haphazard construction and wiring.

What's Next
Now that I have a little more time on my hands, I can construct a more "professional" version of this. 
My to-do list for this:
  • Do the power properly, get a voltage regulator, a plug, and wire the loose leads into a jack
  • Untangle and sort out all the wires
  • Finish the other 2 VCOs
  • Find a better case
I've also got some other synth projects planned out. So stay tuned for updates on those