code: def write(obj, filepath):
      
      if not isinstance(obj, Multitrack):
          raise TypeError("Support only `pypianoroll.Multitrack` class objects")
      obj.write(filepath)
docs: Write the object to a MIDI file.
  
      Parameters
      ----------
      filepath : str
          The path to write the MIDI file.