ScaleDegree

class tonalanalysistools.ScaleDegree(string=1)

Scale degree.

>>> from abjad.tools import tonalanalysistools
>>> tonalanalysistools.ScaleDegree('#4')
ScaleDegree('#4')

Lineage

digraph InheritanceGraph { graph [background=transparent, bgcolor=transparent, color=lightslategrey, fontname=Arial, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, root="__builtin__.object", splines=spline, style="dotted, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=12, penwidth=2, style="filled, rounded"]; edge [color=lightsteelblue2, penwidth=2]; subgraph cluster_abctools { graph [label=abctools]; "abjad.tools.abctools.AbjadObject.AbjadObject" [color=1, group=0, label=AbjadObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" [color=1, group=0, label=AbstractBase, shape=box]; "abjad.tools.abctools.AbjadValueObject.AbjadValueObject" [color=1, group=0, label=AbjadValueObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbjadObject" -> "abjad.tools.abctools.AbjadValueObject.AbjadValueObject"; "abjad.tools.abctools.AbjadObject.AbstractBase" -> "abjad.tools.abctools.AbjadObject.AbjadObject"; } subgraph cluster_tonalanalysistools { graph [label=tonalanalysistools]; "abjad.tools.tonalanalysistools.ScaleDegree.ScaleDegree" [color=black, fontcolor=white, group=2, label=<<B>ScaleDegree</B>>, shape=box, style="filled, rounded"]; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=2, group=1, label=object, shape=box]; } "abjad.tools.abctools.AbjadValueObject.AbjadValueObject" -> "abjad.tools.tonalanalysistools.ScaleDegree.ScaleDegree"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Bases

Attribute summary

accidental Gets accidental.
from_accidental_and_number(accidental, 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.
__copy__(*arguments) Copies Abjad value object.
__eq__(argument) Is true when argument is a scale degree with number and accidental equal to those of this scale degree.
__format__([format_specification]) Formats Abjad object.
__hash__() Hashes scale degree.
__ne__(argument) Is true when Abjad object does not equal argument.
__repr__() Gets interpreter representation of Abjad object.
__str__() Gets string representation of scale degree.

Read-only properties

ScaleDegree.accidental

Gets accidental.

>>> tonalanalysistools.ScaleDegree('#4').accidental
Accidental('sharp')

Returns accidental.

ScaleDegree.name

Gets name.

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

Returns string.

ScaleDegree.number

Gets number.

>>> tonalanalysistools.ScaleDegree('#4').number
4

Returns integer from 1 to 7, inclusive.

ScaleDegree.roman_numeral_string

Gets Roman numeral string.

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

Returns string.

ScaleDegree.string

Gets string.

>>> tonalanalysistools.ScaleDegree('b4').string
'b4'
>>> tonalanalysistools.ScaleDegree('4').string
'4'
>>> tonalanalysistools.ScaleDegree('#4').string
'#4'

Returns string.

ScaleDegree.title_string

Gets title string.

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

Returns string.

Class & static methods

static ScaleDegree.from_accidental_and_number(accidental, number)

Makes scale degree from accidental and number.

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

Returns new scale degree.

Special methods

(AbjadValueObject).__copy__(*arguments)

Copies Abjad value object.

Returns new Abjad value object.

ScaleDegree.__eq__(argument)

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

>>> degree_1 = tonalanalysistools.ScaleDegree('#4')
>>> degree_2 = tonalanalysistools.ScaleDegree('#4')
>>> degree_3 = tonalanalysistools.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.

ScaleDegree.__hash__()

Hashes scale degree.

Returns integer.

(AbjadObject).__ne__(argument)

Is true when Abjad object does not equal argument. Otherwise false.

Returns true or false.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.

ScaleDegree.__str__()

Gets string representation of scale degree.

>>> str(tonalanalysistools.ScaleDegree('#4'))
'#4'

Returns string.