Exemplo n.º 1
0
def test_tonalanalysistools_Mode___init___02():
    r'''Initialize with other mode instance.
    '''

    mode = tonalanalysistools.Mode('dorian')
    new = tonalanalysistools.Mode(mode)

    assert new.mode_name == 'dorian'
def test_tonalanalysistools_Mode___eq___02():
    r'''Synonym modes do not compare equal, by definition.
    '''

    major = tonalanalysistools.Mode('major')
    ionian = tonalanalysistools.Mode('ionian')

    assert not major == ionian
    assert not ionian == major
Exemplo n.º 3
0
def test_tonalanalysistools_Mode___ne___01():

    mode_1 = tonalanalysistools.Mode('dorian')
    mode_2 = tonalanalysistools.Mode('dorian')
    mode_3 = tonalanalysistools.Mode('phrygian')

    assert not mode_1 != mode_1
    assert not mode_1 != mode_2
    assert mode_1 != mode_3
    assert not mode_2 != mode_1
    assert not mode_2 != mode_2
    assert mode_2 != mode_3
    assert mode_3 != mode_1
    assert mode_3 != mode_2
    assert not mode_3 != mode_3
def test_tonalanalysistools_Mode_named_interval_segment_01():

    m2 = pitchtools.NamedInterval('minor', 2)
    M2 = pitchtools.NamedInterval('major', 2)

    mdig = tonalanalysistools.Mode('dorian').named_interval_segment
    intervals = [M2, m2, M2, M2, M2, m2, M2]
    assert mdig == pitchtools.IntervalSegment(intervals)

    mdig = tonalanalysistools.Mode('phrygian').named_interval_segment
    intervals = [m2, M2, M2, M2, m2, M2, M2]
    assert mdig == pitchtools.IntervalSegment(intervals)

    mdig = tonalanalysistools.Mode('lydian').named_interval_segment
    intervals = [M2, M2, M2, m2, M2, M2, m2]
    assert mdig == pitchtools.IntervalSegment(intervals)
Exemplo n.º 5
0
 def __init__(self, tonic='c', mode='major'):
     from abjad.tools import pitchtools
     from abjad.tools import scoretools
     from abjad.tools import tonalanalysistools
     tonic = pitchtools.NamedPitchClass(tonic)
     mode = tonalanalysistools.Mode(mode)
     self._tonic = tonic
     self._mode = mode
     self._default_scope = scoretools.Staff
Exemplo n.º 6
0
def test_tonalanalysistools_Mode___init___01():
    r'''Initialize with mode name.
    '''

    mode = tonalanalysistools.Mode('dorian')
    assert mode.mode_name == 'dorian'