Skip to content

Commit

Permalink
Merge pull request #1619 from TimFelixBeyer/patch-11
Browse files Browse the repository at this point in the history
  • Loading branch information
mscuthbert authored Jun 26, 2023
2 parents f771fa7 + 17c537c commit 3dfbda9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions music21/tree/fromStream.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
7 changes: 3 additions & 4 deletions music21/tree/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3dfbda9

Please sign in to comment.