X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=python%2Fmusicexp.py;h=f049884c30db8330e03eb828e54b6d130c1b8750;hb=1b33373833dcc4443fdfcd6cf7348d2b680ccc9c;hp=01cd446f481fc0b83c33fed9e5783aea3d78c00f;hpb=3705a710800add3cce90f3c47cda18ddf66cac91;p=lilypond.git diff --git a/python/musicexp.py b/python/musicexp.py index 01cd446f48..f049884c30 100644 --- a/python/musicexp.py +++ b/python/musicexp.py @@ -805,7 +805,7 @@ class BarLine (Music): if self.bar_number > 0 and (self.bar_number % 10) == 0: printer.dump ("\\barNumberCheck #%d " % self.bar_number) - else: + elif self.bar_number > 0: printer.print_verbatim (' %% %d' % self.bar_number) printer.newline () @@ -1617,6 +1617,34 @@ class DrumStaff (Staff): class RhythmicStaff (Staff): def __init__ (self, command = "RhythmicStaff"): Staff.__init__ (self, command) + +class Score: + def __init__ (self): + self.contents = None + self.create_midi = False + + def set_contents (self, contents): + self.contents = contents + + def set_part_information (self, part_id, staves_info): + if self.contents: + self.contents.set_part_information (part_id, staves_info) + + def print_ly (self, printer): + printer.dump ("\\score {"); + printer.newline () + if self.contents: + self.contents.print_ly (printer); + printer.dump ("\\layout {}"); + printer.newline () + if not self.create_midi: + printer.dump ("% To create MIDI output, uncomment the following line:"); + printer.newline (); + printer.dump ("% "); + printer.dump ("\\midi {}"); + printer.newline () + printer.dump ("}"); + printer.newline () def test_pitch ():