Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions music21/stream/makeNotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Jacob Walls
# Evan Lynch
#
# Copyright: Copyright © 2008-2024 Michael Scott Asato Cuthbert
# Copyright: Copyright © 2008-2026 Michael Scott Asato Cuthbert
# License: BSD, see license.txt
# -----------------------------------------------------------------------------
from __future__ import annotations
Expand Down Expand Up @@ -1320,9 +1320,8 @@ def makeTies(
# manage bridging voices
if mNextHasVoices:
if mHasVoices: # try to match voice id
if not isinstance(vId, int):
dst = mNext.voices[vId]
else:
dst = mNext.voices.getElementById(vId)
if dst is None:
dst = mNext.getElementById(vId)
# src does not have voice, but dst does
else: # place in top-most voice
Expand Down Expand Up @@ -2347,6 +2346,21 @@ def testMakeTiesChangingTimeSignatures(self):
self.assertEqual(len(pp[stream.Measure][2].notes), 1)
self.assertEqual(pp[stream.Measure][2].notes.first().duration.quarterLength, 24.0)

def testMakeTiesMissingStringVoiceId(self):
from music21 import stream
part = stream.Part()
firstMeasure = stream.Measure()
sourceVoice = stream.Voice(id='6')
sourceVoice.insert(0, note.Note(quarterLength=1))
sourceVoice.insert(5, note.Note(quarterLength=1))
firstMeasure.insert(0, sourceVoice)
secondMeasure = stream.Measure([stream.Voice(id='1')])
part.append([firstMeasure, secondMeasure])

part.makeRests(fillGaps=True, inPlace=True)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this testing makeTies? I see just makeRests here? Test what is claimed to be testing.


self.assertEqual(secondMeasure[note.Rest].first().quarterLength, 1.0)

def testConsolidateCompletedTupletsNoFalsePositive(self):
from fractions import Fraction
from music21 import converter
Expand Down
Loading