Octave

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph "cluster_abjad.pitch" { graph [label="abjad.pitch"]; node [color=1]; "abjad.pitch.Octave.Octave" [URL="../api/abjad/pitch/Octave.html#abjad.pitch.Octave.Octave", color=black, fontcolor=white, label=Octave, target=_top]; } subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=2]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/pitch/../system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; "abjad.system.AbjadValueObject.AbjadValueObject" [URL="../api/abjad/pitch/../system/AbjadValueObject.html#abjad.system.AbjadValueObject.AbjadValueObject", label="Abjad\nValue\nObject", target=_top]; "abjad.system.AbjadObject.AbjadObject" -> "abjad.system.AbjadValueObject.AbjadValueObject"; } subgraph cluster_builtins { graph [label=builtins]; node [color=3]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } "abjad.system.AbjadValueObject.AbjadValueObject" -> "abjad.pitch.Octave.Octave"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjad.pitch.Octave.Octave(number=4)

Octave.

Initializes octave from integer:

>>> abjad.Octave(4)
Octave(4)

Initializes octave from octave-tick string:

>>> abjad.Octave(",,")
Octave(1)

Initializes octave from named pitch:

>>> abjad.Octave(abjad.NamedPitch("cs''"))
Octave(5)

Initializes octave from other octave:

>>> abjad.Octave(abjad.Octave(2))
Octave(2)

Attributes Summary

__eq__ Is true when argument is octave with same octave number.
__float__ Get octave number as float.
__ge__ Return a >= b.
__gt__ Return a > b.
__hash__ Hashes octave.
__int__ Get octave number integer.
__le__ Return a <= b.
__lt__ Is true when octave is less than argument.
__str__ Gets string representation of octave.
from_pitch Makes octave from pitch.
number Gets octave number.
pitch_number Gets pitch number of first note in octave.
pitch_range Gets pitch range of octave.
ticks Gets LilyPond octave tick string.

Special methods

(AbjadValueObject).__copy__(*arguments)

Copies Abjad value object.

Returns new Abjad value object.

__eq__(argument)

Is true when argument is octave with same octave number.

>>> octave_1 = abjad.Octave(4)
>>> octave_2 = abjad.Octave(4)
>>> octave_3 = abjad.Octave(5)
>>> octave_1 == octave_1
True
>>> octave_1 == octave_2
True
>>> octave_1 == octave_3
False
>>> octave_2 == octave_1
True
>>> octave_2 == octave_2
True
>>> octave_2 == octave_3
False
>>> octave_3 == octave_1
False
>>> octave_3 == octave_2
False
>>> octave_3 == octave_3
True

Returns true or false.

__float__()

Get octave number as float.

Returns float.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to '' or 'storage'. Interprets '' equal to 'storage'.

Returns string.

__ge__(other, NotImplemented=NotImplemented)

Return a >= b. Computed by @total_ordering from (not a < b).

__gt__(other, NotImplemented=NotImplemented)

Return a > b. Computed by @total_ordering from (not a < b) and (a != b).

__hash__()

Hashes octave.

Returns integer.

__int__()

Get octave number integer.

Returns integer.

__le__(other, NotImplemented=NotImplemented)

Return a <= b. Computed by @total_ordering from (a < b) or (a == b).

__lt__(argument)

Is true when octave is less than argument.

>>> octave_1 = abjad.Octave(4)
>>> octave_2 = abjad.Octave(4)
>>> octave_3 = abjad.Octave(5)
>>> octave_1 < octave_1
False
>>> octave_1 < octave_2
False
>>> octave_1 < octave_3
True
>>> octave_2 < octave_1
False
>>> octave_2 < octave_2
False
>>> octave_2 < octave_3
True
>>> octave_3 < octave_1
False
>>> octave_3 < octave_2
False
>>> octave_3 < octave_3
False

Returns true or false.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.

__str__()

Gets string representation of octave.

Defined equal to LilyPond octave / tick representation of octave.

>>> str(abjad.Octave(4))
"'"
>>> str(abjad.Octave(1))
',,'
>>> str(abjad.Octave(3))
''

Returns string.


Class & static methods

classmethod from_pitch(pitch)

Makes octave from pitch.

>>> abjad.Octave.from_pitch('cs')
Octave(3)
>>> abjad.Octave.from_pitch("cs'")
Octave(4)
>>> abjad.Octave.from_pitch(1)
Octave(4)
>>> abjad.Octave.from_pitch(13)
Octave(5)

Returns integer.


Read-only properties

number

Gets octave number.

>>> abjad.Octave(5).number
5

Returns integer.

pitch_number

Gets pitch number of first note in octave.

>>> abjad.Octave(4).pitch_number
0
>>> abjad.Octave(5).pitch_number
12
>>> abjad.Octave(3).pitch_number
-12

Returns integer.

pitch_range

Gets pitch range of octave.

>>> abjad.Octave(5).pitch_range
PitchRange('[C5, C6)')

Returns pitch range.

ticks

Gets LilyPond octave tick string.

>>> for i in range(-1, 9):
...     print(i, abjad.Octave(i).ticks)
-1 ,,,,
0  ,,,
1  ,,
2  ,
3
4  '
5  ''
6  '''
7  ''''
8  '''''

Returns string.