Notes
=====


Making notes from a LilyPond input string
-----------------------------------------

You can make notes from a LilyPond input string:

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


Making notes from numbers
-------------------------

You can also make notes from a pitch number and duration:

<abjad>
note = Note(0, Duration(1, 4))
show(note)
</abjad>


Getting and setting the written pitch of notes
----------------------------------------------

Get the written pitch of notes like this:

<abjad>
note.written_pitch
</abjad>

Set the written pitch of notes like this:

<abjad>
note.written_pitch = NamedPitch("cs'")
show(note)
</abjad>

Or this:

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

Or this:

<abjad>
note.written_pitch = 3
show(note)
</abjad>


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

Get the written duration of notes like this:

<abjad>
note.written_duration
</abjad>

Set the written duration of notes like this:

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


Overriding notes
----------------

The notes below are black with fixed thickness and predetermined spacing:

<abjad>
staff = Staff("c'4 d'4 e'4 f'4 g'4 a'4 g'2")
slur_1 = spannertools.SlurSpanner(staff[:2])
slur_2 = spannertools.SlurSpanner(staff[2:4])
slur_3 = spannertools.SlurSpanner(staff[4:6])
show(staff)
</abjad>

You can override LilyPond grobs to change the way notes look:

<abjad>
staff[-1].override.note_head.color = 'red'
staff[-1].override.stem.color = 'red'
show(staff)
</abjad>


Removing note overrides
-----------------------

Delete grob overrides you no longer want like this:

<abjad>
del(staff[-1].override.stem)
show(staff)
</abjad>
