From 0e801f60d59b45e747f876e9ab328b76c7633cd0 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Tue, 18 Sep 2007 23:12:48 +0200 Subject: [PATCH] MusicXML: Staves with multiple voices get \voiceOne and \voiceTwo When a staff has more than one voice, we get tons of colliding stems, so put \voiceOne in the first voice and \voiceTwo in the remaining. This still breaks with more than two voices, but the majority of cases works fine now. Signed-off-by: Reinhold Kainhofer --- python/musicexp.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/musicexp.py b/python/musicexp.py index 40d98aca02..d93d2818be 100644 --- a/python/musicexp.py +++ b/python/musicexp.py @@ -960,8 +960,14 @@ class Staff (StaffGroup): else: printer ('\\context Staff << ') printer.newline () + n = 0 + nr_voices = len (voices) for [v, lyrics] in voices: - printer ('\\context Voice = "%s" \\%s' % (v,v)) + n += 1 + voice_count_text = '' + if nr_voices > 1: + voice_count_text = {1: ' \\voiceOne'}.get (n, ' \\voiceTwo') + printer ('\\context Voice = "%s" {%s \\%s }' % (v,voice_count_text,v)) printer.newline () for l in lyrics: -- 2.39.5