LilyPond template gallery
=========================

Abjad provides a number of score templates in the ``abjad/templates`` directory:

<abjad>
from abjad.tools import configurationtools
configurationtools.list_abjad_templates()
print repr(configurationtools.list_abjad_templates()) <hide
</abjad>

Templates provide header, layout, paper and grob settings for different types of score.

Default LilyPond layout
-----------------------

<abjad>
import random
pitches = [random.randrange(0, 25) for x in range(32)]
staff_1 = Staff([])
staff_2 = Staff([])
score = Score([staff_1, staff_2])
staff_1.extend([Note(x, (1, 8)) for x in pitches[:16]])
staff_2.extend([Note(x, (1, 8)) for x in pitches[16:]])
iotools.write_expr_to_ly(score, 'templates-default') <hide
show(score)
</abjad>

``lagos.ly``
------------

<abjad>
import random <hide
pitches = [random.randrange(0, 25) for x in range(32)]
staff_1 = Staff([])
staff_2 = Staff([])
score = Score([staff_1, staff_2])
staff_1.extend([Note(x, (1, 8)) for x in pitches[:16]])
staff_2.extend([Note(x, (1, 8)) for x in pitches[16:]])
iotools.write_expr_to_ly(score, 'templates-lagos', template = 'lagos') <hide
show(score, template = 'lagos')
</abjad>

``oedo.ly``
-----------

<abjad>
import random <hide
pitches = [random.randrange(0, 25) for x in range(32)]
staff_1 = Staff([])
staff_2 = Staff([])
score = Score([staff_1, staff_2])
staff_1.extend([Note(x, (1, 8)) for x in pitches[:16]])
staff_2.extend([Note(x, (1, 8)) for x in pitches[16:]])
iotools.write_expr_to_ly(score, 'templates-oedo', template = 'oedo') <hide
show(score, template = 'oedo')
</abjad>

``tangiers.ly``
---------------

<abjad>
import random <hide
pitches = [random.randrange(0, 25) for x in range(32)]
staff_1 = Staff([])
staff_2 = Staff([])
score = Score([staff_1, staff_2])
staff_1.extend([Note(x, (1, 8)) for x in pitches[:16]])
staff_2.extend([Note(x, (1, 8)) for x in pitches[16:]])
iotools.write_expr_to_ly(score, 'templates-tangiers', template = 'tangiers') <hide
show(score, template = 'tangiers')
</abjad>

``tirnaveni.ly``
----------------

<abjad>
import random <hide
pitches = [random.randrange(0, 25) for x in range(32)]
staff_1 = Staff([])
staff_2 = Staff([])
score = Score([staff_1, staff_2])
staff_1.extend([Note(x, (1, 8)) for x in pitches[:16]])
staff_2.extend([Note(x, (1, 8)) for x in pitches[16:]])
iotools.write_expr_to_ly(score, 'templates-tirnaveni', template = 'tirnaveni') <hide
show(score, template = 'tirnaveni')
</abjad>
