code: def key_signature_event(self, key='C'):
          
          if key.islower():
              val = minor_keys.index(key) - 7
              mode = '\x01'
          else:
              val = major_keys.index(key) - 7
              mode = '\x00'
          if val < 0:
              val = 256 + val
          key = a2b_hex('%02x' % val)
          return '{0}{1}{2}\x02{3}{4}'.format(self.delta_time, META_EVENT,
                  KEY_SIGNATURE, key, mode)
docs: Return the bytes for a key signature event.