Jump to content
IGNORED

Producing Vector Graphics on an Oscilloscope via Audio Signals


Recommended Posts

I ran across this interesting page where someone does exactly that:

 

http://www.lofibucket.com/articles/oscilloscope_quake.html

 

While he was doing rather ambitious 3D, it strikes me that you could probably make a Vector Graphics Plotter-Font Terminal for the Atari by using some variation on this technique.

 

A while back, I had made a nice .ttf approximation of the Atari 1020 Plotter Font. This could be used as a starting point template, if someone was interested in messing around with this idea.

 

ATARI-1020_EMU.zip

 

Link to comment
Share on other sites

That's cool. I wonder how much work it would take to convert a mini 5" B/W portable CRT to a vector display? The V scan and H scan are after all just ramp signals. Re route some other signal in there and bam - instant vector games...

Check here:

http://hackaday.com/2014/09/18/building-a-vector-monitor-controller/

 

Also, searching for "vector" on that site will show how someone made a laser projector for vector games.

Link to comment
Share on other sites

I gave it a very quick try with my stereo pokey 600XL but the results don't look too promising.

 

AC coupling of the audio signal inside the Atari doesn't quite help with straight lines, but at least the lines are connected :)

post-9299-0-50855900-1430224723_thumb.jpg

 

When hooking the scope directly up to the pokey pins you can see the single dots - 4 bit output isn't really sufficient for high quality graphics :) BTW: the image originally was upside down unless I pressed the "invert" button on the scope and the signals seems to have quite a large offset voltage so I had to play with controls to "find" the image.

post-9299-0-53289800-1430224732_thumb.jpg

 

I've attached the source code in case wants to play with it.

 

so long,

 

Hias

fuji.zip

  • Like 3
Link to comment
Share on other sites

I gave it a very quick try with my stereo pokey 600XL...

Wow! That's awesome, it works!!!

 

If you have a moment, you may want to try the 16 bit audio described in De Re Atari, and the GTIA audio to see if they will clear up the funkiness. Actually, I just thought of this, but I wonder if you could use GTIA audio in a carrier/modulator FM scenario with the POKEY output?

Link to comment
Share on other sites

If you have a moment, you may want to try the 16 bit audio described in De Re Atari, and the GTIA audio to see if they will clear up the funkiness. Actually, I just thought of this, but I wonder if you could use GTIA audio in a carrier/modulator FM scenario with the POKEY output?

That won't help, for image generation on scopes in X/Y mode you don't use standard tone generation but just use DACs to control the X/Y position of the beam directly.

 

I've used POKEY in volume only mode (bit 4 of AUDC1 set) so I use the pokey as a 4-bit DAC. It could be improved a little bit by using 2 pokey channels to get (almost) 5 bit resolution, but for smooth lines you'd need at least 8 bit of resolution and a lot faster CPU.

 

so long,

 

Hias

Link to comment
Share on other sites

That won't help, for image generation on scopes in X/Y mode you don't use standard tone generation but just use DACs to control the X/Y position of the beam directly.

 

I've used POKEY in volume only mode (bit 4 of AUDC1 set) so I use the pokey as a 4-bit DAC...

Well, that's what I would have thought before I read the article linked in the first post, but it appears that he is using standard tone generation, as evidenced in the following control tones:

 

http://www.lofibucket.com/download/e1m1_fast_48khz.wav

 

Perhaps I am completely mistaken, but what he demonstrates in his experiment doesn't seem to match with what you are saying... Can you explain this a little bit? I mean, in this case, tone generation, itself, is the end product of Digital to Analog conversion. Are you saying this because, in your experiment, you are going straight from the pins on the POKEY, and bypassing standard audio output? Please explain, thanks!

Link to comment
Share on other sites

Well, that's what I would have thought before I read the article linked in the first post, but it appears that he is using standard tone generation, as evidenced in the following control tones:

 

http://www.lofibucket.com/download/e1m1_fast_48khz.wav

It doesn't have anything to do with standard tone generation like in synthesizers etc. If you listen to the WAVs from that site you'll notice that it also doesn't sound like tones. Well, it doesn't even sound like industrial music :)

 

The audio system is just used as a helper to transport point coordinates to the scope. It's easiest to understand if you look at it in the time domain:

 

Each sample of the WAV contains the coordinates of one point. The left channel contains the X coordinate, the right channel the Y coordinate. So your standard 16-bit 48kHz PC audio card can output images with a whopping 65536x65536 resolution, but only at 48000 points per second.

 

Due to the lowpass filtering of the soundcard the points will be connected together - but not necessary linear, depending on the filter characteristics (I guess the wobbly lines in some parts of the video might be caused by that). You'll have to switch to frequency domain analysis here to get the specifics, but that's a little bit tricky.

 

Of course you can also use sound synthesis with sines etc to generate images, but this isn't anything obvious to do. Drawing some lissajous curves is easy, but generating an asteroids playfield this way is next to impossible :)

 

so long,

 

Hias

Link to comment
Share on other sites

It doesn't have anything to do with standard tone generation like in synthesizers etc. If you listen to the WAVs from that site you'll notice that it also doesn't sound like tones. Well, it doesn't even sound like industrial music :)

 

The audio system is just used as a helper to transport point coordinates to the scope. It's easiest to understand if you look at it in the time domain:

 

Each sample of the WAV contains the coordinates of one point. The left channel contains the X coordinate, the right channel the Y coordinate. So your standard 16-bit 48kHz PC audio card can output images with a whopping 65536x65536 resolution, but only at 48000 points per second.

 

Due to the lowpass filtering of the soundcard the points will be connected together - but not necessary linear, depending on the filter characteristics (I guess the wobbly lines in some parts of the video might be caused by that). You'll have to switch to frequency domain analysis here to get the specifics, but that's a little bit tricky.

 

Of course you can also use sound synthesis with sines etc to generate images, but this isn't anything obvious to do. Drawing some lissajous curves is easy, but generating an asteroids playfield this way is next to impossible :)

 

so long,

 

Hias

Well, after listening to it for a second time, it sounds like square waves and maybe sawtooth waves, with a varying rate, very fast LFO, on each channel. As far as the frequencies of the tones go, it is pitched, but with microtonal frequencies. The Atari's polynomial wave-shapes should be able to approximate that. The LFO rates may be tricky.

 

Since the initial method doesn't yield great results, I would think that if you were going to look at from the perspective of your last paragraph, as a sound synthesis problem, that the thing to do first would be to create an equally spaced dot grid. After this was solved, it would then be a matter of working with offsets. It would then become a hacking/reverse engineering/lock-picking problem, to determine what string of bleeps puts a dot in a specific place. Then, figure out how to make a box, and a grid of boxes, then figure out how to make a grid of boxes that are X-ed with diagonals inside of the boxes.

 

if you looked at it as a four quadrant Cartesian system, and considered it more of a Time Domain Analysis (based mostly on LFO rate, within a unit of time (BPM)) rather than a Frequency Domain Analysis problem, initially, it may not actually be as impossible as you are implying, to achieve results purely by synthesis.

 

Can you post a .wav file the audio output of the Atari Fuji logo that you did?

 

I'm kinda interested to hear exactly how much simpler it sounds compared to the above file that was displaying gazillions of moving polygons. I would say the thing to do, then, is to slow the .wav down 50-25% in VLC, listen to the sound of the waves (at a more discernible LFO rate), and then run it through the scope at those speeds, to see what happens. If you can figure out the sound of dots, then vertical & horizontal lines, I would think that those would be the initial primitives to build off of, via the sound synthesis method.

 

The other thing to consider is that an ASCII alpha-numeric vector terminal is a far simpler sound synthesis based reverse engineering problem to solve, compared to a game of Asteroids.

Link to comment
Share on other sites

I ran across this interesting page where someone does exactly that:

 

http://www.lofibucket.com/articles/oscilloscope_quake.html

 

Actually, there was a game system that worked exactly like that, i.e. it was drawing only vector graphics, essentially using a scope in x,y mode:

 

http://en.wikipedia.org/wiki/Vectrex

 

Similar to the "self-made" video system, the vectrex also had the problem that the number of objects drawn by the vectrex were limited by the maximum frequency of the "function generator".

Link to comment
Share on other sites

Actually, there was a game system that worked exactly like that, i.e. it was drawing only vector graphics, essentially using a scope in x,y mode:

 

http://en.wikipedia.org/wiki/Vectrex

 

Similar to the "self-made" video system, the vectrex also had the problem that the number of objects drawn by the vectrex were limited by the maximum frequency of the "function generator".

Or keep adding objects to the screen (within memory limits) and slow the frame rate until it's abysmal.
Link to comment
Share on other sites

@HiassofT Awesome!

 

I like how it looks on my stereo audio monitor hack to Altirra:

 

post-21021-0-57416500-1430280876_thumb.png

 

Looks like you're putting out slightly more than 3 stereo samples per scan line:

 

post-21021-0-62648800-1430281977_thumb.png

 

Perhaps with some well placed NOPs you could lock the rate at exactly 3x 15kHz. Looks like it's only missing by 3 cycles now. Then you could try shuffling things around to keep an equal number of cycles between the 3 sample per line accounting for the DMA cycles. That could help with the uneven spacing on the scope, no?

 

@Rybags PWM would be great since you could easily lock it to 15kHz and wouldn't have to worry about DMA.

Link to comment
Share on other sites

You can also up the resolution to 6 bits (haven't tried more) by pushing data to 3 pokey channels at once, at the expense of number of points per frame of course.

There are tables for 6 bits volume in mod players. The first such table I know of was done by a friend of mine who hooked digital multimeter to audio output and written down voltage for each triplet of values pushed to pokey.

 

Anyway, this was my long dream to make demo that displays with pokey and plays sound with GTIA :))))

Not entirely impossible as you can see.

Link to comment
Share on other sites

Possibly some extra circuitry would help... rather than 4-bit audio, how about doing PWM and putting it through a filtering circuit that just outputs a raw voltage?

For audio applications this would be fine, but I'm afraid the filtering circuit would bend the lines and leave connecting trails, as in this image. The rise and fall delay needs to be as short as possible.

post-9299-0-50855900-1430224723.jpg

Link to comment
Share on other sites

Using something like a covox would be better IMO - I don't have one though. Testing this via emulation on a PC might be easier, but I'm currently short on time so I leave this to someone else.

 

One problem with my analog output might be the megahz stereo pokey board I have here, it's "sounded", includes a bass-boost circuit and maybe some other filtering that distorts the signals. So I did a quick test on my DE1:

post-9299-0-37200400-1430307154_thumb.jpg

 

The distortions (image "squeezed" to the top and right) you see in this image and also in the previous pics I posted come from pokey's non-linear volume output. Having only 4 or 5 bits (maybe a little bit more) doesn't make it easy to compensate for it.

 

To visualize the non-linearity I did a quick test with a sawtooth wave at around 1kHz (write $10..$1F to AUDC1 with a STA WSYNC between):

post-9299-0-71428900-1430307532_thumb.png

and then the same writing both AUDC1 and AUDC2 to "double" the amplitude:

post-9299-0-50604600-1430307599_thumb.png

 

Doesn't quite look like a sawtooth wave, does it?

 

I also checked this on my de1:

post-9299-0-11711200-1430307667_thumb.png

post-9299-0-07813400-1430307680_thumb.png

 

And also directly on the pokey output pin, bypassing the analog audio circuit (but with the pokey audio pins still connected to the stereo board, so whatever's on the board might affect the waveform).

 

Probing the signal in dc-coupled mode shows that the output waveform is approx 0.5v p-p (only AUDC1 written) with a DC offset of slightly below 4V - that's the reason why the fuji image was shifted so much when connecting the probes directly to the pokey.

post-9299-0-62169600-1430307999_thumb.png

 

So I switched to AC coupling to "zoom in" into the signal. First with only AUDC1 written:

post-9299-0-94736200-1430308058_thumb.png

and here with AUDC1+AUDC2 to "double" the amplitude:

post-9299-0-93609500-1430308092_thumb.png

 

Yes, the sawtooth is upside-down (that's what I also noticed with the scope in XY mode) and one can clearly see the non-linear volume output.

 

But what's even more interesting are the "mini-saws" in the waveform. Not sure where they come from, but I had expected to see a standard staircase output. Well, at least with AUDC1=$16 or AUDC1=AUDC2=$15 we get a stable output voltage :)

 

so long,

 

Hias

Edited by HiassofT
  • Like 1
Link to comment
Share on other sites

My intuition says that an original Atari 800 would produce the cleanest, most proper signal, since it is the most heavily RF shielded Atari, and because everything that came after it was a cost-reduced system. Also, the 600XL has no monitor port, so you are going out to an RF modulator... that might be a confounding variable, RFI-wise.

Link to comment
Share on other sites

I'm thinking that while this is a cool concept, you're really limited by the sample rate you can get out of anything running at 1.79mhz on a 6502. All of the vector arcade games I've seen have used 'sample rates' above 1mhz or they have used analog integrators so that the DAC outputs were an X and Y speed rather than an absolute position. On top of that, they all used a separate specialized vector generator. Sure you can mess around with it on an atari 8 bit, but to get any decent results, we're definitely going to need additional hardware I think.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...