def make_lilypond_file(score, now, title, subtitle=None): # composer = 'Jonathan Marmor' # composer = '' # For anonymized, 10-pack version lilypond_file = lilypondfiletools.make_basic_lilypond_file(score) lilypond_file.header_block.title = Markup(title) if subtitle: lilypond_file.header_block.subtitle = Markup(subtitle) # lilypond_file.header_block.composer = Markup(composer) footer_title = title if subtitle: footer_title = '{} - {}'.format(subtitle, title) footer_message = '{} - {}'.format(footer_title, now.strftime('%Y-%m-%d %H:%M:%S')) footer_markup = """\\column {{ \\fill-line {{ \\teeny {{ "{}" }} }} }}""".format(footer_message) lilypond_file.paper_block.oddFooterMarkup = Markup(footer_markup) lilypond_file.paper_block.evenFooterMarkup = Markup(footer_markup) return lilypond_file
notes = [[note_map[x](4) for x in c] for p in perm for c in p] print("Creating Staves") staves = [Staff(c) for c in notes] for st in staves: time_sig = indicatortools.TimeSignature((4, 4)) clef = Clef('percussion') attach(time_sig, st) attach(clef, st) make_three_line(st) override(st).clef.stencil = False print("Building Book Parts") bps = [wrap_in_book_part(s) for s in staves] book = make_book() lyf = lyft.make_basic_lilypond_file() print("Attaching Book Parts") for bp in bps: book.items.append(bp) # constructor would insert book into a score block print("Creating file") lyf.items.append(book) setup_paper(lyf, 30, 30) fp = u"/home/danny/dev/python/steel/notation/section{}-{}.ly".format(1, 2) with open(fp, "w") as f: f.write(format(lyf)) print(u"done! file lives in: {}".format(fp))