When we encounter a note with a different staff value than the
previous note in that voice, simply add the \change Staff=.. event
into the notes. However, this does not work inside chords, so we
ignore all staff changes inside chords. I'll have to find a different
way to print some notes of a chord on one staff and the other notes
on the other staff...
return clefsetting
+class StaffChange (Music):
+ def __init__ (self, staff):
+ Music.__init__ (self)
+ self.staff = staff
+ def ly_expression (self):
+ if self.staff:
+ return "\\change Staff=\"%s\"" % self.staff
+ else:
+ return ''
+
+
class MultiMeasureRest(Music):
def lisp_expression (self):
is_chord = False
ignore_lyrics = False
+ current_staff = None
+
# TODO: Make sure that the keys in the dict don't get reordered, since
# we need the correct ordering of the lyrics stanzas! By default,
# a dict will reorder its keys
is_chord = n.get_maybe_exist_named_child ('chord')
if not is_chord:
+ s = n.get_maybe_exist_named_child ('staff')
+ if s:
+ staff = s.get_text ()
+ if current_staff and staff <> current_staff:
+ voice_builder.add_command (musicexp.StaffChange (staff))
+ current_staff = staff
try:
voice_builder.jumpto (n._when)
except NegativeSkip, neg: