et

Package for equal tempered microtones.

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_abjadext.microtones.et" { graph [label="abjadext.microtones.et"]; node [color=1]; "abjadext.microtones.et.ETBundle" [URL="../api/abjadext/microtones/et.html#abjadext.microtones.et.ETBundle", color=black, fontcolor=white, label=ETBundle, target=_top]; } subgraph cluster_builtins { graph [label=builtins]; node [color=2]; "builtins.object" [URL="https://docs.python.org/3.7/library/functions.html#object", label=object, target=_top]; } "builtins.object" -> "abjadext.microtones.et.ETBundle"; }


Classes

ETBundle

ET bundle.

class abjadext.microtones.et.ETBundle(pitch="c'", accidental_string=None)[source]

ET bundle.

>>> from abjadext import microtones

Attributes Summary

__repr__

Gets interpreter representation.


Special methods

overridden __repr__()[source]

Gets interpreter representation.

>>> microtones.ETBundle()
ETBundle(pitch="c'")

Functions

apply_alteration

Applies alteration.

get_accidental_value

Gets accidental value.

get_alteration

Gets alteration.

get_value_sum

Gets value sum.

abjadext.microtones.et.apply_alteration(note_head, value, spell=None)[source]

Applies alteration.

Eighth tone accidentals:

>>> from quicktions import Fraction
>>> steps = [0, "1/8", "2/8", "3/8", "4/8", "5/8", "6/8", "7/8", 1]
>>> steps = [Fraction(step) * 2 for step in steps]
>>> reverse_steps = [0 - step for step in steps]
>>> reverse_steps.reverse()
>>> total_steps = []
>>> total_steps.extend(reverse_steps)
>>> total_steps.extend(steps)
>>> final_steps = sorted(list(set(total_steps)))
>>> notes = [abjad.Note("c'4") for step in final_steps]
>>> for note, step in zip(notes, final_steps):
...     microtones.apply_alteration(note.note_head, step)
... 
>>> staff = abjad.Staff(notes)
>>> score = abjad.Score([staff])
>>> moment = "#(ly:make-moment 1 25)"
>>> abjad.setting(score).proportional_notation_duration = moment
>>> lilypond_file = abjad.LilyPondFile(
...     items=[score, abjad.Block(name="layout")],
...     includes=[
...         "default.ily",
...         "abjad.ily",
...         "all-edo-markups-example.ily",
...     ],
...     global_staff_size=16,
... )
>>> style = '"dodecaphonic"'
>>> lilypond_file.layout_block.items.append(fr"\accidentalStyle {style}")
>>> abjad.show(lilypond_file)  

Tenth tone accidentals:

>>> from quicktions import Fraction
>>> steps = [
...     0,
...     "1/10",
...     "2/10",
...     "3/10",
...     "4/10",
...     "5/10",
...     "6/10",
...     "7/10",
...     "8/10",
...     "9/10",
...     1,
... ]
>>> steps = [Fraction(step) * 2 for step in steps]
>>> reverse_steps = [0 - step for step in steps]
>>> reverse_steps.reverse()
>>> total_steps = []
>>> total_steps.extend(reverse_steps)
>>> total_steps.extend(steps)
>>> final_steps = sorted(list(set(total_steps)))
>>> notes = [abjad.Note("c'4") for step in final_steps]
>>> for note, step in zip(notes, final_steps):
...     microtones.apply_alteration(note.note_head, step)
... 
>>> staff = abjad.Staff(notes)
>>> score = abjad.Score([staff])
>>> moment = "#(ly:make-moment 1 25)"
>>> abjad.setting(score).proportional_notation_duration = moment
>>> lilypond_file = abjad.LilyPondFile(
...     items=[score, abjad.Block(name="layout")],
...     includes=[
...         "default.ily",
...         "abjad.ily",
...         "all-edo-markups-example.ily",
...     ],
...     global_staff_size=16,
... )
>>> style = '"dodecaphonic"'
>>> lilypond_file.layout_block.items.append(fr"\accidentalStyle {style}")
>>> abjad.show(lilypond_file)  

Twelfth tone accidentals:

>>> from quicktions import Fraction
>>> steps = [
...     0,
...     "1/12",
...     "2/12",
...     "3/12",
...     "4/12",
...     "5/12",
...     "6/12",
...     "7/12",
...     "8/12",
...     "9/12",
...     "10/12",
...     "11/12",
...     1,
... ]
>>> steps = [Fraction(step) * 2 for step in steps]
>>> reverse_steps = [0 - step for step in steps]
>>> reverse_steps.reverse()
>>> total_steps = []
>>> total_steps.extend(reverse_steps)
>>> total_steps.extend(steps)
>>> final_steps = sorted(list(set(total_steps)))
>>> notes = [abjad.Note("c'4") for step in final_steps]
>>> for note, step in zip(notes, final_steps):
...     microtones.apply_alteration(note.note_head, step)
... 
>>> staff = abjad.Staff(notes)
>>> score = abjad.Score([staff])
>>> moment = "#(ly:make-moment 1 25)"
>>> abjad.setting(score).proportional_notation_duration = moment
>>> lilypond_file = abjad.LilyPondFile(
...     items=[score, abjad.Block(name="layout")],
...     includes=[
...         "default.ily",
...         "abjad.ily",
...         "all-edo-markups-example.ily",
...     ],
...     global_staff_size=16,
... )
>>> style = '"dodecaphonic"'
>>> lilypond_file.layout_block.items.append(fr"\accidentalStyle {style}")
>>> abjad.show(lilypond_file)  

Spells with sharps when spell="sharp":

>>> step = "3/2"
>>> note = abjad.Note("c'4")
>>> microtones.apply_alteration(note.note_head, step, spell="sharp")
>>> staff = abjad.Staff([note])
>>> score = abjad.Score([staff])
>>> moment = "#(ly:make-moment 1 25)"
>>> abjad.setting(score).proportional_notation_duration = moment
>>> lilypond_file = abjad.LilyPondFile(
...     items=[score, abjad.Block(name="layout")],
...     includes=[
...         "default.ily",
...         "abjad.ily",
...         "all-edo-markups-example.ily",
...     ],
...     global_staff_size=16,
... )
>>> style = '"dodecaphonic"'
>>> lilypond_file.layout_block.items.append(fr"\accidentalStyle {style}")
>>> abjad.show(lilypond_file)  

Spells with flats when spell="flat":

>>> step = "3/2"
>>> note = abjad.Note("c'4")
>>> microtones.apply_alteration(note.note_head, step, spell="flat")
>>> staff = abjad.Staff([note])
>>> score = abjad.Score([staff])
>>> moment = "#(ly:make-moment 1 25)"
>>> abjad.setting(score).proportional_notation_duration = moment
>>> lilypond_file = abjad.LilyPondFile(
...     items=[score, abjad.Block(name="layout")],
...     includes=[
...         "default.ily",
...         "abjad.ily",
...         "all-edo-markups-example.ily",
...     ],
...     global_staff_size=16,
... )
>>> style = '"dodecaphonic"'
>>> lilypond_file.layout_block.items.append(fr"\accidentalStyle {style}")
>>> abjad.show(lilypond_file)  
abjadext.microtones.et.get_accidental_value(pitch)[source]

Gets accidental value.

>>> pitch = abjad.NamedPitch("cs'")
>>> microtones.get_accidental_value(pitch)
1
abjadext.microtones.et.get_alteration(pitch, value, spell=None)[source]

Gets alteration.

>>> pitch = abjad.NumberedPitch(0)
>>> bundle = microtones.get_alteration(pitch, "2/1")
>>> bundle.pitch
NumberedPitch(2)
>>> bundle.accidental_string
'\\abjad-natural-markup'
>>> pitch = abjad.NumberedPitch(0)
>>> bundle = microtones.get_alteration(pitch, "1/1")
>>> bundle.pitch
NumberedPitch(1)
>>> bundle.accidental_string
'\\abjad-sharp-markup'
>>> pitch = abjad.NumberedPitch(0)
>>> bundle = microtones.get_alteration(pitch, "1/1", "flat")
>>> bundle.pitch
NamedPitch("df'")
>>> bundle.accidental_string
'\\abjad-flat-markup'
>>> pitch = abjad.NumberedPitch(0)
>>> bundle = microtones.get_alteration(pitch, "3/2", "sharp")
>>> bundle.pitch
NumberedPitch(1)
>>> bundle.accidental_string
'\\three-quarters-sharp-markup'
>>> pitch = abjad.NumberedPitch(0)
>>> bundle = microtones.get_alteration(pitch, "11/6", "sharp")
>>> bundle.pitch
NumberedPitch(1)
>>> bundle.accidental_string
'\\eleven-twelfths-sharp-markup'
abjadext.microtones.et.get_value_sum(pitch, value)[source]

Gets value sum.

>>> pitch = abjad.NamedPitch("cs'")
>>> microtones.get_value_sum(pitch, "3/4")
Fraction(7, 4)