File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -273,8 +273,10 @@ def check_lyrics(self, voice_id):
273273 if voice_section :
274274 voice_section .merge_lyrics (lyrics_section , voice_id )
275275 else :
276- # A potentially slow path
277- voice_section = self .score .find_section_for_voice (voice_id )
276+ voice_section = self .score .find_section_for_voice (voice_id , self .sections )
277+ if not voice_section :
278+ # A potentially slow path, search the whole score
279+ voice_section = self .score .find_section_for_voice (voice_id )
278280 if voice_section :
279281 # Must explicitly only merge with notes with the same voice_id
280282 voice_section .merge_lyrics (lyrics_section , voice_id )
Original file line number Diff line number Diff line change @@ -274,16 +274,14 @@ def debug_group(g):
274274 for i in self .partlist :
275275 debug_group (i )
276276
277- def find_section_for_voice (self , voice_context , parent = None ):
278- partlist = self .partlist
279-
280- if parent :
281- partlist = parent .partlist
277+ def find_section_for_voice (self , voice_context , partlist = None ):
278+ if not partlist :
279+ partlist = self .partlist
282280
283281 for section in partlist [::- 1 ]:
284282 # Iterate over sections in partlist, in reverser order (newest to oldest)
285283 if isinstance (section , ScorePartGroup ):
286- section_candidate = self .find_section_for_voice (voice_context , section )
284+ section_candidate = self .find_section_for_voice (voice_context , section . partlist )
287285 if section_candidate :
288286 return section_candidate
289287 elif isinstance (section , ScoreSection ):
You can’t perform that action at this time.
0 commit comments