Project 10 — Punched-Card Music Box
Text written by Claude Fable 5 (claude-fable-5).
Project 10 — Punched-Card Music Box
The one idea: you can store a song in a piece of paper — holes mean “play”, cardboard means “hush” — and the child punches the holes. This is programming, a century before screens.
Project 6 built a machine that makes a tone; Project 7 built an eye that knows when the beam is blocked. Wire the eye to the tone machine’s ON/OFF switch, pull a punched strip through the slot, and the strip plays itself. Player pianos, music boxes with pinned drums, the Jacquard loom, and the punch cards early computers ate for breakfast — all of them are this project.
What you need
- 4×AA battery holder (6 V)
- The Project 6 astable 555 circuit (rebuild it — good spaced repetition — or keep it standing if you never tore it down), with the passive buzzer, and the pitch pot if you like
- A slotted optointerrupter + 220 Ω and 10 kΩ
- Cereal-box cardboard cut into strips ~3 cm wide and as long as you can — the tape-together-several kind of long
- A hole punch (the single-hole office kind is perfect; ~6–8 mm holes)
Build it — stage 1: the gated tone machine
First, the Project 6 oscillator exactly as before: 555 astable, R1 ≈ 1 kΩ from + to pin 7, R2 ≈ 10 kΩ (or the pot) from pin 7 to pins 6+2, C from pins 6/2 to GND, pin 1 to GND, pin 8 to +, pin 3 → passive buzzer → GND.
One change — and it’s the whole project: in Project 6, pin 4 (reset) went straight to +, meaning “always allowed to sing.” Today the eye decides:
+6V ──┬── 220Ω ── IR LED ── GND (opto emitter side)
│
└── C (phototransistor) (opto eye side)
E ──┬──────── 555 pin 4
└── 10kΩ ── GND
- Light through a hole → the eye conducts → pin 4 pulled HIGH → the 555 sings.
- Cardboard in the slot → eye dark → the 10 kΩ drags pin 4 LOW → the 555 is muted, instantly and silently.
Check it by hand: empty slot = tone; slide a plain strip in = silence. If it’s the other way round, the phototransistor’s legs are swapped — swap them.
Build it — stage 2: the song strip
- Draw a light pencil line along the middle of a strip — holes go on the line, so they pass dead-centre through the slot.
- Punch a rhythm. Rules of thumb for a first strip:
- a hole ≈ a short beep;
- two holes overlapping into an oval ≈ a long note (or snip a slot with scissors);
- unpunched stretch ≈ rest. Leave 1–2 cm between notes at first.
- Make guide rails so the strip tracks straight: tape two cardboard scraps to the table on either side of the opto, a strip-width apart — a paper slot feeding the optical slot.
- Pull the strip through at a steady speed. That’s it. The strip plays.
Start with something the child can verify by ear: the rhythm of their own name (“MI-hkel MI-hkel”), a heartbeat, Jingle Bells’ “short-short-long”. Then hand over the hole punch and stand back — this is the project that generates artifacts: a shoebox archive of labelled song strips.
Tempo lives in the hand: pulling faster plays the song faster without changing the pitch — the pattern is in the paper, but the clock is the child’s hand. Sneakily deep, worth saying out loud.
What to say to the child
“This paper strip is going to remember a song for you. Watch: where you punch a hole, the secret light gets through to the eye and the buzzer sings. Where there’s no hole, the light is blocked — shhh. So holes are the notes! Punch your name: MI-hkel — short, long. Now pull it through… the paper is playing! It’ll play tomorrow too, and next year, because the song isn’t in the machine — it’s in the holes. A hundred years ago, before computers, whole pianos played themselves from giant paper rolls exactly like yours.”
For you — the physics (and the history)
- Gating vs. generating. The 555’s pin 4 is an asynchronous reset: pulled low it forces the output low and holds the oscillator’s internal latch down; released, oscillation restarts within one RC charge — microseconds. Clean, click-free note onsets, and a first taste of separating a signal path (the tone) from a control path (the eye). All synthesizers are organized this way.
- The strip is a 1-bit ROM, read serially. One track, one bit per unit length: hole = 1, cardboard = 0. The read head is optical; the read clock is the pulling hand, so the medium stores pattern, not tempo — the same division of labour as sheet music, and the opposite of a gramophone groove, which stores the waveform itself, tempo included.
- The lineage is real, not a metaphor: Jacquard’s loom (1804) read punched cards to control which threads lifted — weaving programs. Hollerith’s cards tabulated the 1890 US census; his company grew into IBM. Player-piano rolls are literally this project scaled to 88 optical/pneumatic tracks. When the child punches paper, they’re re-enacting the actual ancestry of software.
- Resolution limit: hole diameter (~7 mm) versus slot aperture (~1 mm wide beam) sets the shortest playable note at a given pulling speed — a genuine bandwidth-of-the-channel argument, kid-sized: punch holes too close together and they blur into one note; that’s the medium’s maximum data rate.
Try next
- Two-part harmony: a second optointerrupter above the first, a second 555 at a different pitch, and strips with two hole tracks (low line = low note, high line = high note). Two-note chords from paper — genuinely impressive.
- Motorised playback: the Project 3 motor with a rubber-band pulley pulling the strip = constant tempo, no hands. (Combine with Project 9’s disc on the same shaft and the machine plays and tells you its tempo.)
- Pitch bending: you already discovered the LDR-as-pitch-knob after Project 6 — keep the LDR as R2 while the card gates the notes: the strip plays the rhythm, a waving hand plays the melody. A two-person paper synthesizer.
- Punch a secret code: long/short holes = Morse-ish messages; the same strip idea, read as language instead of music — which is precisely Project 11’s “holes are numbers” step in disguise.
← Back to Read Me First.