Tuning

class indicatortools.Tuning(pitches=None)

Tuning indicator.

Example 1. Violin tuning:

>>> indicator = indicatortools.Tuning(
...     pitches=('G3', 'D4', 'A4', 'E5'),
...     )
>>> print(format(indicator))
indicatortools.Tuning(
    pitches=pitchtools.PitchSegment(
        (
            pitchtools.NamedPitch('g'),
            pitchtools.NamedPitch("d'"),
            pitchtools.NamedPitch("a'"),
            pitchtools.NamedPitch("e''"),
            ),
        item_class=pitchtools.NamedPitch,
        ),
    )

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_indicatortools { graph [label=indicatortools]; "abjad.tools.indicatortools.Tuning.Tuning" [color=black, fontcolor=white, group=2, label=<<B>Tuning</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.indicatortools.Tuning.Tuning"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Bases

Attribute summary

default_scope Gets default scope of tuning.
get_pitch_ranges_by_string_number(string_number) Gets tuning pitch ranges by string number.
get_pitches_by_string_number(string_number) Gets tuning pitches by string number.
pitch_ranges Gets two-octave pitch-ranges for each pitch in this tuning.
pitches Gets pitches of tuning.
voice_pitch_classes(pitch_classes[, ...]) Voices pitch_classes.
__copy__(\*args) Copies Abjad value object.
__eq__(expr) Is true when all initialization values of Abjad value object equal the initialization values of expr.
__format__([format_specification]) Formats Abjad object.
__hash__() Hashes Abjad value object.
__ne__(expr) Is true when Abjad object does not equal expr.
__repr__() Gets interpreter representation of Abjad object.

Read-only properties

Tuning.default_scope

Gets default scope of tuning.

Example 1. Violin tuning

>>> indicator = indicatortools.Tuning(
...     pitches=('G3', 'D4', 'A4', 'E5'),
...     )
>>> indicator.default_scope is None
True

Returns none.

Tuning.pitch_ranges

Gets two-octave pitch-ranges for each pitch in this tuning.

Example 1.

>>> pitch_ranges = indicator.pitch_ranges
>>> print(format(pitch_ranges))
pitchtools.PitchRangeInventory(
    [
        pitchtools.PitchRange(
            range_string='[G3, G5]',
            ),
        pitchtools.PitchRange(
            range_string='[D4, D6]',
            ),
        pitchtools.PitchRange(
            range_string='[A4, A6]',
            ),
        pitchtools.PitchRange(
            range_string='[E5, E7]',
            ),
        ]
    )

Returns pitch-range inventory.

Tuning.pitches

Gets pitches of tuning.

Example 1.

>>> pitches = indicator.pitches
>>> print(format(pitches))
pitchtools.PitchSegment(
    (
        pitchtools.NamedPitch('g'),
        pitchtools.NamedPitch("d'"),
        pitchtools.NamedPitch("a'"),
        pitchtools.NamedPitch("e''"),
        ),
    item_class=pitchtools.NamedPitch,
    )

Returns pitch segment.

Methods

Tuning.get_pitch_ranges_by_string_number(string_number)

Gets tuning pitch ranges by string number.

Example 1. Violin tuning:

>>> tuning = indicatortools.Tuning(('G3', 'D4', 'A4', 'E5'))
>>> string_number = indicatortools.StringNumber((2, 3))
>>> tuning.get_pitch_ranges_by_string_number(string_number)
(PitchRange(range_string='[A4, A6]'), PitchRange(range_string='[D4, D6]'))

Returns pitch ranges.

Tuning.get_pitches_by_string_number(string_number)

Gets tuning pitches by string number.

Example 1. Violin tuning:

>>> tuning = indicatortools.Tuning(('G3', 'D4', 'A4', 'E5'))
>>> string_number = indicatortools.StringNumber((2, 3))
>>> tuning.get_pitches_by_string_number(string_number)
(NamedPitch("a'"), NamedPitch("d'"))

Returns named pitches.

Tuning.voice_pitch_classes(pitch_classes, allow_open_strings=True)

Voices pitch_classes.

Example 1.

>>> tuning = indicatortools.Tuning(('G3', 'D4', 'A4', 'E5'))
>>> voicings = tuning.voice_pitch_classes(('a',))
>>> for voicing in voicings:
...     voicing
...
(NamedPitch('a'), None, None, None)
(NamedPitch("a'"), None, None, None)
(None, NamedPitch("a'"), None, None)
(None, NamedPitch("a''"), None, None)
(None, None, NamedPitch("a'"), None)
(None, None, NamedPitch("a''"), None)
(None, None, NamedPitch("a'''"), None)
(None, None, None, NamedPitch("a''"))
(None, None, None, NamedPitch("a'''"))
>>> voicings = tuning.voice_pitch_classes(
...     ('a', 'd'),
...     allow_open_strings=False,
...     )
>>> for voicing in voicings:
...     voicing
...
(NamedPitch('a'), NamedPitch("d''"), None, None)
(NamedPitch('a'), NamedPitch("d'''"), None, None)
(NamedPitch('a'), None, NamedPitch("d''"), None)
(NamedPitch('a'), None, NamedPitch("d'''"), None)
(NamedPitch('a'), None, None, NamedPitch("d'''"))
(NamedPitch('a'), None, None, NamedPitch("d''''"))
(NamedPitch("d'"), NamedPitch("a'"), None, None)
(NamedPitch("d'"), NamedPitch("a''"), None, None)
(NamedPitch("d'"), None, NamedPitch("a''"), None)
(NamedPitch("d'"), None, NamedPitch("a'''"), None)
(NamedPitch("d'"), None, None, NamedPitch("a''"))
(NamedPitch("d'"), None, None, NamedPitch("a'''"))
(NamedPitch("a'"), NamedPitch("d''"), None, None)
(NamedPitch("a'"), NamedPitch("d'''"), None, None)
(NamedPitch("a'"), None, NamedPitch("d''"), None)
(NamedPitch("a'"), None, NamedPitch("d'''"), None)
(NamedPitch("a'"), None, None, NamedPitch("d'''"))
(NamedPitch("a'"), None, None, NamedPitch("d''''"))
(NamedPitch("d''"), NamedPitch("a'"), None, None)
(NamedPitch("d''"), NamedPitch("a''"), None, None)
(NamedPitch("d''"), None, NamedPitch("a''"), None)
(NamedPitch("d''"), None, NamedPitch("a'''"), None)
(NamedPitch("d''"), None, None, NamedPitch("a''"))
(NamedPitch("d''"), None, None, NamedPitch("a'''"))
(None, NamedPitch("a'"), NamedPitch("d''"), None)
(None, NamedPitch("a'"), NamedPitch("d'''"), None)
(None, NamedPitch("a'"), None, NamedPitch("d'''"))
(None, NamedPitch("a'"), None, NamedPitch("d''''"))
(None, NamedPitch("d''"), NamedPitch("a''"), None)
(None, NamedPitch("d''"), NamedPitch("a'''"), None)
(None, NamedPitch("d''"), None, NamedPitch("a''"))
(None, NamedPitch("d''"), None, NamedPitch("a'''"))
(None, NamedPitch("a''"), NamedPitch("d''"), None)
(None, NamedPitch("a''"), NamedPitch("d'''"), None)
(None, NamedPitch("a''"), None, NamedPitch("d'''"))
(None, NamedPitch("a''"), None, NamedPitch("d''''"))
(None, NamedPitch("d'''"), NamedPitch("a''"), None)
(None, NamedPitch("d'''"), NamedPitch("a'''"), None)
(None, NamedPitch("d'''"), None, NamedPitch("a''"))
(None, NamedPitch("d'''"), None, NamedPitch("a'''"))
(None, None, NamedPitch("d''"), NamedPitch("a''"))
(None, None, NamedPitch("d''"), NamedPitch("a'''"))
(None, None, NamedPitch("a''"), NamedPitch("d'''"))
(None, None, NamedPitch("a''"), NamedPitch("d''''"))
(None, None, NamedPitch("d'''"), NamedPitch("a''"))
(None, None, NamedPitch("d'''"), NamedPitch("a'''"))
(None, None, NamedPitch("a'''"), NamedPitch("d'''"))
(None, None, NamedPitch("a'''"), NamedPitch("d''''"))

Returns tuple of sequences.

Special methods

(AbjadValueObject).__copy__(*args)

Copies Abjad value object.

Returns new Abjad value object.

(AbjadValueObject).__eq__(expr)

Is true when all initialization values of Abjad value object equal the initialization values of expr.

Returns true or false.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to ‘’ or ‘storage’. Interprets ‘’ equal to ‘storage’.

Returns string.

(AbjadValueObject).__hash__()

Hashes Abjad value object.

Returns integer.

(AbjadObject).__ne__(expr)

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

Returns true or false.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.