Rests
=====


Making rests from strings
-------------------------

You can make rests from a LilyPond input string:

<abjad>
rest = Rest('r8')
show(rest)
</abjad>


Making rests from durations
---------------------------

You can also make rests from a duration:

<abjad>
rest = Rest(Duration(1, 4))
show(rest)
</abjad>


Making rests from other Abjad leaves
------------------------------------

You can make rests from other Abjad leaves:

<abjad>
note = Note("d'4..")
show(note)
</abjad>

<abjad>
rest = Rest(note)
show(rest)
</abjad>


Making multi-measure rests
--------------------------

You can create multimeasure rests too:

<abjad>
multimeasure_rest = resttools.MultimeasureRest('R1')
show(multimeasure_rest)
</abjad>

<abjad>
multimeasure_rest.lilypond_duration_multiplier = 4
staff = Staff([multimeasure_rest])
show(staff)
</abjad>

<abjad>
command = marktools.LilyPondCommandMark('compressFullBarRests')
command.attach(staff)
show(staff)
</abjad>


Getting and setting the written duration of rests
-------------------------------------------------

Get the written duration of rests like this:

<abjad>
rest.written_duration
</abjad>

Set the written duration of rests like this:

<abjad>
rest.written_duration = Duration(3, 16)
show(rest)
</abjad>
