PGTS High and Mighty Blog
|Gerry Patterson. The world's most humble blogger|
|You underestimate the power of the Dark Side! -- Darth Vader|
When Is A Zero Not A Zero?
Chronogical Blog Entries:
Date: Thu, 01 May 2008 20:36:58 +1100
In the 16th century, when Pope Gregory XIII instituted what came to be known as the Gregorian Calendar Reforms, it appears that the scholars who undertook the work missed the year zero. Either baby Jesus was the only baby in history to turn one year old on the very day of his birth or the scholars just forgot about the year zero. And so in our current calendar we progress from 1 BC to 1 AD without a year zero AD.
Actually there were a couple of other mistakes made during the reform process. It seems that in poring over dusty piles of documents, most of which used the lifetime of the reigning emperor as the standard, the scholars overlooked the fact that some of the reigns of various emperors overlapped. As a result, most modern scholars believe that Christ was actually born somewhere between 4 AD and 8 AD.
Nevertheless, why did they overlook the year zero? The mathematician Fibonacci had already popularised Algebra and the Arabic numeral system (including the important concept of zero) some three centuries earlier. In medieval times, with slower modes of transport and communications it sometimes took ideas a lot longer to catch on.
Eventually the adoption of Arabic numerals would become the engine room of the Renaissance. However, in many ways it seems that the men (and women) of the 15th and 16th century had Renaissance heads but Medieval hearts. Which might explain geniuses like Bach and Bruegel who applied Renaissance science to their Medieval arts.
At least we can appreciate that a 16th century historian with his head buried in a document, listing various events in roman numerals, might forget about the concept of zero. After all the roman numeral system doesn't even include a zero. Most people, dealing with roman numerals, spend their time just working out which number is actually being represented, let alone actually doing arithmetic with it.
Ok so maybe that explains why Pope Gregory's team forgot about zero ... But what then is the excuse for the MIDI Manufactures Association who, some four hundred years later, also left the number zero out of their consideration?
Don't get me wrong. I consider the MIDI specification 1.0 to be a fine example (perhaps even the last example) of what can be accomplished by private enterprise when many medium to large sized corporations are forced to come up with a standard that promotes interoperability using the stick of efficiency and economics. What they came up with was an efficient and compact standard that promoted competition and the exchange of information and data. And quite unlike the situation today when mega-corporations generally use protocols to stifle competition and to restrict the exchange of information.
But when the MIDI standard was drawn up, it was decided to continue a long-established convention that humanity in general and musicians in particular are mostly mathematically illiterate and not capable of basic numerical analysis. And for that reason were incapable of grasping the concept of zero. Perhaps it was a misguided attempt to give programmers something to do (programmers have so much spare time on their hands they obviously need the work). In any case, it has lead to a highly confused and rather lamentable state of affairs in the MIDI world, wherever there might be a zero. For example, MIDI physical channels 0 to 15 are mapped to logical channels 1 to 16. Patch numbers 0 - 127 are often (though not always) mapped to patch numbers 1 to 128. And if ever one encounters note numbers (instead of names) they will probably be numbered 1 to 128 (even though they are actually numbered 0 to 127).
Entities that can be negative (usually in the range -64 to +63) seemed to have escaped this confusion. But that is by virtue of the one byte twos compliment representation of these numbers. Also values that need to be zero (e.g. volume), have also escaped being remapped.
The result is a right royal dog's dinner. Some values are remapped so as to eliminate zero and some are not. The policy is curious to say the least because:
- The basic assumption, that the general public are still ignorant of
the concept of zero is incorrect. Fibonacci introduced western Europeans
to it in the 13th century. The populace in general have had seven
centuries to acquaint themselves with it. Musicians in particular,
considering the mathematical roots of their craft, are probably better
placed than any group (apart from mathematicians) to appreciate
- There is no advantage in remapping. It does not make the
specification easy to follow, nor does it change the total number of
- It creates work for programmers. Every time a physical value is
displayed a programmer must remember to add 1 in order to map it to the
logical value. Every time a user inputs a value, the program must subtract
1. It wastes memory cycles and creates problems, because if a programmer
forgets to remap, it spawns bugs, some of which are quite subtle. The
decision to remap has probably cost many thousands of hours in programming
Of course, don't go out and start a campaign to redefine the MIDI spec. We are stuck with it just like the Gregorian calendar. It seems that if you are a zero you just don't account for much.