Skip to content

Commit 5acd04e

Browse files
authored
Merge pull request #3 from gregchapman-dev/gregc/noM21InAnnotatedObjects
Don't store note_list (a list of music21 Notes) in AnnVoice.
2 parents 91f932e + 3f173e5 commit 5acd04e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

musicdiff/annotation.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,23 +251,23 @@ def __init__(self, voice):
251251
voice (music21.stream.Voice): The music21 voice to extend.
252252
"""
253253
self.voice = voice.id
254-
self.note_list = M21Utils.get_notes(voice)
255-
if not self.note_list:
254+
note_list = M21Utils.get_notes(voice)
255+
if not note_list:
256256
self.en_beam_list = []
257257
self.tuplet_list = []
258258
self.tuple_info = []
259259
self.annot_notes = []
260260
else:
261261
self.en_beam_list = M21Utils.get_enhance_beamings(
262-
self.note_list
262+
note_list
263263
) # beams and type (type for note shorter than quarter notes)
264264
self.tuplet_list = M21Utils.get_tuplets_type(
265-
self.note_list
265+
note_list
266266
) # corrected tuplets (with "start" and "continue")
267-
self.tuple_info = M21Utils.get_tuplets_info(self.note_list)
267+
self.tuple_info = M21Utils.get_tuplets_info(note_list)
268268
# create a list of notes with beaming and tuplets information attached
269269
self.annot_notes = []
270-
for i, n in enumerate(self.note_list):
270+
for i, n in enumerate(note_list):
271271
self.annot_notes.append(
272272
AnnNote(n, self.en_beam_list[i], self.tuplet_list[i])
273273
)

0 commit comments

Comments
 (0)