Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Oscilloscope Asteroids via sound card

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
272 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Oct 12, 2011

Software for this (open source, cross-platform, can display on-screen if you don't have an oscilloscope) is at http://www.mediafire.com/?6wj3qch2663koih

Me demoing an Asteroids clone I wrote that outputs its video to an oscilloscope using the sound card. There is no additional circuitry between my Mac Pro's sound output and the scope, which is a vintage Knight KG-635 (analog, single channel, tubes).

The sound is output at the standard sample rate of 44.1 kHz. The left audio channel is wired to the scope's vertical input, and the right channel to horizontal. The oscilloscope is in "EXT/AMP" mode for horizontal, which directly drives the horizontal beam offset from the input. This lets me control the beam position freely so I can draw anything on the screen.

Image stability issues and artifacts are due to the way the small amp in a sound card works. My signal is entirely in the audible frequency range, but a lot of it approximates a high-amplitude square wave, which sound cards tend to render imperfectly. Sound cards aren't meant to be used as general-purpose DACs.

The old analog oscilloscope also contributes to the image stability problems. Even when used as designed, its image shifts as the tubes warm up or if the input signal's net voltage changes. It also starts to wobble a bit after the tubes are fully warmed up.

I negated a *TON* of instability by adding a frame around the picture, and redrawing the frame a dozen times per refresh. This also makes the faint rays in the background as the beam flits from one object to another to the frame and back again.

And no, the letters on the title screen aren't supposed to shimmer and dance. That's from putting too many objects on the screen at once. I wanted to push its limits a bit.

I thought about putting the sound that generates the picture in this video, but then everyone would complain because it sounds like a very heavily clipped loud noise.

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (2)

Sign In or Sign Up now to post a comment!
  • @RoseMan62 Awesome! I think your sound card is a bit better than mine. I'm using the integrated one on a Mac Pro, which is Realtak HD Audio. Obviously your 'scope is better too, since mine is a vacuum tube kit model from the '60s and is 400 kHz rather than 100 MHz.

  • This is very cool!! You must have a lot of time on your hands ;). I dragged out my old Tektronix 465 'scope and it works great. The image is very sharp and stable, and none of the weird artifacts seen in your video are present. The border appears as a series of stationary bright dots. Even the title screen is rock solid and perfect with all of the letters lined up and stationary. Very nice.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more