Al-Jazari's musicians, or the first machine you could reprogram
On a lake in the palace grounds at Mardin, before 1206, a boat moved across the water carrying four musicians. A harpist plucked strings. A flautist blew. Two drummers kept time. None of them were human.
The boat was built by Badīʿ az-Zaman Abū al-ʿIzz ibn Ismāʿīl al-Jazarī — chief engineer to the Artuqid dynasty, whose court sat in what is now southeastern Turkey. Al-Jazari had served the ruling family for twenty-five years across three generations when, in April 1206, Sultan Nasr al-Din Mahmud asked him to write it all down. The result was the Kitab fi ma’rifat al-hiyal al-handasiyya — the Book of Knowledge of Ingenious Mechanical Devices — describing more than fifty machines in sufficient detail that a competent craftsman could actually build them. Al-Jazari died the same year he finished it.
The musical boat appeared in the fourth section of the book, among fountains and musical automata. The four figures were driven by water flowing through the hull, which turned a camshaft: a rotating shaft with protruding pegs that struck levers and set each player in motion. Al-Jazari introduced the camshaft to the historical record in this book; it now sits at the center of every internal combustion engine on earth. But the drum mechanism was the more interesting thing. The pegs that controlled the drummers’ levers could be repositioned on the shaft. Move the pegs, change the rhythm. The same machine, a different performance.
Programmable. The word carries no digital freight in 1206. It meant something simpler and stranger: the behavior of this machine was not permanently fixed by its shape. A person could specify, in advance, what the machine would do — and later change that specification without dismantling the whole thing. The pegs were the program. The camshaft was the processor. The court musicians played whatever the engineer had arranged.
Al-Jazari built dozens of other machines. A peacock fountain whose water flow activated a mechanical servant holding soap and a towel. A hand-washing automaton set in a domed pavilion: a bird would whistle, water flowed into a basin, a mechanical duck drank the waste and released it through its tail into a hidden reservoir below. These were palace entertainments — showpieces for a sultan’s guests — but also something else: existence proofs that a machine could simulate purposeful, sequenced behavior without a human hand guiding it at each step.
The detail that tends to get lost in the spectacle: al-Jazari deliberately wrote his book in plain language. He was a court insider, the sultan’s own engineer, and he could have written in the dense technical Arabic that kept knowledge locked inside a guild. He didn’t. He wanted ordinary craftsmen to read it and build the machines. That impulse — that a description of behavior should be transferable, legible to anyone who follows the instructions — is the same impulse that runs through every programming language ever written.
Aristotle had shown, fifteen centuries before al-Jazari was born, that valid reasoning follows rules that can be written down and handed to someone else. Al-Jazari showed that physical motion could be specified the same way. The gap between a syllogism and a peg on a rotating drum is large. The principle is identical.
His musicians are silent now, their images preserved in manuscript copies held in Istanbul, Cairo, and Oxford. The pegs, long gone. The idea, still running.
Sources
- Ismail al-Jazari — Wikipedia — biography, the Artuqid court, the 1206 commissioning, the camshaft, and the musical boat automaton.
- Ismail al-Jazari — National Geographic — the reprogrammable drum mechanism, the devices al-Jazari built, and the book as a craftsman’s manual.
- Islamic Automation — Muslim Heritage — the hand-washing automaton in the domed pavilion, the duck mechanism, and al-Jazari’s twenty-five years of court service.