@@ -896,6 +896,55 @@ def mark_diffs(
896896 textExp .style .color = Visualization .CHANGED_COLOR
897897 note2 .activeSite .insert (note2 .offset , textExp )
898898
899+ # lyrics
900+ elif op [0 ] == "inslyric" :
901+ assert isinstance (op [1 ], AnnNote )
902+ assert isinstance (op [2 ], AnnNote )
903+ # color the modified note in both scores using Visualization.INSERTED_COLOR
904+ note1 = score1 .recurse ().getElementById (op [1 ].general_note )
905+ note1 .style .color = Visualization .INSERTED_COLOR
906+ textExp = m21 .expressions .TextExpression ("inserted lyric" )
907+ textExp .style .color = Visualization .INSERTED_COLOR
908+ note1 .activeSite .insert (note1 .offset , textExp )
909+
910+ note2 = score2 .recurse ().getElementById (op [2 ].general_note )
911+ note2 .style .color = Visualization .INSERTED_COLOR
912+ textExp = m21 .expressions .TextExpression ("inserted lyric" )
913+ textExp .style .color = Visualization .INSERTED_COLOR
914+ note2 .activeSite .insert (note2 .offset , textExp )
915+
916+ elif op [0 ] == "dellyric" :
917+ assert isinstance (op [1 ], AnnNote )
918+ assert isinstance (op [2 ], AnnNote )
919+ # color the modified note in both scores using Visualization.DELETED_COLOR
920+ note1 = score1 .recurse ().getElementById (op [1 ].general_note )
921+ note1 .style .color = Visualization .DELETED_COLOR
922+ textExp = m21 .expressions .TextExpression ("deleted lyric" )
923+ textExp .style .color = Visualization .DELETED_COLOR
924+ note1 .activeSite .insert (note1 .offset , textExp )
925+
926+ note2 = score2 .recurse ().getElementById (op [2 ].general_note )
927+ note2 .style .color = Visualization .DELETED_COLOR
928+ textExp = m21 .expressions .TextExpression ("deleted lyric" )
929+ textExp .style .color = Visualization .DELETED_COLOR
930+ note2 .activeSite .insert (note2 .offset , textExp )
931+
932+ elif op [0 ] == "editlyric" :
933+ assert isinstance (op [1 ], AnnNote )
934+ assert isinstance (op [2 ], AnnNote )
935+ # color the modified note (in both scores) using Visualization.CHANGED_COLOR
936+ note1 = score1 .recurse ().getElementById (op [1 ].general_note )
937+ note1 .style .color = Visualization .CHANGED_COLOR
938+ textExp = m21 .expressions .TextExpression ("changed lyric" )
939+ textExp .style .color = Visualization .CHANGED_COLOR
940+ note1 .activeSite .insert (note1 .offset , textExp )
941+
942+ note2 = score2 .recurse ().getElementById (op [2 ].general_note )
943+ note2 .style .color = Visualization .CHANGED_COLOR
944+ textExp = m21 .expressions .TextExpression ("changed lyric" )
945+ textExp .style .color = Visualization .CHANGED_COLOR
946+ note2 .activeSite .insert (note2 .offset , textExp )
947+
899948 else :
900949 print (f"Annotation type { op [0 ]} not yet supported for visualization" , file = sys .stderr )
901950
0 commit comments