Named pitches
=============

Named pitches are the everyday pitches attached to notes and chords:

<abjad>
note = Note("cs''8")
show(note)
</abjad>

<abjad>
note.written_pitch
</abjad>


Creating named pitches
----------------------

Create named pitches like this:

<abjad>
named_pitch = NamedPitch("cs''")
</abjad>

<abjad>
named_pitch
</abjad>


Inspecting the name of a named pitch
------------------------------------

Use ``str()`` to get the name of named pitches:

<abjad>
str(named_pitch)
</abjad>


Inspecting the octave of a named pitch
--------------------------------------

Get the octave number of named pitches with ``octave_number``:

<abjad>
named_pitch.octave_number
</abjad>


Sorting named pitches
---------------------

Named pitches sort by octave, diatonic pitch-class and accidental:

<abjad>
pitchtools.NamedPitch('es') < pitchtools.NamedPitch('ff')
</abjad>


Comparing named pitches
-----------------------

You can compare named pitches to each other:

<abjad>
named_pitch_1 = pitchtools.NamedPitch("c''")
named_pitch_2 = pitchtools.NamedPitch("d''")
</abjad>

<abjad>
named_pitch_1 == named_pitch_2
</abjad>

<abjad>
named_pitch_1 != named_pitch_2
</abjad>

<abjad>
named_pitch_1 > named_pitch_2
</abjad>

<abjad>
named_pitch_1 < named_pitch_2
</abjad>

<abjad>
named_pitch_1 >= named_pitch_2
</abjad>

<abjad>
named_pitch_1 <= named_pitch_2
</abjad>


Converting a named pitch to a numbered pitch
--------------------------------------------

Convert a named pitch to a numbered pitch like this:

<abjad>
named_pitch.numbered_pitch
</abjad>

Or like this:

<abjad>
pitchtools.NumberedPitch(named_pitch)
</abjad>


Converting a named pitch to a named pitch-class
-----------------------------------------------

Convert a named pitch to a named pitch-class like this:

<abjad>
named_pitch.named_pitch_class
</abjad>

Or like this:

<abjad>
pitchtools.NamedPitchClass(named_pitch)
</abjad>


Converting a named pitch to a numbered pitch-class
--------------------------------------------------

Convert a named pitch to a numbered pitch-class like this:

<abjad>
named_pitch.numbered_pitch_class
</abjad>

Or like this:

<abjad>
pitchtools.NumberedPitchClass(named_pitch)
</abjad>


Copying named pitches
---------------------

Use ``copy.copy()`` to copy named pitches:

<abjad>
import copy
</abjad>

<abjad>
copy.copy(named_pitch)
</abjad>

Or use ``copy.deepcopy()`` to do the same thing.
