diff --git a/music21/tree/fromStream.py b/music21/tree/fromStream.py index 39f38bf49..963d3a552 100644 --- a/music21/tree/fromStream.py +++ b/music21/tree/fromStream.py @@ -241,9 +241,8 @@ def recurseGetTreeByClass( if classList and element.classSet.isdisjoint(classList): continue - endTime = flatOffset + element.duration.quarterLength - if useTimespans: + endTime = flatOffset + element.duration.quarterLength pitchedTimespan = spans.PitchedTimespan( element=element, parentage=tuple(reversed(currentParentage)), diff --git a/music21/tree/node.py b/music21/tree/node.py index a49c92741..2b7965e5c 100644 --- a/music21/tree/node.py +++ b/music21/tree/node.py @@ -260,14 +260,13 @@ def updateEndTimes(self): Returns None. ''' - pos = self.position - if isinstance(pos, SortTuple): - pos = pos.offset - try: endTimeLow = self.payload.endTime endTimeHigh = endTimeLow except AttributeError: # elements do not have endTimes. do NOT mix elements and timespans. + pos = self.position + if isinstance(pos, SortTuple): + pos = pos.offset endTimeLow = pos + self.payload.duration.quarterLength endTimeHigh = endTimeLow