class_docstr: MIDI File.
  
  Parameters
  ----------
  filename : str
      MIDI file name.
  file_format : int, optional
      MIDI file format (0, 1, 2).
  ticks_per_beat : int, optional
      Resolution (i.e. ticks per quarter note) of the MIDI file.
  unit : str, optional
      Unit of all MIDI messages, can be one of the following:
  
      - 'ticks', 't': use native MIDI ticks as unit,
      - 'seconds', 's': use seconds as unit,
      - 'beats', 'b' : use beats as unit.
  
  timing : str, optional
      Timing of all MIDI messages, can be one of the following:
  
      - 'absolute', 'abs', 'a': use absolute timing.
      - 'relative', 'rel', 'r': use relative timing, i.e. delta to
        previous message.
  
  Examples
  --------
  Create a MIDI file from an array with notes. The format of the note array
  is: 'onset time', 'pitch', 'duration', 'velocity', 'channel'. The last
  column can be omitted, assuming channel 0.
  
  >>> notes = np.array([[0, 50, 1, 60], [0.5, 62, 0.5, 90]])
  >>> m = MIDIFile.from_notes(notes)
  >>> m  # doctest: +ELLIPSIS
  <madmom.io.midi.MIDIFile object at 0x...>
  
  The notes can be accessed as a numpy array in various formats (default is
  seconds):
  
  >>> m.notes
  array([[ 0. , 50. ,  1. , 60. ,  0. ],
         [ 0.5, 62. ,  0.5, 90. ,  0. ]])
  >>> m.unit ='ticks'
  >>> m.notes
  array([[  0.,  50., 960.,  60.,   0.],
         [480.,  62., 480.,  90.,   0.]])
  >>> m.unit = 'seconds'
  >>> m.notes
  array([[ 0. , 50. ,  1. , 60. ,  0. ],
         [ 0.5, 62. ,  0.5, 90. ,  0. ]])
  >>> m.unit = 'beats'
  >>> m.notes
  array([[ 0., 50.,  2., 60.,  0.],
         [ 1., 62.,  1., 90.,  0.]])
  
  >>> m = MIDIFile.from_notes(notes, tempo=60)
  >>> m.notes
  array([[ 0. , 50. ,  1. , 60. ,  0. ],
         [ 0.5, 62. ,  0.5, 90. ,  0. ]])
  >>> m.unit = 'ticks'
  >>> m.notes
  array([[  0.,  50., 480.,  60.,   0.],
         [240.,  62., 240.,  90.,   0.]])
  >>> m.unit = 'beats'
  >>> m.notes
  array([[ 0. , 50. ,  1. , 60. ,  0. ],
         [ 0.5, 62. ,  0.5, 90. ,  0. ]])
  
  >>> m = MIDIFile.from_notes(notes, time_signature=(2, 2))
  >>> m.notes
  array([[ 0. , 50. ,  1. , 60. ,  0. ],
         [ 0.5, 62. ,  0.5, 90. ,  0. ]])
  >>> m.unit = 'ticks'
  >>> m.notes
  array([[   0.,   50., 1920.,   60.,    0.],
         [ 960.,   62.,  960.,   90.,    0.]])
  >>> m.unit = 'beats'
  >>> m.notes
  array([[ 0., 50.,  2., 60.,  0.],
         [ 1., 62.,  1., 90.,  0.]])
  
  >>> m = MIDIFile.from_notes(notes, tempo=60, time_signature=(2, 2))
  >>> m.notes
  array([[ 0. , 50. ,  1. , 60. ,  0. ],
         [ 0.5, 62. ,  0.5, 90. ,  0. ]])
  >>> m.unit = 'ticks'
  >>> m.notes
  array([[  0.,  50., 960.,  60.,   0.],
         [480.,  62., 480.,  90.,   0.]])
  >>> m.unit = 'beats'
  >>> m.notes
  array([[ 0. , 50. ,  1. , 60. ,  0. ],
         [ 0.5, 62. ,  0.5, 90. ,  0. ]])
  
  >>> m = MIDIFile.from_notes(notes, tempo=240, time_signature=(3, 8))
  >>> m.notes
  array([[ 0. , 50. ,  1. , 60. ,  0. ],
         [ 0.5, 62. ,  0.5, 90. ,  0. ]])
  >>> m.unit = 'ticks'
  >>> m.notes
  array([[  0.,  50., 960.,  60.,   0.],
         [480.,  62., 480.,  90.,   0.]])
  >>> m.unit = 'beats'
  >>> m.notes
  array([[ 0., 50.,  4., 60.,  0.],
         [ 2., 62.,  2., 90.,  0.]])
class_docstr_tok: ["MIDI","File",".","Parameters","--","--","--","--","--","filename",":","str","MIDI","file","name",".","file_format",":","int",",","optional","MIDI","file","format","(","0",",","1",",","2",")",".","ticks_per_beat",":","int",",","optional","Resolution","(","i.e",".","ticks","per","quarter","note",")","of","the","MIDI","file",".","unit",":","str",",","optional","Unit","of","all","MIDI","messages",",","can","be","one","of","the","following",":","-","'ticks","'",",","'t","'",":","use","native","MIDI","ticks","as","unit",",","-","'seconds","'",",","'s","'",":","use","seconds","as","unit",",","-","'beats","'",",","'","b","'",":","use","beats","as","unit",".","timing",":","str",",","optional","Timing","of","all","MIDI","messages",",","can","be","one","of","the","following",":","-","'absolute","'",",","'abs","'",",","'","a","'",":","use","absolute","timing",".","-","'relative","'",",","'rel","'",",","'","r","'",":","use","relative","timing",",","i.e",".","delta","to","previous","message",".","Examples","--","--","--","--","Create","a","MIDI","file","from","an","array","with","notes",".","The","format","of","the","note","array","is",":","'onset","time","'",",","'pitch","'",",","'duration","'",",","'velocity","'",",","'channel","'",".","The","last","column","can","be","omitted",",","assuming","channel","0",".",">",">",">","notes","=","np.array","(","[","[","0",",","50",",","1",",","60","]",",","[","0.5",",","62",",","0.5",",","90","]","]",")",">",">",">","m","=","MIDIFile.from_notes","(","notes",")",">",">",">","m","#","doctest",":","+ELLIPSIS","<","madmom.io.midi.MIDIFile","object","at","0x","...",">","The","notes","can","be","accessed","as","a","numpy","array","in","various","formats","(","default","is","seconds",")",":",">",">",">","m.notes","array","(","[","[","0.",",","50.",",","1.",",","60.",",","0",".","]",",","[","0.5",",","62.",",","0.5",",","90.",",","0",".","]","]",")",">",">",">","m.unit","='ticks'",">",">",">","m.notes","array","(","[","[","0.",",","50.",",","960.",",","60.",",","0",".","]",",","[","480.",",","62.",",","480.",",","90.",",","0",".","]","]",")",">",">",">","m.unit","=","'seconds'",">",">",">","m.notes","array","(","[","[","0.",",","50.",",","1.",",","60.",",","0",".","]",",","[","0.5",",","62.",",","0.5",",","90.",",","0",".","]","]",")",">",">",">","m.unit","=","'beats'",">",">",">","m.notes","array","(","[","[","0.",",","50.",",","2.",",","60.",",","0",".","]",",","[","1.",",","62.",",","1.",",","90.",",","0",".","]","]",")",">",">",">","m","=","MIDIFile.from_notes","(","notes",",","tempo=60",")",">",">",">","m.notes","array","(","[","[","0.",",","50.",",","1.",",","60.",",","0",".","]",",","[","0.5",",","62.",",","0.5",",","90.",",","0",".","]","]",")",">",">",">","m.unit","=","'ticks'",">",">",">","m.notes","array","(","[","[","0.",",","50.",",","480.",",","60.",",","0",".","]",",","[","240.",",","62.",",","240.",",","90.",",","0",".","]","]",")",">",">",">","m.unit","=","'beats'",">",">",">","m.notes","array","(","[","[","0.",",","50.",",","1.",",","60.",",","0",".","]",",","[","0.5",",","62.",",","0.5",",","90.",",","0",".","]","]",")",">",">",">","m","=","MIDIFile.from_notes","(","notes",",","time_signature=","(","2",",","2",")",")",">",">",">","m.notes","array","(","[","[","0.",",","50.",",","1.",",","60.",",","0",".","]",",","[","0.5",",","62.",",","0.5",",","90.",",","0",".","]","]",")",">",">",">","m.unit","=","'ticks'",">",">",">","m.notes","array","(","[","[","0.",",","50.",",","1920.",",","60.",",","0",".","]",",","[","960.",",","62.",",","960.",",","90.",",","0",".","]","]",")",">",">",">","m.unit","=","'beats'",">",">",">","m.notes","array","(","[","[","0.",",","50.",",","2.",",","60.",",","0",".","]",",","[","1.",",","62.",",","1.",",","90.",",","0",".","]","]",")",">",">",">","m","=","MIDIFile.from_notes","(","notes",",","tempo=60",",","time_signature=","(","2",",","2",")",")",">",">",">","m.notes","array","(","[","[","0.",",","50.",",","1.",",","60.",",","0",".","]",",","[","0.5",",","62.",",","0.5",",","90.",",","0",".","]","]",")",">",">",">","m.unit","=","'ticks'",">",">",">","m.notes","array","(","[","[","0.",",","50.",",","960.",",","60.",",","0",".","]",",","[","480.",",","62.",",","480.",",","90.",",","0",".","]","]",")",">",">",">","m.unit","=","'beats'",">",">",">","m.notes","array","(","[","[","0.",",","50.",",","1.",",","60.",",","0",".","]",",","[","0.5",",","62.",",","0.5",",","90.",",","0",".","]","]",")",">",">",">","m","=","MIDIFile.from_notes","(","notes",",","tempo=240",",","time_signature=","(","3",",","8",")",")",">",">",">","m.notes","array","(","[","[","0.",",","50.",",","1.",",","60.",",","0",".","]",",","[","0.5",",","62.",",","0.5",",","90.",",","0",".","]","]",")",">",">",">","m.unit","=","'ticks'",">",">",">","m.notes","array","(","[","[","0.",",","50.",",","960.",",","60.",",","0",".","]",",","[","480.",",","62.",",","480.",",","90.",",","0",".","]","]",")",">",">",">","m.unit","=","'beats'",">",">",">","m.notes","array","(","[","[","0.",",","50.",",","4.",",","60.",",","0",".","]",",","[","2.",",","62.",",","2.",",","90.",",","0",".","]","]",")"]
docstr: Tempi (microseconds per quarter note) of the MIDI file.
  
  Returns
  -------
  tempi : numpy array
      Array with tempi (time, tempo).
  
  Notes
  -----
  The time will be given in the unit set by `unit`.
docstr_tok: ["Tempi","(","microseconds","per","quarter","note",")","of","the","MIDI","file",".","Returns","--","--","--","-","tempi",":","numpy","array","Array","with","tempi","(","time",",","tempo",")",".","Notes","--","--","-","The","time","will","be","given","in","the","unit","set","by","`","unit","`","."]
code: def tempi(self):
      """
      Tempi (microseconds per quarter note) of the MIDI file.
  
      Returns
      -------
      tempi : numpy array
          Array with tempi (time, tempo).
  
      Notes
      -----
      The time will be given in the unit set by `unit`.
  
      """
      # list for all tempi
      tempi = []
      # process all events
      for msg in self:
          if msg.type == "set_tempo":
              tempi.append((msg.time, msg.tempo))
      # make sure a tempo is set (and occurs at time 0)
      if not tempi or tempi[0][0] > 0:
          tempi.insert(0, (0, DEFAULT_TEMPO))
      # tempo is given in microseconds per quarter note
      # TODO: add option to return in BPM
      return np.asarray(tempi, float)
  
imports: from __future__ import absolute_import, division, print_function
  import warnings
  import mido
  import numpy
label_desc: Use image node_id 4 for calling the MIDIFile obj's underlying member method code with example usage: obj.tempi() and returns: np