MIDI file by Don Carroll.
This old 24-pin dot matrix printer has been converted into a MIDI compatible sound generator. Up to 21 notes can be played simultaneously. It features up to 16 MIDI channels with individual volume and pitch. Key velocity for every note played is also implemented.
An Atmega8 and an FPGA are connected to various parts of the original printer main board. The Atmega handles the incoming MIDI messages, communicates with the FPGA and drives the stepper motors for the print head and paper feed. The FPGA is configured to generate lots of pulse-width modulation signals with independent frequency and duty cycle to drive the individual printer pins.
The external electronics and the printer main board are connected using a normal centronics printer cable and an additional 9-pin connector (the printer cable did not have enough wires).
The electronics features a standard MIDI DIN connector which is connected to a USB-MIDI converter. It's possible to connect a MIDI keyboard instead of the PC and play live.
The Atmega firmware responds to all 16 MIDI channels, but this can be reduced to certain channels if the printer is supposed to play together with other sound generators.
The FPGA is a Xilinx Spartan-3E on a development board ("Spartan-3E Starter Kit"). It is pretty much oversized for the application of generating 21 PWM signals but it's what I had available.
The original printing frequency was approx. 1kHz with a pulse width of 300µs. So every pin hit the paper at maximum 1000 times per second when printing stuff. The MIDI electronics drives this from a few Hz up to 2kHz.
When the pulse width is reduced the sound gets quieter because the pin hits the paper with less force. This way "channel volume" and "key velocity" are implemented.