MIDI Lab: bytetable





    bytetable prints out the decimal-hexadecimal-binary equivalences for each possible bit combination in a byte. It is useful for explaining the MIDI protocol and standard MIDI files.

    Here is the command synopsis:

      Print a number-conversion table for one byte
      
      Usage: bytetable [-a][-c][-n][-z] number(s)
      
      Options:
         -a = add a column of printable ASCII character equivalents
         -c = add a comma in the middle of binary numbers
         -n = print a table which includes the negative numbers
         -z = fill in empty digits for binary and hex numbers
         --options = list all options, default values, and aliases
      

    Example usage of the bytetable program (click on the command to see the output):

      > # display a table of dec/hex/binary values for one byte
      > bytetable
      
      > # display a table of dec/hex/binary using the signed range
      > bytetable -n
      
      > # display a table of dec/hex/binary filling in empty digits
      > bytetable -z
      
      > # display a table of dec/hex/binary adding a comma in the binaries
      > bytetable -c
      
      > # display a table of dec/hex/binary adding printable ASCII codes
      > bytetable -a
      
    
    

    Suppose that you want to find the equivalences for the hex number fd, then you could run this command:

      > bytetable | grep fd
      253	fd	11111101
      

    Or, if you want to know the ASCII code for the letter 'M':

      > bytetable -a | grep M
      77	4d	1001101	'M'
      

    Or, if you want to know the equivalences for hex value for 0x44:

      > bytetable -a | grep ...44
      68	44	1000100	'D'
      

    Here are the outputs from all possible command-line option combinations:

    -- Craig Stuart Sapp