code: def change_note_duration(self, at, to):
          
          if valid_beat_duration(to):
              diff = 0
              for x in self.bar:
                  if diff != 0:
                      x[0][0] -= diff
                  if x[0] == at:
                      cur = x[0][1]
                      x[0][1] = to
                      diff = 1 / cur - 1 / to
docs: Change the note duration at the given index to the given
          duration.