Why+Binary+Numbers+Matter

There are 10 types of people in this world, those who understand binary numbers and those who don't!

BITS, BYTES & MIDI MESSAGES

We normally use ten digits - 0 to 9 - to express all numbers; this is the decimal number system. Decimal numbers can be broken down into (right-to-left) powers of 10: **1’s, 10’s, 100’s, 1000’s, etc**. When we see the numeric expression **625**, we automatically process that there are 6 hundreds, 2 tens and 5 ones: 600 + 20 + 5 = 625.


 * 100’s || 10’s || 1’s ||
 * ** 6 ** || ** 2 ** || ** 5 ** ||  ||

Computer messages employ BINARY numbers, named as such because they employ only two digits: 0 and 1. In the binary system, numbers are broken down into (right-to-left) powers of 2: **1’s, 2’s, 4’s, 8’s, etc**. A single digit of binary code is a BIT (short for **B**inary dig**IT**). Eight bits make a **BYTE**. //What would you call 4 bits?// Here is a binary byte.


 * 128’s || 64’s || 32’s || 16’s || 8’s || 4’s || 2’s || 1’s ||
 * ** 0 ** || ** 1 ** || ** 0 ** || ** 0 ** || ** 0 ** || ** 1 ** || ** 0 ** || ** 0 ** ||  ||

The above example shows that the byte **01000100** is equal to the decimal number 68, because there is a “1” in the 64 place and a “1” in the 4 place. 64 + 4 = 68//. Do you see the pattern?//

One BIT can represent 2 values (21) from 0 to 1. Two BITS can represent 4 values (22) from 0 to 3. Three BITS can represent 8 values (23) from 0 to 7.

Eight BITS (1 BYTE) can represent 256 values (28) from 0 to 255).


 * IF YOU HAVE “n” BITS, YOU CAN EXPRESS 2n DIFFERENT VALUES. **


 * HOW DOES THIS HELP FURTHER EXPLAIN MIDI? **

Well, think about it. The following is a list of parameters in the standard MIDI specification:


 * 16 Channels
 * 128 GM (General MIDI) Sounds
 * Volume Range 0 to 127
 * Velocity Range 0 to 127


 * MIDI MESSAGES **

There are two types of MIDI Bytes: STATUS BYTES and DATA BYTES. The first byte of every MIDI message is a STATUS byte, which tells what kind of data, is to be relayed. Then come one or more DATA bytes, which are just values. .

The first bit of a STATUS byte is a “1”; the first bit of a DATA byte is a “0”. The following typical MIDI message - a “NOTE ON” event - consists of 1 STATUS byte and 2 DATA bytes:

**// 3 BYTES OF THE “NOTE ON” MESSAGE //** message is for. ||
 * This 1 tells us this is astatus byte. |||||| These 3 bits tell which type of message it is. |||||||| These 4 bits tell which channel the
 * ** 1 ** || ** 0 ** || ** 0 ** || ** 1 ** || ** 0 ** || ** 0 ** || ** 0 ** || ** 0 ** ||  ||
 * The first bit relays, “I am a STATUS byte!”
 * The next three bits relay, “NOTE ON” (001 is the code for the note on message)
 * The final four bits relay, “on CHANNEL 1 “ (binary 0 = channel 1)
 * The final four bits relay, “on CHANNEL 1 “ (binary 0 = channel 1)


 * This 0 tells us this is adata byte. |||||||||||||| These 7 bits identify the KEY #. Key #60 is middle C. ||
 * ** 0 ** || ** 0 ** || ** 1 ** || ** 1 ** || ** 1 ** || ** 1 ** || ** 0 ** || ** 0 ** ||  ||

Here, the Velocity value is 64. ||
 * This 0 tells us this is a data byte. |||||||||||||| These 7 bits tell us the velocity of the key down event.
 * ** 0 ** || ** 1 ** || ** 0 ** || ** 0 ** || ** 0 ** || ** 0 ** || ** 0 ** || ** 0 ** ||  ||


 * INTRO. TO MIDI THEORY REVIEW – If you can answer these questions, then you’re on the right track! **


 * // Why can the MIDI specification only support 16 channels? //


 * // How many different types of STATUS bytes (things like “Note On”, “Note Off”, “Patch Change”, etc.) are there? //