Author Topic: Oscilloscope pong for 1 or 2 players.  (Read 140777 times)

0 Members and 1 Guest are viewing this topic.

Offline Gary350z

  • Regular Contributor
  • *
  • Posts: 198
  • Country: us
Re: Oscilloscope pong for 1 or 2 players.
« Reply #425 on: April 25, 2017, 07:57:50 am »
Pong stereo game sound simulation of GK's bonk sound efffect.
 

Online BrianHG

  • Super Contributor
  • ***
  • Posts: 3987
  • Country: ca
Re: Oscilloscope pong for 1 or 2 players.
« Reply #426 on: April 25, 2017, 08:50:55 am »
Pong stereo game sound simulation of GK's bonk sound efffect.
Now you've done it.  GK will now release a stereo version of his game....

__________
BrianHG.
 

Offline bitseeker

  • Super Contributor
  • ***
  • Posts: 8596
  • Country: us
  • Lots of engineer-tweakable parts inside!
Re: Oscilloscope pong for 1 or 2 players.
« Reply #427 on: April 25, 2017, 05:56:09 pm »
Yep, sound is half the experience.


Ha ha (flame suit on!) - For a dull and boring George Lucas film (like Star Wars Episode 0 through 250) that's probably more like 95%!  >:D

LOL!
I TEA.
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2528
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Re: Oscilloscope pong for 1 or 2 players.
« Reply #428 on: April 25, 2017, 10:26:20 pm »
Pong stereo game sound simulation of GK's bonk sound efffect.

At first I thought that was the start of a song! I was waiting for the beat to drop, but it never did. We just need to add some deep, thumping bass and some 56k modem noises and it could be the next hit dubstep song!
Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Oscilloscope pong for 1 or 2 players.
« Reply #429 on: April 26, 2017, 09:49:04 am »
Pong stereo game sound simulation of GK's bonk sound efffect.
Now you've done it.  GK will now release a stereo version of his game....


Definitely! I hadn't considered the provision for stereo until I listened to that. What I'll do is provide both mono and stereo line-level RCA outputs to accommodate both mono and stereo TVs/monitors. I'll mix it so that the sounds other than the stereo paddle-ball collisions are sent equally to both L & R channels, but 6dB lower in amplitude to compensate for the fact that the paddle-ball boinks are only being reproduced by a single speaker.

Here is the circuit for producing the bell-like alarm that is to sound when a player reaches a maximum (winning) score of 19. If either player 1 or player 2's score counter reaches 19 causing its !lock-out line to go low, NAND gate Q1, ORing these lines, will turn off, enabling the Q2,Q3 astable and gating VR32 (400 Hz referenced from the vertical timing ripple counter) through to Q5.
The non-symmetrical astable produces ~100mS long pulses at a ~1 Hz repetition rate. The pulse output is shaped by D1, R3, R4 and C1 to produce a modulation envelope control voltage with a fast attack and a slow exponential decay. This modulation voltage is buffered by Q4 and applied to the 400 Hz switching stage Q5. The asymmetrical amplitude-modulated envelope produced at the collector of Q1 is ac-coupled and shaped/filtered into a symmetrical waveform by a Wien Bridge RC network with an Fc of 400 Hz.  This alarm/chime will continue to sound until the score counters are manually reset to zero.

I think it sounds a bit like the chime that typically sounds in an elevator before the doors close/open: Bell Sound.wav

« Last Edit: April 26, 2017, 09:59:44 am by GK »
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Online tautech

  • Super Contributor
  • ***
  • Posts: 18741
  • Country: nz
  • Taupaki Technologies Ltd. NZ Siglent Distributor
    • Taupaki Technologies Ltd.
Re: Oscilloscope pong for 1 or 2 players.
« Reply #430 on: April 26, 2017, 09:59:19 am »
 :-DD
Now you've done it. There's no holding Glen back now, he's on a roll.....whatever will he come up with next ?  :scared:
Avid Rabid Hobbyist
 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Oscilloscope pong for 1 or 2 players.
« Reply #431 on: April 26, 2017, 10:01:08 am »
....whatever will he come up with next ?  :scared:


Dinner!
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 
The following users thanked this post: tautech

Online BrianHG

  • Super Contributor
  • ***
  • Posts: 3987
  • Country: ca
Re: Oscilloscope pong for 1 or 2 players.
« Reply #432 on: April 26, 2017, 10:23:49 am »
What I'll do is provide both mono and stereo line-level RCA outputs to accommodate both mono and stereo TVs/monitors. I'll mix it so that the sounds other than the stereo paddle-ball collisions are sent equally to both L & R channels, but 6dB lower in amplitude to compensate for the fact that the paddle-ball boinks are only being reproduced by a single speaker.
Now when you video demo the final game for Youtube, you'll need to record the audio in stereo...
__________
BrianHG.
 

Offline bitseeker

  • Super Contributor
  • ***
  • Posts: 8596
  • Country: us
  • Lots of engineer-tweakable parts inside!
Re: Oscilloscope pong for 1 or 2 players.
« Reply #433 on: April 26, 2017, 06:18:11 pm »
:-DD
Now you've done it. There's no holding Glen back now, he's on a roll.....whatever will he come up with next ?  :scared:

Hehe. There are plenty of games to discrete-ize.
I TEA.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 12245
  • Country: us
Re: Oscilloscope pong for 1 or 2 players.
« Reply #434 on: April 26, 2017, 06:27:07 pm »
Reminds me a bit of the system beep on the old Macintosh computers.
 

Online BrianHG

  • Super Contributor
  • ***
  • Posts: 3987
  • Country: ca
Re: Oscilloscope pong for 1 or 2 players.
« Reply #435 on: April 27, 2017, 03:19:10 am »
Definitely! I hadn't considered the provision for stereo until I listened to that.
I'm thinking along the lines of having a cross-fade, or left-right balance adjustment based on the analog X position of the ball.  This way, where ever the ball strikes, a bat or the top & bottom of the court, or going off the edge, the stereo effect of all your playback sounds will be in the right position whether left, right, center, or slightly off center...
__________
BrianHG.
 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Oscilloscope pong for 1 or 2 players.
« Reply #436 on: April 28, 2017, 08:30:08 am »
Definitely! I hadn't considered the provision for stereo until I listened to that.
I'm thinking along the lines of having a cross-fade, or left-right balance adjustment based on the analog X position of the ball.  This way, where ever the ball strikes, a bat or the top & bottom of the court, or going off the edge, the stereo effect of all your playback sounds will be in the right position whether left, right, center, or slightly off center...


I think I might be sold on this idea. The unipolar Ball_X integrator signal controlling the horizontal position of the ball has a range of 0 to 10V. at 0V the ball is off the left of the screen and at 10V the ball is off the right. An op-amp based summing amplifier can be configured as a combined level-shift and inverter to produce the complement of Ball_X; the pair then becoming the control signals for a pair of analogue multipliers governing the signal gain of the left and right audio channels respectively. 

As the control signal, Ball_X, is subsonic and the lowest frequency sound effects tone is a far removed 100 Hz (the buzz when a player misses the ball), a simple two-quadrant multiplier can be used as the control signal feed-through can be high-pass filtered out.

Here is a quick sim to put down my preliminary thoughts. This is a multiplier circuit that shouldn't require any fiddly trimming or component matching. We an only interested in ac signals and are not bothered by DC drift, signal feed-through and even the ultimate "offness" isn't a concern as 20dB cross-fade dynamic range is already ample for a convincing stereo effect.   

The large-amplitude control signal is fed to a long-tail-pair (LTP) with diode loads which both biases and linearises the multiplying LTP transfer function by driving with an inverse hyperbolic tangent.

A positive going signal at the control input of the multiplier progressively attenuates the signal passed through to the output. As the ball is already off the screen (horizontal blanking intervals) when Ball_X or it's complement reaches the 10V limit of range, I've set the transconductance/gm (via emitter degeneration) of the control input LTP to saturate a bit before Ball_X reaches 10V. The 3-pole high-pass filters at the output of each multiplier eliminate the control component.

So this should provide a nicely balanced and effective linear cross-fade from left to right and vice-versa, in accordance to the horizontal position of the ball. 
 
BTW, the ball video generation circuitry is operational and I'm working on finishing the video-based logic-level collision detection and movement circuits. Expect a major update this weekend!


 
« Last Edit: April 28, 2017, 08:46:55 am by GK »
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Online BrianHG

  • Super Contributor
  • ***
  • Posts: 3987
  • Country: ca
Re: Oscilloscope pong for 1 or 2 players.
« Reply #437 on: April 28, 2017, 09:48:16 am »
Sweeeeeeeet   :-+

Though, stretch the blend so that the volume is a little more equal, closer to full volume on the left and right when the ball is in the center of the display.
« Last Edit: April 28, 2017, 11:01:11 am by BrianHG »
__________
BrianHG.
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2528
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Re: Oscilloscope pong for 1 or 2 players.
« Reply #438 on: April 28, 2017, 10:48:11 am »
Okay guys, finally an update on the Scope Pong board! Due to working with an eye patch over one eye, it's been slow going over the last week. (Pro Tip: Tweezers + Eyeballs don't mix.)

However, tonight I finally finished layout for the last circuit section! Now it's just a matter of placing and moving a couple of the finished sections, finish connecting all the nets together and scattering some additional decoupling over the board and it will be ready for a final review, then a small order of test boards. :D

Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 
The following users thanked this post: HackedFridgeMagnet, MK14, BrianHG

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Oscilloscope pong for 1 or 2 players.
« Reply #439 on: April 28, 2017, 02:27:00 pm »
That looks very pretty; appears that everything will fit in quite nicely. Hope your eye is OK  :o
« Last Edit: April 28, 2017, 02:50:45 pm by GK »
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Oscilloscope pong for 1 or 2 players.
« Reply #440 on: April 28, 2017, 02:45:14 pm »
Just for fun here is the video generation circuitry for the ball. Well it's actually a square, but we're just going to have to pretend that it's a ball, lol. The build is finally getting back into the analogue zone.

In the schematic Ball_Y and Ball_X are analogue inputs, the voltages applied to which determine the position that the ball is drawn on the screen. I will eventually draw a neater schematic than this; this is just my working documentation for now. I haven't finished constructing the ball movement circuits yet, so for the demonstration video embedded below I am just applying a fixed 5V to the Ball_Y input and I am applying a triangle wave from my function generator to the Ball_X input to move the ball on the horizontal axis.

Basically Ball_X and Ball_Y are compared (with comparators) to raster scanning ramp waveforms H_SCAN and V_SCAN respectively and monostables are triggered to produce the horizontal and vertical video components of the ball, which are combined into the composite !BALL_VIDEO signal by NAND gate Q24. There are some minor subtleties involved with the firing of the vertical monostable, concerning synchronization with the horizontal retrace to ensure that at whatever point on the screen the ball is drawn, it is always drawn as a complete square exactly four horizontal lines high.

The horrible strobing effect in the video with the slowly (vertically) drifting dark bar across the entire display is entirely an artifact of my camera.   





« Last Edit: April 28, 2017, 02:58:00 pm by GK »
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Online BrianHG

  • Super Contributor
  • ***
  • Posts: 3987
  • Country: ca
Re: Oscilloscope pong for 1 or 2 players.
« Reply #441 on: April 29, 2017, 05:19:34 am »
 :scared: That has half the components I thought it should have.
Well done!  :-+
__________
BrianHG.
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2528
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Re: Oscilloscope pong for 1 or 2 players.
« Reply #442 on: May 02, 2017, 11:19:33 am »
That looks very pretty; appears that everything will fit in quite nicely. Hope your eye is OK  :o

Thanks, and yes my eye is doing much better, no permanent damage, just a scratch, thankfully!

Things are now progressing rather quickly with the board. I've managed to get everything to fit on a single 300x300mm board (previously it was 250x400mm) which brings board prices down to roughly $10/ea, which is pretty damn good.



Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 
The following users thanked this post: MK14, Muessigb, Mukrakiish, BrianHG

Online MK14

  • Super Contributor
  • ***
  • Posts: 2576
  • Country: gb
Re: Oscilloscope pong for 1 or 2 players.
« Reply #443 on: May 02, 2017, 12:59:52 pm »

Thanks, and yes my eye is doing much better, no permanent damage, just a scratch, thankfully!

Things are now progressing rather quickly with the board. I've managed to get everything to fit on a single 300x300mm board (previously it was 250x400mm) which brings board prices down to roughly $10/ea, which is pretty damn good.

That looks really neat, it has come along very nicely!
Thanks for putting the effort in (as regards the PCB), for everyone.
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12136
  • Country: gb
    • Mike's Electric Stuff
Re: Oscilloscope pong for 1 or 2 players.
« Reply #444 on: May 02, 2017, 01:36:05 pm »
That looks very pretty; appears that everything will fit in quite nicely. Hope your eye is OK  :o

Thanks, and yes my eye is doing much better, no permanent damage, just a scratch, thankfully!

Things are now progressing rather quickly with the board. I've managed to get everything to fit on a single 300x300mm board (previously it was 250x400mm) which brings board prices down to roughly $10/ea, which is pretty damn good.




Looks like there's still quite a bit of empty space, or are you leaving that for some graphics?
As mentioned before it would be good to be able to fold over the caps and regulators to allow for a clear plastic cover to sit lower.
 
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Oscilloscope pong for 1 or 2 players.
« Reply #445 on: May 02, 2017, 02:00:11 pm »
:scared: That has half the components I thought it should have.
Well done!  :-+


I managed to fit the entirety of the ball video generator, movement and collision detection circuits on a single board; picture attached.

Due to some neglected chores that ended up sapping much of my time on the weekend, I didn't get as much done as I had hoped for; I thought I'd be able post a video of myself playing a match against the machine by now, but my paddle generator circuitry (somewhat revised/improved) still isn't entirely operational.

So below is a video of where I am at now; it is of the machine playing against itself but due to the incomplete paddle generators the paddles are currently invisible! Also for the time being I have (for testing purposes) the relevant collision detection inputs hardwired so that the ball bounces off the right hand paddle at 45 degrees and the left hand paddle at 68 degrees. When the paddle generators are finished the ball will deflect at 45 degrees only if it hits either paddle in the center section, and the 68 degrees is it hits the outer edges. The 68 degree deflection is achieved by multiplying the vertical speed by two.

I made a few other changes. I increased the thickness of the lower border from four lines to 16. I also changed the decoding for the paddle horizontal video components. The paddles were previously ~600nS wide and closer in to the center. The paddles are now 2uS wide and pushed further out to effectively enlarge the playing area. 2uS is the thickness of the vertical segments of the score counter digits.

I increased the thickness of the paddles and the lower border as this permits a faster ball speed. The ball movement circuitry has a lot of similarity to the 'scope display version; there is a Velocity integrator which provides a progressively increasing ball speed and the x and y movements are governed by integrators with flip-flops for each axis setting the direction of travel. However the collision detection between ball, paddles and boundaries and the attendant setting and resetting of the flip-flops this time around is done entirely digitally. Basically the ball video signal (a non-blanked version) is individually NANDed with the scoreboard background video signal, the lower boundary video signal and the video signals of each paddle. If the ball video signal is coincident in time with one of those other video signals, then there is a collision on the screen between the two and the respective NAND gate output will go low.

All of this makes the collision detection in the video version simpler and much more flexible than in the 'scope-display version, but there is a catch. There are over 200 lines to the playing field vertically. Suppose that the velocity is such that it takes 1s for the ball to travel vertically from the very top to the very bottom of this field. In that 1s there will be 50 frames drawn. So the ball will move >200/50 = more than 4 lines vertically between each frame. The lower border was originally only 4 lines high, meaning that at this vertical velocity, the ball, now moving faster than 4 lines per frame, could pass through the lower boundary without the video collision detection noticing!
The horizontal velocity is similarly limited. There are 48uS of each horizontal line visible on the screen to the playing area. Suppose that the ball velocity is such that the ball takes 1s to traverse from leftmost to rightmost. In each frame the ball has therefore traveled 48/50 = 960nS. As my paddles were originally only 600nS wide, they would not permit consistent collision detection at that velocity.

A velocity of only 1s left/rightmost-right/leftmost and 1s upper/lowermost-lower/uppermost is pretty fast, but after watching the screen I decided not quite so fast that a good player wouldn't be able to keep up it and keep a match/duel going too long. I thought the game would be better overall if I could impose a higher upper limit to my velocity integrator, and increasing the paddle widths to 2uS and lower boundary width to 16 lines permitted me to do that.

In the video below I stopped filming at 60 seconds, at which point the velocity integrator had reached about 80% of its maximum speed. As you can see the ball is moving quite fast here - I think it would take a pretty damn good player to keep up!

Anyway, my paddle generators are currently about 60% complete. The next video posted will be of me playing against the machine.   

I filmed this on my employer-provided Iphone this time - the strobing effect isn't nearly as bad as for my cheepo pocket digital camera (there is only a brief periodic "lightning" flash) but there seems to be a mismatch in frame rate between the camera and monitor causing the ball movement at low speed to appear in the resultant video a little bit jerky. It seems to be a bit difficult to make decent video of a video screen. My cheepo digital does 50 Hz so I'm toying with the idea of opening it and probing to see if I can find a reference clock for the frame scan anywhere. Theoretically if available I could knock up a breadboard PLL to substitute my Pong system master oscillator and adjust the phase of the lock such that the previously visible, vertically-drifting strobing bar is shifted to the invisible vertical blanking interval.         


     

 

 
« Last Edit: May 02, 2017, 02:29:28 pm by GK »
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Oscilloscope pong for 1 or 2 players.
« Reply #446 on: May 02, 2017, 02:15:04 pm »
Thanks, and yes my eye is doing much better, no permanent damage, just a scratch, thankfully!

Things are now progressing rather quickly with the board. I've managed to get everything to fit on a single 300x300mm board (previously it was 250x400mm) which brings board prices down to roughly $10/ea, which is pretty damn good.



Nice! I'm trying to find the 1uF film capacitors to for the ball-x and ball-y integrators though. These would typically be 5.08mm pitch, 7.5mm W, 6mm D or so. Wondering if you accidentally applied a 100nF ceramic footprint here?
« Last Edit: May 02, 2017, 02:17:34 pm by GK »
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2528
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Oscilloscope pong for 1 or 2 players.
« Reply #447 on: May 02, 2017, 02:21:39 pm »
Thanks, and yes my eye is doing much better, no permanent damage, just a scratch, thankfully!

Things are now progressing rather quickly with the board. I've managed to get everything to fit on a single 300x300mm board (previously it was 250x400mm) which brings board prices down to roughly $10/ea, which is pretty damn good.



Nice! I'm trying to find the 1uF film capacitors to for the ball-x and ball-y integrators though. These would typically be 5.08mm pitch, 7.5mm W, 6mm D or so.

Your original hand drawn schematics didn't specify film and being such a large value I just assumed it to be ceramic, which is what's currently implemented. (They're just in front of the relays, which are the black rectangles in the bottom left-center of the 3D image I posted.)

Being an Integrator I suppose film does make sense. I'll find appropriate ones and specify them. It'll take a bit of re-arranging but I can make it work.
Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Oscilloscope pong for 1 or 2 players.
« Reply #448 on: May 02, 2017, 02:26:58 pm »
Your original hand drawn schematics didn't specify film


Whoops.  :-[

Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2528
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Re: Oscilloscope pong for 1 or 2 players.
« Reply #449 on: May 02, 2017, 02:39:22 pm »
That looks very pretty; appears that everything will fit in quite nicely. Hope your eye is OK  :o

Thanks, and yes my eye is doing much better, no permanent damage, just a scratch, thankfully!

Things are now progressing rather quickly with the board. I've managed to get everything to fit on a single 300x300mm board (previously it was 250x400mm) which brings board prices down to roughly $10/ea, which is pretty damn good.




Looks like there's still quite a bit of empty space, or are you leaving that for some graphics?
As mentioned before it would be good to be able to fold over the caps and regulators to allow for a clear plastic cover to sit lower.

All those sections still have to be connected to each other, so that will take up a lot of the free space on the bottom side of the board. I also want to make sure the top copper pour can reach everywhere, so I need to leave space between sections for that as well. I also need room towards the sides of the large power supply and audio caps so they can be laid down and zip tied to the board, per your suggestion (I haven't added the holes for that yet). Finally, yes, I need a bit of room for artwork. :)

I most likely could have done the board 200x200mm  if I'd done it as one continuous, tightly packed circuit instead of individual sections connected together. I did it the latter way so that the individual sections (and nets that connect them) could be disconnected, probed and examined by the builder. I feel like this makes it a better for figuring out how the whole thing works, plus I think it looks nicer as a decorative item when not in use.
Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 
The following users thanked this post: HackedFridgeMagnet


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf