I need to display the voltages stored in the capacitors on the screen. I do this with a window circuit. A window circuit compares two analog voltages and outputs high only if they are a close match. If I compare the voltage stored in a capacitor to the sawtooth I will get a pulse when the rising sawtooth voltage comes to the same level as what's stored in a capacitor. The sawtooth rises as a scanline is drawn, so if this pulse goes back to the monitor it will produce a dot at a different point of the scanline depending on the capacitor voltage.
This same sawtooth wave was used to produce the values stored in the capacitors in the first place, so the positions of the dots will naturally line up to where the zapper was pointed when the capacitor voltage was set.
Textbooks typically show an AND gate or pair of diodes combining the outputs of a window circuit's comparators. LM339 has open collector outputs, meaning logic 1 is high impedance. This means an AND gate can be formed by connecting the outputs directly together and adding a single pullup resistor.
With each drum step I need to show dots for four control channels. I'm breaking each drum step line into four sections to show each of the channels. This is what the channel draw select bits are for. They cycle from 0-3 during the course of each count of the step draw. They control another 4051 demultiplexer which selects which of the four channels is being drawn.
I was worried it would be confusing to look at the screen and figure out
which dot belonged to which channel. LM339s have four comparators and I
was only using two of them to built the first window circuit. I decided
to use the second pair to form a window circuit that highlights the
dots belonging to the control button being pressed. This was
accomplished by connecting it between the zapper controlled 4066 and the
row of control buttons. The voltage at this point is the
output of the capacitor demultiplexer belonging to the control channel of the
switch that's being held.
The highlight window circuit is identical to the first one except the 2.2kΩ resistors are replaced with 10kΩ for wider dots.
Channel one highlighting when control button one is pressed.