ScaleDegree

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.system" { graph [label="abjad.system"]; node [color=1]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjadext/tonality/../../abjad/system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; "abjad.system.AbjadValueObject.AbjadValueObject" [URL="../api/abjadext/tonality/../../abjad/system/AbjadValueObject.html#abjad.system.AbjadValueObject.AbjadValueObject", label="Abjad\nValue\nObject", target=_top]; "abjad.system.AbjadObject.AbjadObject" -> "abjad.system.AbjadValueObject.AbjadValueObject"; } subgraph "cluster_abjadext.tonality" { graph [label="abjadext.tonality"]; node [color=2]; "abjadext.tonality.ScaleDegree.ScaleDegree" [URL="../api/abjadext/tonality/ScaleDegree.html#abjadext.tonality.ScaleDegree.ScaleDegree", color=black, fontcolor=white, label="Scale\nDegree", target=_top]; } 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" -> "abjadext.tonality.ScaleDegree.ScaleDegree"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjadext.tonality.ScaleDegree.ScaleDegree(string=1)

Scale degree.

>>> abjadext.tonality.ScaleDegree('#4')
ScaleDegree('#4')

Attributes Summary

__eq__ Is true when argument is a scale degree with number and accidental equal to those of this scale degree.
__hash__ Hashes scale degree.
__str__ Gets string representation of scale degree.
accidental Gets accidental.
from_accidental_and_number Makes scale degree from accidental and number.
name Gets name.
number Gets number.
roman_numeral_string Gets Roman numeral string.
string Gets string.
title_string Gets title string.

Special methods

(AbjadValueObject).__copy__(*arguments)

Copies Abjad value object.

Returns new Abjad value object.

__eq__(argument)

Is true when argument is a scale degree with number and accidental equal to those of this scale degree.

>>> degree_1 = abjadext.tonality.ScaleDegree('#4')
>>> degree_2 = abjadext.tonality.ScaleDegree('#4')
>>> degree_3 = abjadext.tonality.ScaleDegree(5)
>>> degree_1 == degree_1
True
>>> degree_1 == degree_2
True
>>> degree_1 == degree_3
False
>>> degree_2 == degree_1
True
>>> degree_2 == degree_2
True
>>> degree_2 == degree_3
False
>>> degree_3 == degree_1
False
>>> degree_3 == degree_2
False
>>> degree_3 == degree_3
True

Returns true or false.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

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

Returns string.

__hash__()

Hashes scale degree.

Returns integer.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.

__str__()

Gets string representation of scale degree.

>>> str(abjadext.tonality.ScaleDegree('#4'))
'#4'

Returns string.


Class & static methods

static from_accidental_and_number(accidental, number)

Makes scale degree from accidental and number.

>>> class_ = abjadext.tonality.ScaleDegree
>>> class_.from_accidental_and_number('sharp', 4)
ScaleDegree('#4')

Returns new scale degree.


Read-only properties

accidental

Gets accidental.

>>> abjadext.tonality.ScaleDegree('#4').accidental
Accidental('sharp')

Returns accidental.

name

Gets name.

>>> abjadext.tonality.ScaleDegree(1).name
'tonic'
>>> abjadext.tonality.ScaleDegree(2).name
'superdominant'
>>> abjadext.tonality.ScaleDegree(3).name
'mediant'
>>> abjadext.tonality.ScaleDegree(4).name
'subdominant'
>>> abjadext.tonality.ScaleDegree(5).name
'dominant'
>>> abjadext.tonality.ScaleDegree(6).name
'submediant'
>>> abjadext.tonality.ScaleDegree(7).name
'leading tone'

Returns string.

number

Gets number.

>>> abjadext.tonality.ScaleDegree('#4').number
4

Returns integer from 1 to 7, inclusive.

roman_numeral_string

Gets Roman numeral string.

>>> degree = abjadext.tonality.ScaleDegree('#4')
>>> degree.roman_numeral_string
'IV'

Returns string.

string

Gets string.

>>> abjadext.tonality.ScaleDegree('b4').string
'b4'
>>> abjadext.tonality.ScaleDegree('4').string
'4'
>>> abjadext.tonality.ScaleDegree('#4').string
'#4'

Returns string.

title_string

Gets title string.

>>> abjadext.tonality.ScaleDegree('b4').title_string
'FlatFour'
>>> abjadext.tonality.ScaleDegree('4').title_string
'Four'
>>> abjadext.tonality.ScaleDegree('#4').title_string
'SharpFour'

Returns string.