make_lilypond_file

rhythmmakertools.make_lilypond_file(selections, divisions=None, attach_lilypond_voice_commands=None, implicit_scaling=None, pitched_staff=None, simultaneous_selections=None, time_signatures=None)

Makes LilyPond file.

Makes rhythmic staff:

>>> maker = rhythmmakertools.EvenRunRhythmMaker(exponent=1)
>>> divisions = [(3, 4), (4, 8), (1, 4)]
>>> selections = maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Set time signatures explicitly:

>>> maker = rhythmmakertools.EvenRunRhythmMaker(exponent=1)
>>> divisions = [(3, 4), (4, 8), (1, 4)]
>>> selections = maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     [(6, 8), (4, 8), (2, 8)],
...     )
>>> show(lilypond_file) 

Makes pitched staff:

>>> maker = rhythmmakertools.EvenRunRhythmMaker(exponent=1)
>>> divisions = [(3, 4), (4, 8), (1, 4)]
>>> selections = maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     pitched_staff=True,
...     )
>>> show(lilypond_file) 

Makes simultaneous voices:

>>> maker_1 = rhythmmakertools.EvenRunRhythmMaker(exponent=1)
>>> divisions = [(3, 4), (4, 8), (1, 4)]
>>> selection_1 = select(maker_1(divisions))
>>> for note in iterate(selection_1).by_class(Note):
...     note.written_pitch = NamedPitch("e'")
... 
>>> maker_2 = rhythmmakertools.EvenRunRhythmMaker(exponent=2)
>>> selection_2 = select(maker_2(divisions))
>>> selections = {
...     'Voice 1': selection_1,
...     'Voice 2': selection_2,
... }
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> voice_1 = lilypond_file['Voice 1']
>>> attach(LilyPondCommand('voiceOne'), voice_1)
>>> voice_2 = lilypond_file['Voice 2']
>>> attach(LilyPondCommand('voiceTwo'), voice_2)
>>> show(lilypond_file) 

Used in rhythm-maker docs.

Returns LilyPond file.