The first card is (confusingly) "END", indicating the end of the frequency cards. Each card has the note and octave, followed by its duration.
The code supported up to 20 different notes, so the frequency cards were selected according to the song's need.Įach 132-column line is split across two cards, with the first card defining the right half of the line.Įach card is punched at the right with the note name and frequency.Ĭloseup of the cards for the song Silver Bells. The program cards are followed by frequency cards, defining the print line for each note. Self-modifying code made it more challenging for me to understand the program since the disassembled code isn't what actually
To handle a note, the program generated on-the-fly a sequence of three instructions to load the print line, jump to the print code, and then jump back to the main loop. While nowadays it is usually frowned upon.įor instance, the table of print lines is created by actually modifying load instructions, replacingĮven subroutine returns use self-modifying code, putting the return address into a jump instruction at the end One difference is that self-modifying code was very common, Machine code for the 1401 is very different from modern machines. For some reason, the contents of each card are printed twice on the card.
These correspond to times when the chain is syncing up and can't print.Ī closeup of cards with the machine code for the music program. There are a few gray lines where you'd expect a hammer to fire, but no character is printed. There's no simple relationship between the arrangement of characters on the line and their time sequence. Note that characters are printed in a different order from how they appear on the line. With the associated character and column on the page. The red bars are spaced evenly with a spacing of 1/440th of The diagram has time on the X-axis, with a red bar when each character is printed. The diagram below shows the timing of the hammers, illustrating the uniform 440 Hz frequency produced by the above print line. (It may be a bit surprising that with a character set of just 48 characters, the printer includes unusual characters such as ⌑ and ‡.) 1 ⌑Y C# 0 Q 3, ‡F R T 4 -, I U $7 M V.
The full line printed to generate this note is below. (There's no real pattern to this it's just how things line up. This can be done by printing a 1 in column 1 (the first hammer to be aligned), followed by a # in column 14 on the next scan, a comma in column 30 the scan after that, and so forth.
Now that you see how the printer works, with a hammer potentially firing every 11.1 µs, the strategy toīy printing carefully-selected text, you can control the times at which hammers fire.īy firing hammers at specific intervals, you can create a desired frequency.Īn A note (440 Hz), for instance, can be produced by printing a line of text that fires the hammers every 1/440th of a second. At the right moment when the desired character passes the hammer,Īn electromagnet drives the hammer against the back of the paper, causing the paper and ribbon to hit the type slug, printing the character.Īn individual hammer from the IBM 1403 printer. The printer produces 132-column output so each of the 132 print columns has a hammer and an electromagnet. To print characters, the printer uses a chain of type slugs that rotates at high speed in front of the paper, with an inked ribbon between the paper and the chain. He recently came across his old programs and gave us the opportunity to try them out. Songs on punch cards using an earlier music program. It was possible to play a tune by printing the right lines for each note.Īround 1970, computer scientist Ron Mak coded up some The chain has 48 different characters, repeated five times.īy printing specific lines of characters, the noise had specific frequencies. The type chain from the IBM 1401's printer.