BYPASS SHELL BY ./RAZORGANZ
Server: nginx/1.20.1
System: Linux iZdzfnv9mwfppeZ 5.10.134-19.2.al8.x86_64 #1 SMP Wed Oct 29 22:47:09 CST 2025 x86_64
User: apache (48)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /var/www/html/simulink/circuit/pong/hitsound.html
<meta name="viewport" content="width=820">
<title>Circuit Simulator Applet</title>
<link rel="SHORTCUT ICON" href="favicon.ico">
<link rel="stylesheet" href="pong.css" type="text/css">
<body>
<hr>
<div class="split">
<div id="split-0">
<iframe id="circuitFrame" src="../circuitjs.html?startCircuit=hitsound.txt&mouseMode=DragAll"></iframe>
</div>
<div id="split-1">
<div id="info"></div>
This is the circuit that generates the "hit" sound.  It uses the vertical ball counter.  Some circuitry
has been added on the left to generate hits periodically.<p>
When a hit happens, it clears a D Flip Flop which turns back on again when the vertical ball counter
reaches 240 (when the high 4-bits are all 1).  A hit can only happen when the vertical ball counter is 252 or greater.
So, the hit sound only lasts about 1/60th of a second.  When this flip flop is cleared, bit 4 of the
counter is used to generate the hit sound.  That makes the hit sound about 490 Hz.
<p>
The bit used to generate the hit sound is not quite a square wave, though.  The vertical ball counter
only counts from 7 to 255, and more importantly, it stops counting during the vertical blanking interval.  So the
hit sound will be different depending on where the hit happens.  If
it happens in the middle of the screen, then there will be a short
silence in the middle, so it seems like two separate sounds.  (The
counter will keep counting until we hit the bottom of the screen,
stop briefly, and then start again when we hit the top of the
screen.)  If it happens at the top or bottom of the screen, then
the vertical blanking interval will happen at the beginning or
ending of the sound, so the sound will seem like a single sound.
<p>
Wait for the Audio Out to fill up, then click "Play Audio".
<p>
Next: <a href="topsound.html">Top/Bottom Bounce Sound</a>.
<p>
<a href="index.html">Index</a>
</div>

<script type="module">

import Split from './split.js';

Split(['#split-0', '#split-1'], { sizes: [70, 30] });

</script>