code: def play_Bar(self, bar):
          
          self.set_deltatime(self.delay)
          self.delay = 0
          self.set_meter(bar.meter)
          self.set_deltatime(0)
          self.set_key(bar.key)
          for x in bar:
              tick = int(round((1.0 / x[1]) * 288))
              if x[2] is None or len(x[2]) == 0:
                  self.delay += tick
              else:
                  self.set_deltatime(self.delay)
                  self.delay = 0
                  if hasattr(x[2], 'bpm'):
                      self.set_deltatime(0)
                      self.set_tempo(x[2].bpm)
                  self.play_NoteContainer(x[2])
                  self.set_deltatime(self.int_to_varbyte(tick))
                  self.stop_NoteContainer(x[2])
docs: Convert a Bar object to MIDI events and write them to the
          track_data.